packages/extension-map/doc/webpacks/shexmap-webapp.js
// Add a shape to the map
Add a shape to the map
Add a shape to the map
function addShape (label, shape, yy) {
    if (shape === EmptyShape)
      shape = { type: "Shape" };
    if (ShExJisonParser.productions && label in ShExJisonParser.productions)
      error(new Error("Structural error: "+label+" is a triple expression"), yy);
    if (!ShExJisonParser.shapes)
      ShExJisonParser.shapes = {};
    if (label in ShExJisonParser.shapes) {
      if (ShExJisonParser.options.duplicateShape === "replace")
        ShExJisonParser.shapes[label] = shape;
      else if (ShExJisonParser.options.duplicateShape !== "ignore")
        error(new Error("Parse error: "+label+" already defined"), yy);
    } else {
      ShExJisonParser.shapes[label] = Object.assign({id: label}, shape);
    }
  }
function addShape ( label , shape , yy ) { if ( shape === EmptyShape ) shape = { type : "Shape" } ; if ( ShExJisonParser . productions && label in ShExJisonParser . productions ) error ( new Error ( "Structural error: " + label + " is a triple expression" ) , yy ) ; if ( ! ShExJisonParser . shapes ) ShExJisonParser . shapes = { } ; if ( label in ShExJisonParser . shapes ) { if ( ShExJisonParser . options . duplicateShape === "replace" ) ShExJisonParser . shapes [ label ] = shape ; else if ( ShExJisonParser . options . duplicateShape !== "ignore" ) error ( new Error ( "Parse error: " + label + " already defined" ) , yy ) ; } else { ShExJisonParser . shapes [ label ] = Object . assign ( { id : label } , shape ) ; } }
Add a shape to the map
Add a shape to the map