@hyperjump/json-schema 0.18.0 → 0.18.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- define(['exports'], function (exports) { 'use strict';
1
+ define(['exports'], (function (exports) { 'use strict';
2
2
 
3
3
  var justCurryIt = curry;
4
4
 
@@ -58,8 +58,14 @@ define(['exports'], function (exports) { 'use strict';
58
58
  (function (root, factory){
59
59
 
60
60
  var PubSub = {};
61
- root.PubSub = PubSub;
62
- factory(PubSub);
61
+
62
+ if (root.PubSub) {
63
+ PubSub = root.PubSub;
64
+ console.warn("PubSub already loaded, using existing version");
65
+ } else {
66
+ root.PubSub = PubSub;
67
+ factory(PubSub);
68
+ }
63
69
  // CommonJS and Node.js module support
64
70
  {
65
71
  if (module !== undefined && module.exports) {
@@ -795,6 +801,10 @@ define(['exports'], function (exports) { 'use strict';
795
801
  const value$2 = (ref) => ref[$__value];
796
802
 
797
803
  var reference = { cons: cons$1, isReference, href, value: value$2 };
804
+ reference.cons;
805
+ reference.isReference;
806
+ reference.href;
807
+ reference.value;
798
808
 
799
809
  const { jsonTypeOf: jsonTypeOf$1 } = common$1;
800
810
 
@@ -1231,7 +1241,7 @@ define(['exports'], function (exports) { 'use strict';
1231
1241
  validated: false
1232
1242
  };
1233
1243
 
1234
- return schemaStore[id];
1244
+ return id;
1235
1245
  };
1236
1246
 
1237
1247
  const processSchema = (subject, id, schemaVersion, pointer, anchors, dynamicAnchors) => {
@@ -1587,10 +1597,8 @@ define(['exports'], function (exports) { 'use strict';
1587
1597
  };
1588
1598
 
1589
1599
  const add = (schema, url = "", defaultSchemaVersion = "") => {
1590
- const doc = schema$5.add(schema, url, defaultSchemaVersion);
1591
- delete metaValidators[doc.id];
1592
-
1593
- return doc;
1600
+ const id = schema$5.add(schema, url, defaultSchemaVersion);
1601
+ delete metaValidators[id];
1594
1602
  };
1595
1603
 
1596
1604
  var core$2 = {
@@ -1724,7 +1732,7 @@ define(['exports'], function (exports) { 'use strict';
1724
1732
  keywords$1.metaData;
1725
1733
  keywords$1.validate;
1726
1734
 
1727
- var lib$1 = { Core: core$2, Schema: schema$5, Instance: instance, Keywords: keywords$1 };
1735
+ var lib$1 = { Core: core$2, Schema: schema$5, Instance: instance, Reference: reference, Keywords: keywords$1, InvalidSchemaError: invalidSchemaError };
1728
1736
 
1729
1737
  const { Core: Core$v, Schema: Schema$N, Instance: Instance$B } = lib$1;
1730
1738
 
@@ -3104,149 +3112,11 @@ define(['exports'], function (exports) { 'use strict';
3104
3112
  "default": {}
3105
3113
  }`;
3106
3114
 
3107
- var hyperSchema = `{
3108
- "$schema": "http://json-schema.org/draft-04/hyper-schema#",
3109
- "id": "http://json-schema.org/draft-04/hyper-schema#",
3110
- "title": "JSON Hyper-Schema",
3111
- "allOf": [
3112
- {"$ref": "http://json-schema.org/draft-04/schema#"}
3113
- ],
3114
- "properties": {
3115
- "additionalItems": {
3116
- "anyOf": [
3117
- {"type": "boolean"},
3118
- {"$ref": "#"}
3119
- ]
3120
- },
3121
- "additionalProperties": {
3122
- "anyOf": [
3123
- {"type": "boolean"},
3124
- {"$ref": "#"}
3125
- ]
3126
- },
3127
- "dependencies": {
3128
- "additionalProperties": {
3129
- "anyOf": [
3130
- {"$ref": "#"},
3131
- {"type": "array"}
3132
- ]
3133
- }
3134
- },
3135
- "items": {
3136
- "anyOf": [
3137
- {"$ref": "#"},
3138
- {"$ref": "#/definitions/schemaArray"}
3139
- ]
3140
- },
3141
- "definitions": {
3142
- "additionalProperties": {"$ref": "#"}
3143
- },
3144
- "patternProperties": {
3145
- "additionalProperties": {"$ref": "#"}
3146
- },
3147
- "properties": {
3148
- "additionalProperties": {"$ref": "#"}
3149
- },
3150
- "allOf": {"$ref": "#/definitions/schemaArray"},
3151
- "anyOf": {"$ref": "#/definitions/schemaArray"},
3152
- "oneOf": {"$ref": "#/definitions/schemaArray"},
3153
- "not": { "$ref": "#" },
3154
-
3155
- "links": {
3156
- "type": "array",
3157
- "items": {"$ref": "#/definitions/linkDescription"}
3158
- },
3159
- "fragmentResolution": {
3160
- "type": "string"
3161
- },
3162
- "media": {
3163
- "type": "object",
3164
- "properties": {
3165
- "type": {
3166
- "description": "A media type, as described in RFC 2046",
3167
- "type": "string"
3168
- },
3169
- "binaryEncoding": {
3170
- "description": "A content encoding scheme, as described in RFC 2045",
3171
- "type": "string"
3172
- }
3173
- }
3174
- },
3175
- "pathStart": {
3176
- "description": "Instances' URIs must start with this value for this schema to apply to them",
3177
- "type": "string",
3178
- "format": "uri"
3179
- }
3180
- },
3181
- "definitions": {
3182
- "schemaArray": {
3183
- "type": "array",
3184
- "items": {"$ref": "#"}
3185
- },
3186
- "linkDescription": {
3187
- "title": "Link Description Object",
3188
- "type": "object",
3189
- "required": ["href", "rel"],
3190
- "properties": {
3191
- "href": {
3192
- "description": "a URI template, as defined by RFC 6570, with the addition of the $, ( and ) characters for pre-processing",
3193
- "type": "string"
3194
- },
3195
- "rel": {
3196
- "description": "relation to the target resource of the link",
3197
- "type": "string"
3198
- },
3199
- "title": {
3200
- "description": "a title for the link",
3201
- "type": "string"
3202
- },
3203
- "targetSchema": {
3204
- "description": "JSON Schema describing the link target",
3205
- "$ref": "#"
3206
- },
3207
- "mediaType": {
3208
- "description": "media type (as defined by RFC 2046) describing the link target",
3209
- "type": "string"
3210
- },
3211
- "method": {
3212
- "description": "method for requesting the target of the link (e.g. for HTTP this might be \\"GET\\" or \\"DELETE\\")",
3213
- "type": "string"
3214
- },
3215
- "encType": {
3216
- "description": "The media type in which to submit data along with the request",
3217
- "type": "string",
3218
- "default": "application/json"
3219
- },
3220
- "schema": {
3221
- "description": "Schema describing the data to submit along with the request",
3222
- "$ref": "#"
3223
- }
3224
- }
3225
- },
3226
- "readOnly": {
3227
- "description": "If true, indicates that the value of this property is controlled by the server.",
3228
- "type": "boolean",
3229
- "default": false
3230
- }
3231
- },
3232
- "links": [
3233
- {
3234
- "rel": "self",
3235
- "href": "{+id}"
3236
- },
3237
- {
3238
- "rel": "full",
3239
- "href": "{+($ref)}"
3240
- }
3241
- ]
3242
- }`;
3243
-
3244
3115
  const { Core: Core$5, Schema: Schema$5 } = lib$1;
3245
3116
 
3246
3117
 
3247
3118
 
3248
3119
 
3249
-
3250
3120
  // JSON Schema Draft-04
3251
3121
  const schemaVersion$4 = "http://json-schema.org/draft-04/schema";
3252
3122
 
@@ -3289,53 +3159,6 @@ define(['exports'], function (exports) { 'use strict';
3289
3159
  "uniqueItems": keywords.uniqueItems
3290
3160
  });
3291
3161
 
3292
- // JSON Hyper-Schema Draft-04
3293
- const hyperSchemaVersion = "http://json-schema.org/draft-04/hyper-schema";
3294
-
3295
- Schema$5.setConfig(hyperSchemaVersion, "baseToken", "id");
3296
- Schema$5.setConfig(hyperSchemaVersion, "embeddedToken", "id");
3297
- Schema$5.setConfig(hyperSchemaVersion, "anchorToken", "id");
3298
- Schema$5.setConfig(hyperSchemaVersion, "jrefToken", "$ref");
3299
-
3300
- Schema$5.add(JSON.parse(hyperSchema));
3301
- Core$5.defineVocabulary(hyperSchemaVersion, {
3302
- "validate": keywords.validate,
3303
- "additionalItems": keywords.additionalItems,
3304
- "additionalProperties": keywords.additionalProperties,
3305
- "allOf": keywords.allOf,
3306
- "anyOf": keywords.anyOf,
3307
- "default": keywords.metaData,
3308
- "definitions": keywords.definitions,
3309
- "dependencies": keywords.dependencies,
3310
- "description": keywords.metaData,
3311
- "enum": keywords.enum,
3312
- "format": keywords.metaData,
3313
- "fragmentResolution": keywords.metaData,
3314
- "items": keywords.items,
3315
- "maxItems": keywords.maxItems,
3316
- "minProperties": keywords.minProperties,
3317
- "maxProperties": keywords.maxProperties,
3318
- "maximum": keywords.maximumExclusiveMaximum,
3319
- "media": keywords.metaData,
3320
- "minItems": keywords.minItems,
3321
- "minLength": keywords.minLength,
3322
- "maxLength": keywords.maxLength,
3323
- "minimum": keywords.minimumExclusiveMinimum,
3324
- "multipleOf": keywords.multipleOf,
3325
- "links": keywords.metaData,
3326
- "not": keywords.not,
3327
- "oneOf": keywords.oneOf,
3328
- "pathStart": keywords.metaData,
3329
- "pattern": keywords.pattern,
3330
- "patternProperties": keywords.patternProperties,
3331
- "properties": keywords.properties,
3332
- "readOnly": keywords.metaData,
3333
- "required": keywords.required,
3334
- "title": keywords.metaData,
3335
- "type": keywords.type,
3336
- "uniqueItems": keywords.uniqueItems
3337
- });
3338
-
3339
3162
  var schema$3 = `{
3340
3163
  "$schema": "http://json-schema.org/draft-06/schema#",
3341
3164
  "$id": "http://json-schema.org/draft-06/schema#",
@@ -4697,7 +4520,7 @@ define(['exports'], function (exports) { 'use strict';
4697
4520
  exports.VERBOSE = lib_11;
4698
4521
  exports.add = lib_1;
4699
4522
  exports.compile = lib_4;
4700
- exports['default'] = lib;
4523
+ exports["default"] = lib;
4701
4524
  exports.get = lib_2;
4702
4525
  exports.interpret = lib_5;
4703
4526
  exports.setMetaOutputFormat = lib_6;
@@ -4706,5 +4529,5 @@ define(['exports'], function (exports) { 'use strict';
4706
4529
 
4707
4530
  Object.defineProperty(exports, '__esModule', { value: true });
4708
4531
 
4709
- });
4532
+ }));
4710
4533
  //# sourceMappingURL=json-schema-amd.js.map