dist/@ajsf/core/esm2015/lib/shared/jsonpointer.functions.js
/**
     * 'toIndexedPointer' function
     *
     * Merges an array of numeric indexes and a generic pointer to create an
     * indexed pointer for a specific item.
     *
     * For example, merging the generic pointer '/foo/-/bar/-/baz' and
     * the array [4, 2] would result in the indexed pointer '/foo/4/bar/2/baz'
     *
     *
     * //  { Pointer } genericPointer - The generic pointer
     * //  { number[] } indexArray - The array of numeric indexes
     * //  { Map<string, number> } arrayMap - An optional array map
     * // { string } - The merged pointer with indexes
     */
'toIndexedPointer' function
Merges an array of numeric indexes and a generic pointer to create an
indexed pointer for a specific item.



{ Pointer } genericPointer - The generic pointer
{ number[] } indexArray - The array of numeric indexes
{ Map } arrayMap - An optional array map
{ string } - The merged pointer with indexes
' toIndexedPointer ' function Merges an array of numeric indexes and a generic pointer to create an indexed pointer for a specific item . { Pointer } genericPointer - The generic pointer { number [] } indexArray - The array of numeric indexes { Map } arrayMap - An optional array map { string } - The merged pointer with indexes
static toIndexedPointer(genericPointer, indexArray, arrayMap = null) {
        if (this.isJsonPointer(genericPointer) && isArray(indexArray)) {
            let indexedPointer = this.compile(genericPointer);
            if (isMap(arrayMap)) {
                let arrayIndex = 0;
                return indexedPointer.replace(/\/\-(?=\/|$)/g, (key, stringIndex) => arrayMap.has(indexedPointer.slice(0, stringIndex)) ?
                    '/' + indexArray[arrayIndex++] : key);
            }
            else {
                for (const pointerIndex of indexArray) {
                    indexedPointer = indexedPointer.replace('/-', '/' + pointerIndex);
                }
                return indexedPointer;
            }
        }
        if (!this.isJsonPointer(genericPointer)) {
            console.error(`toIndexedPointer error: Invalid JSON Pointer: ${genericPointer}`);
        }
        if (!isArray(indexArray)) {
            console.error(`toIndexedPointer error: Invalid indexArray: ${indexArray}`);
        }
    }
static toIndexedPointer ( genericPointer , indexArray , arrayMap = null ) { if ( this . isJsonPointer ( genericPointer ) && isArray ( indexArray ) ) { let indexedPointer = this . compile ( genericPointer ) ; if ( isMap ( arrayMap ) ) { let arrayIndex = 0 ; return indexedPointer . replace ( / \/\-(?=\/|$) / g , ( key , stringIndex ) => arrayMap . has ( indexedPointer . slice ( 0 , stringIndex ) ) ? '/' + indexArray [ arrayIndex ++ ] : key ) ; } else { for ( const pointerIndex of indexArray ) { indexedPointer = indexedPointer . replace ( '/-' , '/' + pointerIndex ) ; } return indexedPointer ; } } if ( ! this . isJsonPointer ( genericPointer ) ) { console . error ( ` ${ genericPointer } ` ) ; } if ( ! isArray ( indexArray ) ) { console . error ( ` ${ indexArray } ` ) ; } }
'toIndexedPointer' function
 Merges an array of numeric indexes and a generic pointer to create an
 indexed pointer for a specific item.
' toIndexedPointer ' function Merges an array of numeric indexes and a generic pointer to create an indexed pointer for a specific item .