@appland/appmap-validate
Advanced tools
Comparing version 2.0.0 to 2.1.0
#!/usr/bin/env node | ||
const { AppmapError } = require("./assert.js"); | ||
const { validate } = require("./main.js"); | ||
const { AppmapError } = require("../lib/assert.js"); | ||
const { validate } = require("../lib/index.js"); | ||
const { readFileSync } = require("fs"); | ||
@@ -19,3 +20,3 @@ const failure = (message) => { | ||
try { | ||
success(`Valid ${validate(readFileSync(process.argv[2], "utf8"))} appmap${"\n"}`); | ||
success(`Valid ${validate(JSON.parse(readFileSync(process.argv[2], "utf8")))} appmap${"\n"}`); | ||
} catch (error) { | ||
@@ -22,0 +23,0 @@ if (error instanceof AppmapError) { |
@@ -0,1 +1,14 @@ | ||
# [@appland/appmap-validate-v2.1.0](https://github.com/applandinc/appmap-js/compare/@appland/appmap-validate-v2.0.0...@appland/appmap-validate-v2.1.0) (2021-12-06) | ||
### Bug Fixes | ||
* fix broken bin/index.js file ([70fcaed](https://github.com/applandinc/appmap-js/commit/70fcaed1e2c04b2edbc696e03f018b8c8a76189f)) | ||
* used appmap-scoped monotonous constraint ([34af3c8](https://github.com/applandinc/appmap-js/commit/34af3c83679e1745427b80ec8b2869b9a6eeaf08)) | ||
### Features | ||
* add constraint for continuous indexing (start at 1) ([ed919a6](https://github.com/applandinc/appmap-js/commit/ed919a689d450991bbc4ba49c65c75794be0f042)) | ||
# [@appland/appmap-validate-v2.0.0](https://github.com/applandinc/appmap-js/compare/@appland/appmap-validate-v1.0.0...@appland/appmap-validate-v2.0.0) (2021-08-12) | ||
@@ -2,0 +15,0 @@ |
@@ -137,3 +137,9 @@ const Ajv = require("ajv"); | ||
// ); | ||
const designator = makeDesignator([parent.name, path2, parseInt(lineno), entity.static, entity.name]); | ||
const designator = makeDesignator([ | ||
parent.name, | ||
path2, | ||
parseInt(lineno), | ||
entity.static, | ||
entity.name, | ||
]); | ||
assert( | ||
@@ -161,11 +167,13 @@ !designators.has(designator), | ||
const ids = new Map(); | ||
let max = 0; | ||
for (let index = 0; index < events.length; index += 1) { | ||
const event = events[index]; | ||
assert( | ||
!ids.has(event.id), | ||
event.id > max, | ||
AppmapError, | ||
"duplicate event id between #%i and #%i", | ||
index, | ||
ids.get(index) | ||
"non-monotonous event id between #%i and #%i", | ||
event.id, | ||
max | ||
); | ||
max = event.id; | ||
ids.set(event.id, index); | ||
@@ -178,10 +186,12 @@ let thread = threads.get(event.thread_id); | ||
if (event.event === "call") { | ||
// console.log(new Array(thread.length).join("."), event.id); | ||
thread.push(event); | ||
} else { | ||
const parent = thread.pop(); | ||
// console.log(new Array(thread.length).join("."), event.id, event.parent_id); | ||
assert( | ||
parent.id === event.parent_id, | ||
AppmapError, | ||
"return event #%i parent id mistmatch: expected %i but got %i", | ||
index, | ||
"expected parent id of return event #%i to be %i but got %i", | ||
event.id, | ||
parent.id, | ||
@@ -196,2 +206,4 @@ event.parent_id | ||
"incompatible event type between #%i and #%i, expected a %s but got a %s", | ||
event.id, | ||
event.parent_id, | ||
tag1, | ||
@@ -198,0 +210,0 @@ tag2 |
{ | ||
"name": "@appland/appmap-validate", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"scripts": { | ||
"start": "node bin/index.js", | ||
"test": "npx c8 --reporter=text-summary --check-coverage --branches=100 --functions=100 --lines=100 --statements=100 --include lib/index.js node test/smoke.js", | ||
@@ -6,0 +7,0 @@ "build": "node src/build.js", |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
123613
5229
0
1