dist/@ajsf/core/bundles/ajsf-core.umd.js
/**
     * 'isInputRequired' function
     *
     * Checks a JSON Schema to see if an item is required
     *
     * //   schema - the schema to check
     * //  { string } schemaPointer - the pointer to the item to check
     * // { boolean } - true if the item is required, false if not
     */
'isInputRequired' function
Checks a JSON Schema to see if an item is required

the schema to check
{ string } schemaPointer - the pointer to the item to check
{ boolean } - true if the item is required, false if not
' isInputRequired ' function Checks a JSON Schema to see if an item is required the schema to check { string } schemaPointer - the pointer to the item to check { boolean } - true if the item is required false if not
function isInputRequired(schema, schemaPointer) {
        if (!isObject(schema)) {
            console.error('isInputRequired error: Input schema must be an object.');
            return false;
        }
        var listPointerArray = JsonPointer.parse(schemaPointer);
        if (isArray(listPointerArray)) {
            if (!listPointerArray.length) {
                return schema.required === true;
            }
            var keyName = listPointerArray.pop();
            var nextToLastKey = listPointerArray[listPointerArray.length - 1];
            if (['properties', 'additionalProperties', 'patternProperties', 'items', 'additionalItems']
                .includes(nextToLastKey)) {
                listPointerArray.pop();
            }
            var parentSchema = JsonPointer.get(schema, listPointerArray) || {};
            if (isArray(parentSchema.required)) {
                return parentSchema.required.includes(keyName);
            }
            if (parentSchema.type === 'array') {
                return hasOwn(parentSchema, 'minItems') &&
                    isNumber(keyName) &&
                    +parentSchema.minItems > +keyName;
            }
        }
        return false;
    }
function isInputRequired ( schema , schemaPointer ) { if ( ! isObject ( schema ) ) { console . error ( 'isInputRequired error: Input schema must be an object.' ) ; return false ; } var listPointerArray = JsonPointer . parse ( schemaPointer ) ; if ( isArray ( listPointerArray ) ) { if ( ! listPointerArray . length ) { return schema . required === true ; } var keyName = listPointerArray . pop ( ) ; var nextToLastKey = listPointerArray [ listPointerArray . length - 1 ] ; if ( [ 'properties' , 'additionalProperties' , 'patternProperties' , 'items' , 'additionalItems' ] . includes ( nextToLastKey ) ) { listPointerArray . pop ( ) ; } var parentSchema = JsonPointer . get ( schema , listPointerArray ) || { } ; if ( isArray ( parentSchema . required ) ) { return parentSchema . required . includes ( keyName ) ; } if ( parentSchema . type === 'array' ) { return hasOwn ( parentSchema , 'minItems' ) && isNumber ( keyName ) && + parentSchema . minItems > + keyName ; } } return false ; }
'isInputRequired' function
 Checks a JSON Schema to see if an item is required
' isInputRequired ' function Checks a JSON Schema to see if an item is required