New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@jsdoc/ast

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsdoc/ast - npm Package Compare versions

Comparing version
0.2.8
to
0.2.9
+22
-38
lib/ast-node.js

@@ -16,6 +16,6 @@ /*

*/
// TODO: docs
import { name } from '@jsdoc/core';
import { cast } from '@jsdoc/util';
import _ from 'lodash';

@@ -76,33 +76,28 @@ import { Syntax } from './syntax.js';

export function addNodeProperties(node) {
const newProperties = {};
if (!node || typeof node !== 'object') {
if (!node) {
return null;
}
if (!node.nodeId) {
newProperties.nodeId = {
Object.defineProperties(node, {
enclosingScope: {
// `null` means 'no enclosing scope', so use `undefined` for now.
value: undefined,
writable: true,
},
enclosingScopeId: {
enumerable: true,
get() {
return this.enclosingScope ? this.enclosingScope.nodeId : null;
},
},
nodeId: {
value: `astnode${uid++}`,
enumerable: true,
};
}
if (_.isUndefined(node.parent)) {
newProperties.parent = {
// `null` means 'no parent', so use `undefined` for now
},
parent: {
// `null` means 'no parent', so use `undefined` for now.
value: undefined,
writable: true,
};
}
if (_.isUndefined(node.enclosingScope)) {
newProperties.enclosingScope = {
// `null` means 'no enclosing scope', so use `undefined` for now
value: undefined,
writable: true,
};
}
if (_.isUndefined(node.parentId)) {
newProperties.parentId = {
},
parentId: {
enumerable: true,

@@ -112,16 +107,5 @@ get() {

},
};
}
},
});
if (_.isUndefined(node.enclosingScopeId)) {
newProperties.enclosingScopeId = {
enumerable: true,
get() {
return this.enclosingScope ? this.enclosingScope.nodeId : null;
},
};
}
Object.defineProperties(node, newProperties);
return node;

@@ -128,0 +112,0 @@ }

{
"name": "@jsdoc/ast",
"version": "0.2.8",
"version": "0.2.9",
"description": "JSDoc tools for working with abstract syntax trees (ASTs).",

@@ -34,4 +34,4 @@ "keywords": [

"dependencies": {
"@babel/parser": "^7.23.4",
"@jsdoc/core": "^0.5.5",
"@babel/parser": "^7.23.5",
"@jsdoc/core": "^0.5.6",
"@jsdoc/util": "^0.3.2",

@@ -43,3 +43,3 @@ "lodash": "^4.17.21"

},
"gitHead": "be73e2bfe226e9288fdfcc73f15917bfb65d11e8"
"gitHead": "3e4f5fc5570472d398a6a28d2b6080e8ec7cdfb5"
}