ast-contains-only-empty-space
Advanced tools
Comparing version 3.0.5 to 3.0.6
/** | ||
* @name ast-contains-only-empty-space | ||
* @fileoverview Does AST contain only empty space? | ||
* @version 3.0.5 | ||
* @version 3.0.6 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -13,20 +13,20 @@ * @license MIT | ||
function empty(input) { | ||
if (typeof input === "string") { | ||
return !input.trim(); | ||
} | ||
if (!["object", "string"].includes(typeof input) || !input) { | ||
return false; | ||
} | ||
let found = true; | ||
input = traverse(input, (key, val, innerObj, stop) => { | ||
const current = val !== undefined ? val : key; | ||
if (typeof current === "string" && current.trim()) { | ||
found = false; | ||
stop.now = true; | ||
if (typeof input === "string") { | ||
return !input.trim(); | ||
} | ||
return current; | ||
}); | ||
return found; | ||
if (!["object", "string"].includes(typeof input) || !input) { | ||
return false; | ||
} | ||
let found = true; | ||
input = traverse(input, (key, val, innerObj, stop) => { | ||
const current = val !== undefined ? val : key; | ||
if (typeof current === "string" && current.trim()) { | ||
found = false; | ||
stop.now = true; | ||
} | ||
return current; | ||
}); | ||
return found; | ||
} | ||
export { empty }; |
/** | ||
* @name ast-contains-only-empty-space | ||
* @fileoverview Does AST contain only empty space? | ||
* @version 3.0.5 | ||
* @version 3.0.6 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -14,3 +14,3 @@ * @license MIT | ||
* @fileoverview Utility library of AST helper functions | ||
* @version 2.0.5 | ||
* @version 2.0.6 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -23,3 +23,3 @@ * @license MIT | ||
* @fileoverview Utility library to traverse AST | ||
* @version 3.0.5 | ||
* @version 3.0.6 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -26,0 +26,0 @@ * @license MIT |
{ | ||
"name": "ast-contains-only-empty-space", | ||
"version": "3.0.5", | ||
"version": "3.0.6", | ||
"description": "Does AST contain only empty space?", | ||
@@ -41,9 +41,8 @@ "keywords": [ | ||
"build": "rollup -c", | ||
"ci_test": "npm run build && npm run format && tap --no-only --reporter=silent --output-file=testStats.md && npm run clean_cov", | ||
"clean_cov": "../../scripts/leaveCoverageTotalOnly.js", | ||
"build:esbuild": "node '../../scripts/esbuild.js'", | ||
"build:esbuild:dev": "cross-env MODE=dev node '../../scripts/esbuild.js'", | ||
"ci_test": "npm run build && npm run format && tap --no-only --reporter=silent", | ||
"clean_types": "../../scripts/cleanTypes.js", | ||
"dev": "rollup -c --dev", | ||
"devunittest": "npm run dev && tap --only -R 'base'", | ||
"esbuild": "node '../../scripts/esbuild.js'", | ||
"esbuild_dev": "cross-env MODE=dev node '../../scripts/esbuild.js'", | ||
"format": "npm run lect && npm run prettier && npm run lint", | ||
@@ -57,13 +56,10 @@ "lect": "lect", | ||
"pretest": "npm run build", | ||
"test": "npm run lint && npm run unittest && npm run test:examples && npm run clean_cov && npm run format", | ||
"test": "npm run test:ci && npm run perf", | ||
"test:ci": "npm run unittest && npm run test:examples && npm run format", | ||
"test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier", | ||
"tsc": "tsc", | ||
"unittest": "tap --no-only --output-file=testStats.md --reporter=terse && tsc -p tsconfig.json --noEmit && npm run clean_cov && npm run perf" | ||
"unittest": "tap --no-only --reporter=terse && tsc -p tsconfig.json --noEmit" | ||
}, | ||
"tap": { | ||
"check-coverage": false, | ||
"coverage-report": [ | ||
"json-summary", | ||
"text" | ||
], | ||
"node-arg": [ | ||
@@ -88,4 +84,4 @@ "--no-warnings", | ||
"dependencies": { | ||
"@babel/runtime": "^7.16.0", | ||
"ast-monkey-traverse": "^3.0.5" | ||
"@babel/runtime": "^7.16.3", | ||
"ast-monkey-traverse": "^3.0.6" | ||
}, | ||
@@ -101,4 +97,4 @@ "devDependencies": { | ||
"@babel/plugin-proposal-optional-chaining": "^7.16.0", | ||
"@babel/plugin-transform-runtime": "^7.16.0", | ||
"@babel/preset-env": "^7.16.0", | ||
"@babel/plugin-transform-runtime": "^7.16.4", | ||
"@babel/preset-env": "^7.16.4", | ||
"@babel/preset-typescript": "^7.16.0", | ||
@@ -112,11 +108,11 @@ "@babel/register": "^7.16.0", | ||
"@rollup/plugin-typescript": "^8.3.0", | ||
"@types/node": "^16.11.6", | ||
"@types/node": "^16.11.9", | ||
"@types/tap": "^15.0.5", | ||
"@typescript-eslint/eslint-plugin": "^5.3.0", | ||
"@typescript-eslint/parser": "^5.3.0", | ||
"@typescript-eslint/eslint-plugin": "^5.4.0", | ||
"@typescript-eslint/parser": "^5.4.0", | ||
"core-js": "^3.19.1", | ||
"cross-env": "^7.0.3", | ||
"eslint": "^8.2.0", | ||
"lect": "^0.18.5", | ||
"rollup": "^2.59.0", | ||
"eslint": "^8.3.0", | ||
"lect": "^0.18.6", | ||
"rollup": "^2.60.0", | ||
"rollup-plugin-ascii": "^0.0.3", | ||
@@ -127,9 +123,9 @@ "rollup-plugin-banner": "^0.2.1", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"tap": "^15.0.10", | ||
"tap": "^15.1.2", | ||
"tslib": "^2.3.1", | ||
"typescript": "^4.4.4" | ||
"typescript": "^4.5.2" | ||
}, | ||
"engines": { | ||
"node": ">=12" | ||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0" | ||
} | ||
} |
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
24815
Updated@babel/runtime@^7.16.3
Updatedast-monkey-traverse@^3.0.6