Function
Static Public Summary | ||
public |
A simple function to safely check if an object has a given property |
|
public |
dereference(schema: Array | Object, resolve: Object): Object This function dereferences a schema set into one logical schema in accordance with the IETF JSON Reference Draft v3 specification: |
|
public |
A method to safely iterate the properties of an object and execute some function for each of them. |
|
public |
An object literal variant of the Array.map function. |
|
public |
A function to allowing deep merging of object literals using various strategies. |
Static Public
public contains(object: Object, key: String): Boolean source
import {contains} from '@jdw/jst/src/object.js'
A simple function to safely check if an object has a given property
public dereference(schema: Array | Object, resolve: Object): Object source
import dereference from '@jdw/jst/src/dereference.js'
This function dereferences a schema set into one logical schema in accordance with the IETF JSON Reference Draft v3 specification:
https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03
It allows for one to inject a schema resolution function in order to provide it with referenced schema. This allows developers to be flexible in choosing there schema sources such as HTTP or in-memory resolvers.
The dereference function also resolves JSON Pointers according to the IETF RFC6901 specification:
https://tools.ietf.org/html/rfc6901
It does so internaly rather than through an external resolver in order to remain efficient.
public iterate(object: Object, fn: Function) source
import {iterate} from '@jdw/jst/src/object.js'
A method to safely iterate the properties of an object and execute some function for each of them.
public map(object: Object, fn: Function): Object source
import {map} from '@jdw/jst/src/object.js'
An object literal variant of the Array.map function. Iterate the properties of an object applying some function to each one of them and return a new object with the results.