ast-monkey-traverse 3.0.3 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @name ast-monkey-traverse
3
3
  * @fileoverview Utility library to traverse AST
4
- * @version 3.0.3
4
+ * @version 3.0.4
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/ast-monkey-traverse/}
@@ -11,7 +11,7 @@ import clone from 'lodash.clonedeep';
11
11
  import isObj from 'lodash.isplainobject';
12
12
  import { parent } from 'ast-monkey-util';
13
13
 
14
- var version$1 = "3.0.3";
14
+ var version$1 = "3.0.4";
15
15
 
16
16
  const version = version$1;
17
17
  function traverse(tree1, cb1) {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @name ast-monkey-traverse
3
3
  * @fileoverview Utility library to traverse AST
4
- * @version 3.0.3
4
+ * @version 3.0.4
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/ast-monkey-traverse/}
@@ -11,8 +11,8 @@
11
11
  /**
12
12
  * @name ast-monkey-util
13
13
  * @fileoverview Utility library of AST helper functions
14
- * @version 2.0.3
14
+ * @version 2.0.4
15
15
  * @author Roy Revelt, Codsen Ltd
16
16
  * @license MIT
17
17
  * {@link https://codsen.com/os/ast-monkey-util/}
18
- */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.3",Object.defineProperty(t,"__esModule",{value:!0})}));
18
+ */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.4",Object.defineProperty(t,"__esModule",{value:!0})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ast-monkey-traverse",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
4
4
  "description": "Utility library to traverse AST",
5
5
  "keywords": [
6
6
  "ast",
@@ -95,7 +95,7 @@
95
95
  },
96
96
  "dependencies": {
97
97
  "@babel/runtime": "^7.16.0",
98
- "ast-monkey-util": "^2.0.3",
98
+ "ast-monkey-util": "^2.0.4",
99
99
  "lodash.clonedeep": "^4.5.0",
100
100
  "lodash.isplainobject": "^4.0.6"
101
101
  },
@@ -123,12 +123,12 @@
123
123
  "@types/lodash.isplainobject": "^4.0.6",
124
124
  "@types/node": "^16.11.6",
125
125
  "@types/tap": "^15.0.5",
126
- "@typescript-eslint/eslint-plugin": "^5.2.0",
127
- "@typescript-eslint/parser": "^5.2.0",
128
- "core-js": "^3.19.0",
126
+ "@typescript-eslint/eslint-plugin": "^5.3.0",
127
+ "@typescript-eslint/parser": "^5.3.0",
128
+ "core-js": "^3.19.1",
129
129
  "cross-env": "^7.0.3",
130
130
  "eslint": "^8.1.0",
131
- "lect": "^0.18.3",
131
+ "lect": "^0.18.4",
132
132
  "lodash.isequal": "^4.5.0",
133
133
  "object-path": "^0.11.8",
134
134
  "rollup": "^2.59.0",