@mml-io/mml-schema-validator 0.6.2 → 0.8.0

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.
package/build/index.js CHANGED
@@ -1,51 +1,18 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/index.ts
30
- var src_exports = {};
31
- __export(src_exports, {
32
- validateMMLDocument: () => validateMMLDocument
33
- });
34
- module.exports = __toCommonJS(src_exports);
35
-
36
1
  // src/validate.ts
37
- var import_mml_schema = require("@mml-io/mml-schema");
38
- var import_xsd_validator = __toESM(require("xsd-validator"));
2
+ import { schemaXML } from "@mml-io/mml-schema";
3
+ import validateAgainstSchema from "xsd-validator";
39
4
  function validateMMLDocument(document) {
40
- const result = (0, import_xsd_validator.default)(document, import_mml_schema.schemaXML);
5
+ const result = validateAgainstSchema.default(
6
+ document,
7
+ schemaXML
8
+ );
41
9
  if (result === true) {
42
10
  return null;
43
11
  } else {
44
12
  return result;
45
13
  }
46
14
  }
47
- // Annotate the CommonJS export names for ESM import in node:
48
- 0 && (module.exports = {
15
+ export {
49
16
  validateMMLDocument
50
- });
17
+ };
51
18
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/index.ts", "../src/validate.ts"],
4
- "sourcesContent": ["export * from \"./validate\";\n", "import { schemaXML } from \"@mml-io/mml-schema\";\nimport validateAgainstSchema from \"xsd-validator\";\n\nexport function validateMMLDocument(document: string): Array<Error> | null {\n const result = validateAgainstSchema(document, schemaXML);\n if (result === true) {\n return null;\n } else {\n return result;\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,wBAA0B;AAC1B,2BAAkC;AAE3B,SAAS,oBAAoB,UAAuC;AACzE,QAAM,aAAS,qBAAAA,SAAsB,UAAU,2BAAS;AACxD,MAAI,WAAW,MAAM;AACnB,WAAO;AAAA,EACT,OAAO;AACL,WAAO;AAAA,EACT;AACF;",
6
- "names": ["validateAgainstSchema"]
3
+ "sources": ["../src/validate.ts"],
4
+ "sourcesContent": ["import { schemaXML } from \"@mml-io/mml-schema\";\nimport validateAgainstSchema from \"xsd-validator\";\n\nexport function validateMMLDocument(document: string): Array<Error> | null {\n const result = ((validateAgainstSchema as any).default as typeof validateAgainstSchema)(\n document,\n schemaXML,\n );\n if (result === true) {\n return null;\n } else {\n return result;\n }\n}\n"],
5
+ "mappings": ";AAAA,SAAS,iBAAiB;AAC1B,OAAO,2BAA2B;AAE3B,SAAS,oBAAoB,UAAuC;AACzE,QAAM,SAAW,sBAA8B;AAAA,IAC7C;AAAA,IACA;AAAA,EACF;AACA,MAAI,WAAW,MAAM;AACnB,WAAO;AAAA,EACT,OAAO;AACL,WAAO;AAAA,EACT;AACF;",
6
+ "names": []
7
7
  }
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@mml-io/mml-schema-validator",
3
- "version": "0.6.2",
3
+ "version": "0.8.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "main": "./build/index.js",
8
8
  "types": "./build/index.d.ts",
9
+ "type": "module",
9
10
  "files": [
10
11
  "/build"
11
12
  ],
@@ -13,11 +14,11 @@
13
14
  "type-check": "tsc --noEmit",
14
15
  "build": "tsx ./build.ts --build",
15
16
  "iterate": "tsx ./build.ts --watch",
16
- "test": "jest"
17
+ "test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest"
17
18
  },
18
19
  "dependencies": {
19
- "@mml-io/mml-schema": "^0.6.2",
20
+ "@mml-io/mml-schema": "^0.8.0",
20
21
  "xsd-validator": "1.1.0"
21
22
  },
22
- "gitHead": "0ac70ab8ff9164c5dc2b9541ff7319a94ebaccf4"
23
+ "gitHead": "136413e409957ca6d76373d8c511912536ea6e1c"
23
24
  }