@mongosh/async-rewriter2
Advanced tools
Comparing version 1.0.1 to 1.0.3
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = ({ types: t }) => { | ||
function asNodeKey(v) { return v; } | ||
const excludeFromCompletion = asNodeKey(Symbol('excludedFromCompletion')); | ||
return { | ||
@@ -26,6 +24,3 @@ pre() { | ||
const expr = t.assignmentExpression('=', decl.id, decl.init); | ||
if (path.node.kind !== 'var') { | ||
Object.assign(expr, { [excludeFromCompletion]: true }); | ||
} | ||
asAssignments.push(t.expressionStatement(expr)); | ||
asAssignments.push(t.variableDeclaration('const', [t.variableDeclarator(path.scope.generateUidIdentifier('v'), expr)])); | ||
} | ||
@@ -100,3 +95,3 @@ } | ||
for (const record of records) { | ||
if (record.isExpressionWrapper() && !record.node.expression[excludeFromCompletion]) { | ||
if (record.isExpressionWrapper()) { | ||
record.replaceWith(t.expressionStatement(t.assignmentExpression('=', this.completionRecordId, record.node.expression))); | ||
@@ -103,0 +98,0 @@ } |
{ | ||
"name": "@mongosh/async-rewriter2", | ||
"version": "1.0.1", | ||
"version": "1.0.3", | ||
"description": "MongoDB Shell Async Rewriter Package", | ||
@@ -10,3 +10,3 @@ "main": "./lib/index.js", | ||
"test-ci": "mocha -r \"../../scripts/import-expansions.js\" --timeout 60000 -r ts-node/register \"./{src,lib}/**/*.spec.ts\"", | ||
"lint": "eslint --report-unused-disable-directives \"**/*.{js,ts,tsx}\"", | ||
"lint": "eslint --report-unused-disable-directives \"./{src,test}/**/*.{js,ts,tsx}\"", | ||
"check": "npm run lint && depcheck --skip-missing=true", | ||
@@ -38,3 +38,3 @@ "compile-ts": "tsc -p tsconfig.json", | ||
}, | ||
"gitHead": "2f34d96bc82a6f4ca7e3dad61a8e141272b036e4" | ||
"gitHead": "fb1691775754ab5b9018acdb4831b423ee3d77e6" | ||
} |
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
29
988
93386