## Index

### Modules

- __global

### Variables

- global

### Functions

- displayComponent
- fetchJSON
- getAdvancedBinding
- getSimplifiedJSONX
- simpleJSONXSyntax
- traverse
- validSimpleJSONXSyntax
- validateJSONX

## Variables

### global

global: any = typeof global !== "undefined"? global: typeof globalThis !== "undefined"? globalThis: {}

- Defined in utils.ts:8

## Functions

### displayComponent

- displayComponent(options?: { componentLibraries?: defs.jsonxLibrary; debug?: undefined | false | true; jsonx?: defs.jsonx; props?: any; renderIndex?: undefined | number }): boolean

- - Defined in utils.ts:43

  Used to evaluate whether or not to render a component

  example

    const sampleJSONX = { component: 'div', props: { id: 'generatedJSONX', className: 'jsonx', bigNum: 1430931039, smallNum: 0.425, falsey: false, truthy: true, }, children: 'some div', }; const testJSONX = Object.assign({}, sampleJSONX, { comparisonprops: [{ left: ['truthy',], operation:'==', right:['falsey',], }], }); displayComponent({ jsonx: testJSONX, props: testJSONX2.props, }) // => false

  #### Parameters

  - ##### Default value options: { componentLibraries?: defs.jsonxLibrary; debug?: undefined | false | true; jsonx?: defs.jsonx; props?: any; renderIndex?: undefined | number } = {}

    - ##### Optional componentLibraries?: defs.jsonxLibrary

    - ##### Optional debug?: undefined | false | true

    - ##### Optional jsonx?: defs.jsonx

      Valid JSONX JSON

    - ##### Optional props?: any

      Props to test comparison values against, usually Object.assign(jsonx.props,jsonx.asyncprops,jsonx.thisprops,jsonx.windowprops)

    - ##### Optional renderIndex?: undefined | number

  #### Returns boolean

  returns true if all comparisons are true or if using or comparisons, at least one condition is true

### fetchJSON

- fetchJSON(path?: string, options?: {}): Promise<any>

- - Defined in utils.ts:626

  Fetches JSON from remote path

  #### Parameters

  - ##### Default value path: string = ""

    fetch path url

  - ##### Default value options: {} = {}

    fetch options

  #### Returns Promise<any>

  - returns fetched JSON data

### getAdvancedBinding

- getAdvancedBinding(this: globalThisWindow): boolean

- - Defined in utils.ts:152

  Use to test if can bind components this context for react-redux-router

  #### Parameters

  - ##### this: globalThisWindow

  #### Returns boolean

  true if browser is not IE or old android / chrome

### getSimplifiedJSONX

- getSimplifiedJSONX(jsonx?: jsonx): jsonx

- - Defined in utils.ts:602

  Transforms Valid JSONX JSON to SimpleJSONX {component,props,children} => {[component]:{props,children}}

  #### Parameters

  - ##### Default value jsonx: jsonx = {}

    Valid JSONX JSON object

  #### Returns jsonx

  - returns a simple JSONX JSON Object from a valid JSONX JSON Object

### simpleJSONXSyntax

- simpleJSONXSyntax(simpleJSONX?: simpleJsonx): jsonx

- - Defined in utils.ts:570

  Transforms SimpleJSONX to Valid JSONX JSON {[component]:{props,children}} => {component,props,children}

  #### Parameters

  - ##### Default value simpleJSONX: simpleJsonx = {}

    JSON Object

  #### Returns jsonx

  - returns a valid JSONX JSON Object from a simple JSONX JSON Object

### traverse

- traverse(paths?: defs.traversePaths, data?: {}): jsonxResourceProps

- - Defined in utils.ts:224

  take an object of array paths to traverse and resolve

  example

    const testObj = { user: { name: 'jsonx', description: 'react withouth javascript', }, stats: { logins: 102, comments: 3, }, authentication: 'OAuth2', }; const testVals = { auth: ['authentication', ], username: ['user', 'name', ], };

    traverse(testVals, testObj) // =>{ auth:'OAuth2', username:'jsonx', }

  throws

    {TypeError}

  #### Parameters

  - ##### Default value paths: defs.traversePaths = {}

    an object to resolve array property paths

  - ##### Default value data: {} = {}

    object to traverse

  #### Returns jsonxResourceProps

  resolved object with traversed properties

### validSimpleJSONXSyntax

- validSimpleJSONXSyntax(simpleJSONX?: any): boolean

- - Defined in utils.ts:552

  validates simple JSONX Syntax {[component]:{props,children}}

  #### Parameters

  - ##### Default value simpleJSONX: any = {}

    Any valid simple JSONX Syntax

  #### Returns boolean

  returns true if simpleJSONX is valid

### validateJSONX

- validateJSONX(jsonx?: jsonx, returnAllErrors?: boolean): boolean | string

- - Defined in utils.ts:257

  Validates JSONX JSON Syntax

  example

    validateJSONX({component:'p',children:'hello world'})=>true validateJSONX({children:'hello world'})=>throw SyntaxError('[0001] Missing React Component')

  throws

    {SyntaxError|TypeError|ReferenceError}

  #### Parameters

  - ##### Default value jsonx: jsonx = {}

    JSONX JSON to validate

  - ##### Default value returnAllErrors: boolean = false

  #### Returns boolean | string

  either returns true if JSONX is valid, or throws validation error or returns list of errors in array