@aml-org/amf-custom-validator
Advanced tools
Comparing version 0.1.0-SNAPSHOT.0 to 0.1.0-SNAPSHOT.4
require(__dirname + "/lib/wasm_exec"); | ||
const fs = require("fs"); | ||
const pako = require("pako"); | ||
const wasm_gz = fs.readFileSync(__dirname + "/lib/main.wasm.gz") | ||
const wasm = pako.ungzip(wasm_gz) | ||
let wasm_gz | ||
let wasm | ||
@@ -23,2 +23,6 @@ let INIT = false | ||
} else { | ||
if(!wasm_gz || !wasm) { | ||
wasm_gz = fs.readFileSync(__dirname + "/lib/main.wasm.gz") | ||
wasm = pako.ungzip(wasm_gz) | ||
} | ||
if (WebAssembly) { | ||
@@ -25,0 +29,0 @@ WebAssembly.instantiate(wasm, go.importObject).then((result) => { |
@@ -0,1 +1,6 @@ | ||
// wasm_exec.js obtained from https://github.com/golang/go/blob/758ac371ab930734053ed226ac62681e62ab8eea/misc/wasm/wasm_exec.js | ||
// Log with custom changes (we should keep track if we diverge from original content): | ||
// - | ||
// --------------------------------------------------- | ||
// Copyright 2018 The Go Authors. All rights reserved. | ||
@@ -14,2 +19,3 @@ // Use of this source code is governed by a BSD-style | ||
// - Parcel | ||
// - Webpack | ||
@@ -32,3 +38,3 @@ if (typeof global !== "undefined") { | ||
const fs = require("fs"); | ||
if (Object.keys(fs) !== 0) { | ||
if (typeof fs === "object" && fs !== null && Object.keys(fs).length !== 0) { | ||
global.fs = fs; | ||
@@ -561,2 +567,3 @@ } | ||
if ( | ||
typeof module !== "undefined" && | ||
global.require && | ||
@@ -591,2 +598,2 @@ global.require.main === module && | ||
} | ||
})(); | ||
})(); |
{ | ||
"name": "@aml-org/amf-custom-validator", | ||
"version": "0.1.0-SNAPSHOT.0", | ||
"version": "0.1.0-SNAPSHOT.4", | ||
"description": "AMF validator backed by OPA Rego", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -18,3 +18,3 @@ const fs = require("fs"); | ||
let report = JSON.parse(r) | ||
assert.ok(report["http://www.w3.org/ns/shacl#conforms"] === false) | ||
assert.ok(report["conforms"] === false) | ||
validator.validate(profile, data, false, (r,err) => { | ||
@@ -25,3 +25,3 @@ if (err) { | ||
let report = JSON.parse(r) | ||
assert.ok(report["http://www.w3.org/ns/shacl#conforms"] === false) | ||
assert.ok(report["conforms"] === false) | ||
validator.exit(); | ||
@@ -28,0 +28,0 @@ done(); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4986993
6
612
9