packages/extension-map/doc/webpacks/shexmap-webapp.js
/**
 * Given a map directive that contains an extension of format 
 *          extensionName(args) 
 * split it up for easy access to extenion name and arguments separately 
 * 
 * @param a map directive with an extension call embedded
 *
 * @return an object with members:  extension name and the arguments.
 */
Given a map directive that contains an extension of format
extensionName(args)
split it up for easy access to extenion name and arguments separately

@param a map directive with an extension call embedded

@return an object with members:  extension name and the arguments.
Given a map directive that contains an extension of format extensionName ( args ) split it up for easy access to extenion name and arguments separately @param a map directive with an extension call embedded @return an object with members : extension name and the arguments .
function extensionDef(mapDirective) { 
    if (mapDirective === undefined)
        throw Error("Invalid extension function: " + mapDirective + "!");
    mapDirective = mapDirective.trim(); 
    const startArgs = mapDirective.indexOf('(', 0);
    const endArgs = mapDirective.lastIndexOf(')');
    if (startArgs < 2 || endArgs < 4 || endArgs <= startArgs+1 || endArgs != mapDirective.length-1) 
        throw Error("Invalid extension function: " + mapDirective + "!");
    return { name:  mapDirective.substring(0, startArgs),
             args:  mapDirective.substring(startArgs+1, endArgs) }; 
}
function extensionDef ( mapDirective ) { if ( mapDirective === undefined ) throw Error ( "Invalid extension function: " + mapDirective + "!" ) ; mapDirective = mapDirective . trim ( ) ; const startArgs = mapDirective . indexOf ( '(' , 0 ) ; const endArgs = mapDirective . lastIndexOf ( ')' ) ; if ( startArgs < 2 || endArgs < 4 || endArgs <= startArgs + 1 || endArgs != mapDirective . length - 1 ) throw Error ( "Invalid extension function: " + mapDirective + "!" ) ; return { name : mapDirective . substring ( 0 , startArgs ) , args : mapDirective . substring ( startArgs + 1 , endArgs ) } ; }
Given a map directive that contains an extension of format
          extensionName(args)
 split it up for easy access to extenion name and arguments separately
Given a map directive that contains an extension of format extensionName ( args ) split it up for easy access to extenion name and arguments separately
// Get the extension name and argument(s)   // Strip any leading or trailing white space