ast-monkey-traverse
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -6,2 +6,8 @@ # Change Log | ||
## 3.0.1 (2021-09-13) | ||
### Bug Fixes | ||
- bump TS and separate ESLint plugins away from this monorepo ([2e07d42](https://github.com/codsen/codsen/commit/2e07d424222b6ffedf5fb45c83ad453627ec2904)) | ||
## 3.0.0 (2021-09-09) | ||
@@ -8,0 +14,0 @@ |
/** | ||
* @name ast-monkey-traverse | ||
* @fileoverview Utility library to traverse AST | ||
* @version 3.0.0 | ||
* @version 3.0.1 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -14,3 +14,3 @@ * @license MIT | ||
var version$1 = "3.0.0"; | ||
var version$1 = "3.0.1"; | ||
@@ -17,0 +17,0 @@ const version = version$1; |
/** | ||
* @name ast-monkey-traverse | ||
* @fileoverview Utility library to traverse AST | ||
* @version 3.0.0 | ||
* @version 3.0.1 | ||
* @author Roy Revelt, Codsen Ltd | ||
@@ -14,6 +14,6 @@ * @license MIT | ||
* @fileoverview Utility library of AST helper functions | ||
* @version 2.0.0 | ||
* @version 2.0.1 | ||
* @author Roy Revelt, Codsen Ltd | ||
* @license MIT | ||
* {@link https://codsen.com/os/ast-monkey-util/} | ||
*/function y(t){if(t.includes(".")){const e=t.lastIndexOf(".");if(!t.slice(0,e).includes("."))return t.slice(0,e);for(let r=e-1;r--;)if("."===t[r])return t.slice(r+1,e)}return null}t.traverse=function(t,e){return function t(e,r,o,c){const u=n(e);let a;const i={depth:-1,path:"",...o};if(i.depth+=1,Array.isArray(u))for(let e=0,o=u.length;e<o&&!c.now;e++){const o=i.path?`${i.path}.${e}`:`${e}`;void 0!==u[e]?(i.parent=n(u),i.parentType="array",i.parentKey=y(o),a=t(r(u[e],void 0,{...i,path:o},c),r,{...i,path:o},c),Number.isNaN(a)&&e<u.length?(u.splice(e,1),e-=1):u[e]=a):u.splice(e,1)}else if(p(u))for(const e in u){if(c.now&&null!=e)break;const o=i.path?`${i.path}.${e}`:e;0===i.depth&&null!=e&&(i.topmostKey=e),i.parent=n(u),i.parentType="object",i.parentKey=y(o),a=t(r(e,u[e],{...i,path:o},c),r,{...i,path:o},c),Number.isNaN(a)?delete u[e]:u[e]=a}return u}(t,e,{},{now:!1})},t.version="3.0.0",Object.defineProperty(t,"__esModule",{value:!0})})); | ||
*/function y(t){if(t.includes(".")){const e=t.lastIndexOf(".");if(!t.slice(0,e).includes("."))return t.slice(0,e);for(let r=e-1;r--;)if("."===t[r])return t.slice(r+1,e)}return null}t.traverse=function(t,e){return function t(e,r,o,c){const u=n(e);let a;const i={depth:-1,path:"",...o};if(i.depth+=1,Array.isArray(u))for(let e=0,o=u.length;e<o&&!c.now;e++){const o=i.path?`${i.path}.${e}`:`${e}`;void 0!==u[e]?(i.parent=n(u),i.parentType="array",i.parentKey=y(o),a=t(r(u[e],void 0,{...i,path:o},c),r,{...i,path:o},c),Number.isNaN(a)&&e<u.length?(u.splice(e,1),e-=1):u[e]=a):u.splice(e,1)}else if(p(u))for(const e in u){if(c.now&&null!=e)break;const o=i.path?`${i.path}.${e}`:e;0===i.depth&&null!=e&&(i.topmostKey=e),i.parent=n(u),i.parentType="object",i.parentKey=y(o),a=t(r(e,u[e],{...i,path:o},c),r,{...i,path:o},c),Number.isNaN(a)?delete u[e]:u[e]=a}return u}(t,e,{},{now:!1})},t.version="3.0.1",Object.defineProperty(t,"__esModule",{value:!0})})); |
{ | ||
"name": "ast-monkey-traverse", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Utility library to traverse AST", | ||
@@ -98,3 +98,3 @@ "keywords": [ | ||
"@babel/runtime": "^7.15.4", | ||
"ast-monkey-util": "^2.0.0", | ||
"ast-monkey-util": "^2.0.1", | ||
"lodash.clonedeep": "^4.5.0", | ||
@@ -132,3 +132,3 @@ "lodash.isplainobject": "^4.0.6" | ||
"eslint": "^7.32.0", | ||
"lect": "^0.18.0", | ||
"lect": "^0.18.1", | ||
"lodash.isequal": "^4.5.0", | ||
@@ -144,3 +144,3 @@ "object-path": "^0.11.7", | ||
"tslib": "^2.3.1", | ||
"typescript": "^4.4.2" | ||
"typescript": "^4.4.3" | ||
}, | ||
@@ -147,0 +147,0 @@ "engines": { |
@@ -29,2 +29,4 @@ # ast-monkey-traverse | ||
This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required: | ||
```bash | ||
@@ -34,2 +36,4 @@ npm i ast-monkey-traverse | ||
If you need a legacy version which works with require, use version 2.1.0 | ||
## Quick Take | ||
@@ -36,0 +40,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
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
30970
96
0
Updatedast-monkey-util@^2.0.1