estree-toolbox 1.0.0 → 1.1.0

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 +1 @@
1
- ((t,e)=>{let i="estree-toolbox";const s={dirname(t){return t===this.sep?t:t.split(this.sep).slice(0,-1).join(this.sep)},resolve(...t){if(!t.length)return this.sep;if(t[0][0]===this.sep)return t.join(this.sep);const e=[...i.split(this.sep),...t.join(this.sep).split(this.sep)],s=[];for(const t of e)".."!==t?"."!==t&&t&&s.push(t):s.pop();return s.join(this.sep)},join(...t){return t.join(this.sep)},sep:"/"},r={};function n(t,e,i){const s=t?.children;!s||i&&s.includes(e)||s.push(e)}function o(t,e,i){return a._load.call({__proto__:null,parentFilename:e?.filename,id:t},t,e,i)}function a(t="",e){this.id=t,this.path=s.dirname(t),this.exports={},n(e,this,!1),this.filename=null,this.loaded=!1,this.children=[]}a.Module=a,a._nodeModulePaths=function(t){const e=[];let i=s.resolve(t);for(;;){e.push(s.join(i,"node_modules"));const t=s.dirname(i);if(t===i)break;i=t}return e},a._cache=Object.create(null),a._extensions=Object.create(null),a._load=function(t,e,i){const o=s.resolve(t).split(s.sep),h=[];for(const t of o)".."!==t?"."!==t&&h.push(t):h.pop();const l=s.resolve(t),p=a._cache[l];if(void 0!==p){if(n(e,p,!0),p.loaded)return p.exports;if(!p[kIsCachedByESMLoader])return getExportsForCircularRequire(p);if(p[kModuleCircularVisited])return getExportsForCircularRequire(p);p[kModuleCircularVisited]=!0}const c=p||new a(l,e);return p||(i&&(r.mainModule=c,c.require.main=r.mainModule,c.id="."),a._cache[l]=c,c.load(l)),c.exports},a.prototype.load=function(t){this.filename??=t,this.paths??=a._nodeModulePaths(s.dirname(t));const e=t.includes(".")?"."+t.split(".").slice(-1)[0]:"";a._extensions[e](this,t),this.loaded=!0},a.prototype.require=function(t){return o(t,this,!1)},Object.assign(a._extensions,{".js":function(e,n){function o(t){return e.require(t)}o.main=r.mainModule,o.extensions=a._extensions,o.cache=a._cache;const h=t[n],l=i;i=s.dirname(n),h(o,e.exports,e),i=l}});const h=()=>o(e,new a(e),!0);"object"==typeof exports?module.exports=h():"function"==typeof define?define("estree-toolbox",[],h):globalThis.estreeToolbox=h()})({"estree-toolbox/index.js"(t,e,i){const s=t("./lib/node-visitor.js"),r=t("./lib/node-transformer.js"),n=t("./lib/code-generator.js"),{Unparser:o,unparse:a}=t("./lib/unparser.js");i.exports={NodeVisitor:s,NodeTransformer:r,BaseCodeGenerator:n,Unparser:o,unparse:a}},"estree-toolbox/lib/code-generator.js"(t,e,i){const s=t("./node-visitor.js");i.exports=class extends s{constructor(t){super(),this._source=[],this._indent=0,this.indentLevel=t?.indent??2}items_view(t,e,i=", "){if(!Array.isArray(e))throw new TypeError(e+" is not a Array.");1===e.length?t.call(this,e[0]):e.forEach((s,r)=>{t.call(this,s),r!==e.length-1&&this.write(i)})}maybe_newline(t=!0){this._source.filter(t=>t.trim()).length&&(t&&this.write(";"),this.write("\n"))}fill(t=""){this.maybe_newline(),this.write(" ".repeat(this._indent*this.indentLevel)+t)}fillBlock(t=!0){t&&this.maybe_newline(!1),this.write(" ".repeat(this._indent*this.indentLevel))}inline(t){const e=this.maybe_newline,i=this.block;this.block=(...t)=>{const r=i.apply(this,t);return t=>{this.maybe_newline=e,this.block=i,r(t),this.maybe_newline=()=>{},this.block=s}};const s=this.block;this.maybe_newline=()=>{},t(),this.maybe_newline=e,this.block=i}write(...t){let e;if(e=t.find(t=>"string"!=typeof t))throw console.error(e),new TypeError(e+" is not a string.");this._source.push(...t)}buffered(t){return t??=[],e=>{const i=this._source;return this._source=t,e(t),this._source=i,t}}block({braces:t}={braces:!0}){return e=>{this.delimit_if("{","}",t)(()=>{const t=this.buffered()(()=>{this._indent++,this.write("\n"),e(),this._indent--});this.write(...t),this.fillBlock()})}}delimit(t,e){return i=>{this.write(t),i(),this.write(e)}}delimit_if(t,e,i){return i?this.delimit(t,e):t=>t()}traverse(t){if(Array.isArray(t))for(const e of t)this.traverse(e);else super.visit(t)}visit(t){return this._source=[],this.traverse(t),this._source.join("")}generic_visit(t){console.warn("Supplementary required "+t.type)}}},"estree-toolbox/lib/node-transformer.js"(t,e,i){const s=t("./node-visitor.js");i.exports=class extends s{generic_visit(t){for(const[e,i]of Object.entries(t))if(Array.isArray(i)){const t=[];for(let e of i){if(e.type){if(e=this.visit(e),!e)continue;if(!e?.type){t.push(...e);continue}}t.push(e)}i.splice(0,i.length,...t)}else if(i?.type){let s=this.visit(i);null==s?delete t[e]:t[e]=s}return t}}},"estree-toolbox/lib/node-visitor.js"(t,e,i){i.exports=class{visit(t){if(!t?.type)throw TypeError(`'${t}' is not a node.`);return(this["visit_"+t.type]??this.generic_visit).call(this,t)}generic_visit(t){for(const[e,i]of Object.entries(t))if(Array.isArray(i))for(const t of i)t?.type&&this.visit(t);else i?.type&&this.visit(i)}}},"estree-toolbox/lib/unparser.js"(t,e,i){const s=t("./code-generator.js");class r{constructor(...t){var e;1!==t.length||(!(e=t[0])||!["object","function"].includes(typeof e)||"number"!=typeof e.length||e.length<0||e.length%1)||(t=t[0]),((t,e,i)=>{for(let s=0;s<t.length;s++){const r=t[s];void 0!==i?e.call(i,r,s):e(r,s)}})(t,(t,e)=>{this[e]=t}),this.length=t.length}has(t){return Array.from(this).includes(t)}}const n=(()=>{let t=0;const e=e=>e?t:t++;return[["MemberExpression",e(!0)],["CallExpression",e(!0)],["NewExpression",e(!0)],["UpdateExpression",e()],["UnaryExpression",e()],[{type:"BinaryExpression",operator:"**"},e()],[{type:"BinaryExpression",operator:new r("*","/","%")},e()],[{type:"BinaryExpression",operator:new r("+","-")},e()],[{type:"BinaryExpression",operator:new r("<<",">>",">>>")},e()],[{type:"BinaryExpression",operator:new r(">","<",">=","<=","in","instanceof")},e()],[{type:"BinaryExpression",operator:new r("==","!=","===","!==")},e()],[{type:"BinaryExpression",operator:"&"},e()],[{type:"BinaryExpression",operator:"^"},e()],[{type:"BinaryExpression",operator:"|"},e()],[{type:"LogicalExpression",operator:"&&"},e()],[{type:"LogicalExpression",operator:"||"},e()],[{type:"CoalesceExpression",operator:"??"},e()],["ConditionalExpression",e()],["AssignmentExpression",e()],["SequenceExpression",e()]]})(),o=(t,e)=>{if("string"==typeof e)return t?.type===e;for(const[i,s]of Object.entries(e))if(s instanceof r){if(!s.has(t[i]))return!1}else if("object"==typeof s&&s){if(!o(t[i],s))return!1}else if(s!==t[i])return!1;return!0},a=(t,e)=>{const i=n.find(([e])=>o(t,e))?.[1],s=n.find(([t])=>o(e,t))?.[1];return i<s};class h extends s{blockNode(t){"BlockStatement"!==t.type?this.block({braces:!1})(()=>{this.traverse(t)}):this.traverse(t)}visit_Program(t){this.traverse(t.body)}visit_VariableDeclaration(t){this.fill(),this.write(t.kind),this.write(" ");for(const e of t.declarations)this.traverse(e)}visit_VariableDeclarator(t){this.traverse(t.id),t.init&&(this.write(" = "),this.traverse(t.init))}visit_Identifier(t){this.write(t.name)}visit_Literal(t){switch(typeof t.value){case"string":this.write(JSON.stringify(t.value));break;case"number":case"boolean":this.write(String(t.value));break;case"bigint":this.write(t.value+"n");break;case"object":t.value instanceof RegExp?this.write(String(t.value)):this.write("null")}}visit_CallExpression(t){this.traverse(t.callee),this.delimit("(",")")(()=>{this.items_view(this.traverse,t.arguments)})}visit_NewExpression(t){this.write("new "),this.traverse(t.callee),this.delimit("(",")")(()=>{this.items_view(this.traverse,t.arguments)})}visit_ArrayExpression(t){this.delimit("[","]")(()=>{this.items_view(this.traverse,t.elements)})}visit_ObjectExpression(t){this.delimit("{","}")(()=>{this.items_view(this.traverse,t.properties)})}visit_Property(t){this.traverse(t.key),this.write(": "),this.traverse(t.value)}visit_ArrowFunctionExpression(t){t.async&&this.write("async "),1===t.params.length&&"Identifier"===t.params[0].type?this.traverse(t.params[0]):this.delimit("(",")")(()=>{this.items_view(this.traverse,t.params)}),this.write(" => "),this.delimit_if("(",")","BlockStatement"!==t.body.type)(()=>{this.traverse(t.body)})}visit_BlockStatement(t){this.block()(()=>{this.traverse(t.body)})}visit_ExpressionStatement(t){this.fill(),this.traverse(t.expression)}visit_AssignmentExpression(t){this.visit_BinaryExpression(t)}visit_BinaryExpression(t){const{left:e,right:i}=t;this.delimit_if("(",")",a(t,e))(()=>{this.traverse(e)}),this.delimit(" "," ")(()=>{this.write(t.operator)}),this.delimit_if("(",")",a(t,i))(()=>{this.traverse(i)})}visit_LogicalExpression(t){this.visit_BinaryExpression(t)}visit_UnaryExpression(t){t.prefix&&(this.write(t.operator),/^\w+$/.test(t.operator)&&this.write(" ")),this.traverse(t.argument),t.prefix||this.write(t.operator)}visit_ConditionalExpression(t){this.delimit_if("(",")",a(t,t.test))(()=>{this.traverse(t.test)}),this.write(" ? "),this.traverse(t.consequent),this.write(" : "),this.delimit_if("(",")",a(t,t.alternate))(()=>{this.traverse(t.alternate)})}visit_MemberExpression(t){this.delimit_if("(",")",a(t,t.object))(()=>{this.traverse(t.object)}),t.optional&&this.write("?."),t.computed?this.delimit("[","]")(()=>{this.traverse(t.property)}):(this.write(t.optional?"?.":"."),this.traverse(t.property))}visit_IfStatement(t){this.fill(),this.write("if "),this.delimit("(",")")(()=>{this.traverse(t.test)}),this.write(" "),this.blockNode(t.consequent),t.alternate&&(this.write("else "),this.blockNode(t.alternate))}visit_SwitchStatement(t){this.fill(),this.write("switch "),this.delimit("(",")")(()=>{this.traverse(t.discriminant)}),this.block()(()=>{this.traverse(t.cases)})}visit_SwitchCase(t){this.fillBlock(),t.test?(this.write("case "),this.delimit("(",")")(()=>{this.traverse(t.test)})):this.write("default "),this.write(":"),this.blockNode(t.consequent)}visit_BreakStatement(t){this.fill(),this.write("break"),t.label&&(this.write(" "),this.traverse(t.label))}visit_ContinueStatement(t){this.fill(),this.write("continue"),t.label&&(this.write(" "),this.traverse(t.label))}visit_ForStatement(t){this.fill(),this.write("for "),this.delimit("(",")")(()=>{let e=this.buffered()(()=>{this.traverse(t.init),this.write(" ; "),this.traverse(t.test),this.write(" ; "),this.traverse(t.update)});this.write(...e)}),this.blockNode(t.body)}visit_UpdateExpression(t){t.prefix&&this.write(t.operator),this.delimit_if("(",")",a(t,t.argument))(()=>{this.traverse(t.argument)}),t.prefix||this.write(t.operator)}visit_ForInStatement(t){this.fill(),this.write("for "),this.delimit("(",")")(()=>{this.inline(()=>{this.traverse(t.left)}),this.write(" in "),this.traverse(t.right)}),this.blockNode(t.body)}visit_EmptyStatement(t){this.fill()}visit_ForOfStatement(t){this.fill(),this.write("for "),t.await&&this.write("await "),this.delimit("(",")")(()=>{this.inline(()=>{this.traverse(t.left)}),this.write(" of "),this.traverse(t.right)}),this.blockNode(t.body)}visit_WhileStatement(t){this.fill(),this.write("while "),this.delimit("(",")")(()=>{this.traverse(t.test)}),this.blockNode(t.body)}visit_DoWhileStatement(t){this.fill(),this.write("do "),this.blockNode(t.body),this.write(" while "),this.delimit("(",")")(()=>{this.traverse(t.test)})}visit_FunctionDeclaration(t){this.fill(),t.async&&this.write("async "),this.write("function"),t.generator&&this.write("*"),this.write(" "),t.id&&this.traverse(t.id),this.delimit("(",")")(()=>{this.items_view(this.traverse,t.params)}),this.write(" "),this.traverse(t.body)}visit_FunctionExpression(t){this.delimit("(",")")(()=>{t.async&&this.write("async "),this.write("function"),t.generator&&this.write("*"),this.write(" "),t.id&&this.traverse(t.id),this.delimit("(",")")(()=>{this.items_view(this.traverse,t.params)}),this.write(" "),this.traverse(t.body)})}visit_AssignmentPattern(t){this.traverse(t.left),this.write(" = "),this.traverse(t.right)}visit_ReturnStatement(t){this.fill("return"),t.argument&&(this.write(" "),this.traverse(t.argument)),this.write(";")}visit_RestElement(t){this.write("..."),this.traverse(t.argument)}visit_SpreadElement(t){this.write("..."),this.traverse(t.argument)}visit_ObjectPattern(t){this.delimit("{","}")(()=>{this.items_view(this.traverse,t.properties)})}visit_ArrayPattern(t){this.delimit("[","]")(()=>{this.items_view(this.traverse,t.elements)})}visit_YieldExpression(t){this.write("yield"),t.delegate&&this.write("*"),t.argument&&(this.write(" "),this.traverse(t.argument))}visit_ThisExpression(t){this.write("this")}visit_ClassDeclaration(t){this.fill("class "),t.id&&this.traverse(t.id),t.superClass&&(this.write(" extends "),this.traverse(t.superClass)),this.block()(()=>{this.traverse(t.body)})}visit_ClassBody(t){this.traverse(t.body)}visit_MethodDefinition(t){switch(this.fill(),t.kind){case"get":this.write("get ");break;case"set":this.write("set ")}const e=t.key;(t=>{t.async&&this.write("async "),t.generator&&this.write("*"),this.traverse(e),this.write(" "),this.delimit("(",")")(()=>{this.items_view(this.traverse,t.params)}),this.write(" "),this.traverse(t.body)})(t.value)}visit_TemplateLiteral(t){const e=[];for(let i=0;i<2*t.quasis.length-1;i++)i%2?e.push(t.expressions[i]):e.push(t.quasis[i]);for(;void 0===e.pop()&&e.length;);this.delimit("`","`")(()=>{for(const t of e)this.delimit_if("${","}","TemplateElement"!==t.type)(()=>{this.traverse(t)})})}visit_TemplateElement(t){this.write(t.value.raw)}visit_Super(t){this.write("super")}visit_ExportNamedDeclaration(t){this.fill("export "),this.delimit_if("{","}",t.specifiers.length)(()=>{this.items_view(this.traverse,t.specifiers)}),t.declaration&&this.inline(()=>{this.traverse(t.declaration)}),t.attributes.length&&(this.write(" with "),this.delimit("{","}")(()=>{this.items_view(this.traverse,t.attributes)}))}visit_ExportSpecifier(t){this.traverse(t.local),t.exported!==t.local&&(this.write(" as "),this.traverse(t.exported))}visit_ExportDefaultDeclaration(t){this.fill("export default "),this.inline(()=>{this.traverse(t.declaration)})}visit_ImportDeclaration(t){this.fill("import ");const e=t.specifiers.filter(t=>!["ImportDefaultSpecifier","ImportNamespaceSpecifier"].includes(t.type));e.length&&this.delimit("{","}")(()=>{this.items_view(this.traverse,e)});const i=t.specifiers.find(t=>"ImportDefaultSpecifier"===t.type);i&&(e.length&&this.write(","),this.traverse(i));const s=t.specifiers.find(t=>"ImportNamespaceSpecifier"===t.type);s&&(e.length&&this.write(","),this.traverse(s)),this.write(" from "),this.traverse(t.source),t.attributes.length&&(this.write(" with "),this.delimit("{","}")(()=>{this.items_view(this.traverse,t.attributes)}))}visit_ImportSpecifier(t){this.traverse(t.local),t.imported!==t.local&&(this.write(" as "),this.traverse(t.imported))}visit_ImportNamespaceSpecifier(t){this.write("* as "),this.traverse(t.local)}visit_ImportDefaultSpecifier(t){this.traverse(t.local)}visit_TryStatement(t){this.fill("try "),this.blockNode(t.block),t.handler&&this.traverse(t.handler),t.finalizer&&(this.write(" finally "),this.blockNode(t.finalizer))}visit_CatchClause(t){this.fill("catch "),this.delimit("(",")")(()=>{this.traverse(t.param)}),this.write(" "),this.blockNode(t.body)}visit_ThrowStatement(t){this.fill("throw "),this.traverse(t.argument)}visit_ChainExpression(t){this.traverse(t.expression)}visit_AwaitExpression(t){this.write("await "),this.traverse(t.argument)}visit_SequenceExpression(t){this.items_view(this.traverse,t.expressions)}}i.exports={Unparser:h,unparse:function(t,e){return new h(e).visit(t)}}}},"./index.js");
1
+ ((t,i)=>{let e="estree-toolbox";const s={dirname(t){return t===this.sep?t:t.split(this.sep).slice(0,-1).join(this.sep)},resolve(...t){if(!t.length)return this.sep;if(t[0][0]===this.sep)return t.join(this.sep);const i=[...e.split(this.sep),...t.join(this.sep).split(this.sep)],s=[];for(const t of i)".."!==t?"."!==t&&t&&s.push(t):s.pop();return s.join(this.sep)},join(...t){return t.join(this.sep)},sep:"/"},r={};function n(t,i,e){const s=t?.children;!s||e&&s.includes(i)||s.push(i)}function o(t,i,e){return a._load.call({__proto__:null,parentFilename:i?.filename,id:t},t,i,e)}function a(t="",i){this.id=t,this.path=s.dirname(t),this.exports={},n(i,this,!1),this.filename=null,this.loaded=!1,this.children=[]}a.Module=a,a._nodeModulePaths=function(t){const i=[];let e=s.resolve(t);for(;;){i.push(s.join(e,"node_modules"));const t=s.dirname(e);if(t===e)break;e=t}return i},a._cache=Object.create(null),a._extensions=Object.create(null),a._load=function(t,i,e){const o=s.resolve(t).split(s.sep),h=[];for(const t of o)".."!==t?"."!==t&&h.push(t):h.pop();const l=s.resolve(t),c=a._cache[l];if(void 0!==c){if(n(i,c,!0),c.loaded)return c.exports;if(!c[kIsCachedByESMLoader])return getExportsForCircularRequire(c);if(c[kModuleCircularVisited])return getExportsForCircularRequire(c);c[kModuleCircularVisited]=!0}const p=c||new a(l,i);return c||(e&&(r.mainModule=p,p.require.main=r.mainModule,p.id="."),a._cache[l]=p,p.load(l)),p.exports},a.prototype.load=function(t){this.filename??=t,this.paths??=a._nodeModulePaths(s.dirname(t));const i=t.includes(".")?"."+t.split(".").slice(-1)[0]:"";a._extensions[i](this,t),this.loaded=!0},a.prototype.require=function(t){return o(t,this,!1)},Object.assign(a._extensions,{".js":function(i,n){function o(t){return i.require(t)}o.main=r.mainModule,o.extensions=a._extensions,o.cache=a._cache;const h=t[n],l=e;e=s.dirname(n),h(o,i.exports,i),e=l}});const h=()=>o(i,new a(i),!0);"object"==typeof exports?module.exports=h():"function"==typeof define?define("estree-toolbox",[],h):globalThis.estreeToolbox=h()})({"estree-toolbox/index.js"(t,i,e){const s=t("./lib/node-visitor.js"),r=t("./lib/node-transformer.js"),n=t("./lib/code-generator.js"),{Unparser:o,unparse:a}=t("./lib/unparser.js");e.exports={NodeVisitor:s,NodeTransformer:r,BaseCodeGenerator:n,Unparser:o,unparse:a}},"estree-toolbox/lib/code-generator.js"(t,i,e){const s=t("./node-visitor.js");e.exports=class extends s{constructor(t){super(),this._source=[],this._indent=0,this.indentLevel=t?.indent??2}items_view(t,i,e=", "){if(!Array.isArray(i))throw new TypeError(i+" is not a Array.");1===i.length?t.call(this,i[0]):i.forEach((s,r)=>{t.call(this,s),r!==i.length-1&&this.write(e)})}maybe_newline(t=!0){this._source.filter(t=>t.trim()).length&&(t&&this.write(";"),this.write("\n"))}fill(t=""){this.maybe_newline(),this.write(" ".repeat(this._indent*this.indentLevel)+t)}fillBlock(t=!0){t&&this.maybe_newline(!1),this.write(" ".repeat(this._indent*this.indentLevel))}inline(t){const i=this.maybe_newline,e=this.block;this.block=(...t)=>{const r=e.apply(this,t);return t=>{this.maybe_newline=i,this.block=e,r(t),this.maybe_newline=()=>{},this.block=s}};const s=this.block;this.maybe_newline=()=>{},t(),this.maybe_newline=i,this.block=e}write(...t){let i;if(i=t.find(t=>"string"!=typeof t))throw console.error(i),new TypeError(i+" is not a string.");this._source.push(...t)}buffered(t){return t??=[],i=>{const e=this._source;return this._source=t,i(t),this._source=e,t}}block({braces:t}={braces:!0}){return i=>{this.delimit_if("{","}",t)(()=>{const t=this.buffered()(()=>{this._indent++,this.write("\n"),i(),this._indent--});this.write(...t),this.fillBlock()})}}delimit(t,i){return e=>{this.write(t),e(),this.write(i)}}delimit_if(t,i,e){return e?this.delimit(t,i):t=>t()}traverse(t){if(Array.isArray(t))for(const i of t)this.traverse(i);else super.visit(t)}visit(t){return this._source=[],this.traverse(t),this._source.join("")}generic_visit(t){console.warn("Supplementary required "+t.type)}}},"estree-toolbox/lib/node-transformer.js"(t,i,e){const s=t("./node-visitor.js");e.exports=class extends s{generic_visit(t){for(const[i,e]of Object.entries(t))if(Array.isArray(e)){const t=[];for(let i of e){if(i.type){if(i=this.visit(i),!i)continue;if(!i?.type){t.push(...i);continue}}t.push(i)}e.splice(0,e.length,...t)}else if(e?.type){let s=this.visit(e);null==s?delete t[i]:t[i]=s}return t}}},"estree-toolbox/lib/node-visitor.js"(t,i,e){e.exports=class{visit(t){if(!t?.type)throw TypeError(`'${t}' is not a node.`);return(this["visit_"+t.type]??this.generic_visit).call(this,t)}generic_visit(t){for(const[i,e]of Object.entries(t))if(Array.isArray(e))for(const t of e)t?.type&&this.visit(t);else e?.type&&this.visit(e)}}},"estree-toolbox/lib/unparser.js"(t,i,e){const s=t("./code-generator.js");class r{constructor(...t){var i;1!==t.length||(!(i=t[0])||!["object","function"].includes(typeof i)||"number"!=typeof i.length||i.length<0||i.length%1)||(t=t[0]),((t,i,e)=>{for(let s=0;s<t.length;s++){const r=t[s];void 0!==e?i.call(e,r,s):i(r,s)}})(t,(t,i)=>{this[i]=t}),this.length=t.length}has(t){return Array.from(this).includes(t)}}const n=(()=>{let t=0;const i=i=>i?t:t++;return[["MemberExpression",i(!0)],["CallExpression",i(!0)],["NewExpression",i(!0)],["UpdateExpression",i()],["UnaryExpression",i()],[{type:"BinaryExpression",operator:"**"},i()],[{type:"BinaryExpression",operator:new r("*","/","%")},i()],[{type:"BinaryExpression",operator:new r("+","-")},i()],[{type:"BinaryExpression",operator:new r("<<",">>",">>>")},i()],[{type:"BinaryExpression",operator:new r(">","<",">=","<=","in","instanceof")},i()],[{type:"BinaryExpression",operator:new r("==","!=","===","!==")},i()],[{type:"BinaryExpression",operator:"&"},i()],[{type:"BinaryExpression",operator:"^"},i()],[{type:"BinaryExpression",operator:"|"},i()],[{type:"LogicalExpression",operator:"&&"},i()],[{type:"LogicalExpression",operator:"||"},i()],[{type:"CoalesceExpression",operator:"??"},i()],["ConditionalExpression",i()],["AssignmentExpression",i()],["SequenceExpression",i()]]})(),o=(t,i)=>{if("string"==typeof i)return t?.type===i;for(const[e,s]of Object.entries(i))if(s instanceof r){if(!s.has(t[e]))return!1}else if("object"==typeof s&&s){if(!o(t[e],s))return!1}else if(s!==t[e])return!1;return!0},a=(t,i)=>{const e=n.find(([i])=>o(t,i))?.[1],s=n.find(([t])=>o(i,t))?.[1];return e<s};class h extends s{blockNode(t){"BlockStatement"!==t.type?this.block({braces:!1})(()=>{this.traverse(t)}):this.traverse(t)}visit_Program(t){this.traverse(t.body)}visit_VariableDeclaration(t){this.fill(),this.write(t.kind),this.write(" ");for(const i of t.declarations)this.traverse(i)}visit_VariableDeclarator(t){this.traverse(t.id),t.init&&(this.write(" = "),this.traverse(t.init))}visit_Identifier(t){this.write(t.name)}visit_Literal(t){switch(typeof t.value){case"string":this.write(JSON.stringify(t.value));break;case"number":case"boolean":this.write(String(t.value));break;case"bigint":this.write(t.value+"n");break;case"object":t.value instanceof RegExp?this.write(String(t.value)):this.write("null")}}visit_CallExpression(t){this.traverse(t.callee),this.delimit("(",")")(()=>{this.items_view(this.traverse,t.arguments)})}visit_NewExpression(t){this.write("new "),this.traverse(t.callee),this.delimit("(",")")(()=>{this.items_view(this.traverse,t.arguments)})}visit_ArrayExpression(t){this.delimit("[","]")(()=>{this.items_view(this.traverse,t.elements)})}visit_ObjectExpression(t){this.delimit("{","}")(()=>{this.items_view(this.traverse,t.properties)})}visit_Property(t){this.traverse(t.key),this.write(": "),this.traverse(t.value)}visit_ArrowFunctionExpression(t){t.async&&this.write("async "),1===t.params.length&&"Identifier"===t.params[0].type?this.traverse(t.params[0]):this.delimit("(",")")(()=>{this.items_view(this.traverse,t.params)}),this.write(" => "),this.delimit_if("(",")","BlockStatement"!==t.body.type)(()=>{this.traverse(t.body)})}visit_BlockStatement(t){this.block()(()=>{this.traverse(t.body)})}visit_ExpressionStatement(t){this.fill(),this.traverse(t.expression)}visit_AssignmentExpression(t){this.visit_BinaryExpression(t)}visit_BinaryExpression(t){const{left:i,right:e}=t;this.delimit_if("(",")",a(t,i))(()=>{this.traverse(i)}),this.delimit(" "," ")(()=>{this.write(t.operator)}),this.delimit_if("(",")",a(t,e))(()=>{this.traverse(e)})}visit_LogicalExpression(t){this.visit_BinaryExpression(t)}visit_UnaryExpression(t){t.prefix&&(this.write(t.operator),/^\w+$/.test(t.operator)&&this.write(" ")),this.traverse(t.argument),t.prefix||this.write(t.operator)}visit_ConditionalExpression(t){this.delimit_if("(",")",a(t,t.test))(()=>{this.traverse(t.test)}),this.write(" ? "),this.traverse(t.consequent),this.write(" : "),this.delimit_if("(",")",a(t,t.alternate))(()=>{this.traverse(t.alternate)})}visit_MemberExpression(t){this.delimit_if("(",")",a(t,t.object))(()=>{this.traverse(t.object)}),t.optional&&this.write("?."),t.computed?this.delimit("[","]")(()=>{this.traverse(t.property)}):(this.write(t.optional?"?.":"."),this.traverse(t.property))}visit_IfStatement(t){this.fill(),this.write("if "),this.delimit("(",")")(()=>{this.traverse(t.test)}),this.write(" "),this.blockNode(t.consequent),t.alternate&&(this.write("else "),this.blockNode(t.alternate))}visit_SwitchStatement(t){this.fill(),this.write("switch "),this.delimit("(",")")(()=>{this.traverse(t.discriminant)}),this.block()(()=>{this.traverse(t.cases)})}visit_SwitchCase(t){this.fillBlock(),t.test?(this.write("case "),this.delimit("(",")")(()=>{this.traverse(t.test)})):this.write("default "),this.write(":"),this.blockNode(t.consequent)}visit_BreakStatement(t){this.fill(),this.write("break"),t.label&&(this.write(" "),this.traverse(t.label))}visit_ContinueStatement(t){this.fill(),this.write("continue"),t.label&&(this.write(" "),this.traverse(t.label))}visit_ForStatement(t){this.fill(),this.write("for "),this.delimit("(",")")(()=>{let i=this.buffered()(()=>{this.traverse(t.init),this.write(" ; "),this.traverse(t.test),this.write(" ; "),this.traverse(t.update)});this.write(...i)}),this.blockNode(t.body)}visit_UpdateExpression(t){t.prefix&&this.write(t.operator),this.delimit_if("(",")",a(t,t.argument))(()=>{this.traverse(t.argument)}),t.prefix||this.write(t.operator)}visit_ForInStatement(t){this.fill(),this.write("for "),this.delimit("(",")")(()=>{this.inline(()=>{this.traverse(t.left)}),this.write(" in "),this.traverse(t.right)}),this.blockNode(t.body)}visit_EmptyStatement(t){this.fill()}visit_ForOfStatement(t){this.fill(),this.write("for "),t.await&&this.write("await "),this.delimit("(",")")(()=>{this.inline(()=>{this.traverse(t.left)}),this.write(" of "),this.traverse(t.right)}),this.blockNode(t.body)}visit_WhileStatement(t){this.fill(),this.write("while "),this.delimit("(",")")(()=>{this.traverse(t.test)}),this.blockNode(t.body)}visit_DoWhileStatement(t){this.fill(),this.write("do "),this.blockNode(t.body),this.write(" while "),this.delimit("(",")")(()=>{this.traverse(t.test)})}visit_FunctionDeclaration(t){this.fill(),t.async&&this.write("async "),this.write("function"),t.generator&&this.write("*"),this.write(" "),t.id&&this.traverse(t.id),this.delimit("(",")")(()=>{this.items_view(this.traverse,t.params)}),this.write(" "),this.traverse(t.body)}visit_FunctionExpression(t){this.delimit("(",")")(()=>{t.async&&this.write("async "),this.write("function"),t.generator&&this.write("*"),this.write(" "),t.id&&this.traverse(t.id),this.delimit("(",")")(()=>{this.items_view(this.traverse,t.params)}),this.write(" "),this.traverse(t.body)})}visit_AssignmentPattern(t){this.traverse(t.left),this.write(" = "),this.traverse(t.right)}visit_ReturnStatement(t){this.fill("return"),t.argument&&(this.write(" "),this.traverse(t.argument)),this.write(";")}visit_RestElement(t){this.write("..."),this.traverse(t.argument)}visit_SpreadElement(t){this.write("..."),this.traverse(t.argument)}visit_ObjectPattern(t){this.delimit("{","}")(()=>{this.items_view(this.traverse,t.properties)})}visit_ArrayPattern(t){this.delimit("[","]")(()=>{this.items_view(this.traverse,t.elements)})}visit_YieldExpression(t){this.write("yield"),t.delegate&&this.write("*"),t.argument&&(this.write(" "),this.traverse(t.argument))}visit_ThisExpression(t){this.write("this")}visit_ClassDeclaration(t){this.fill("class "),t.id&&this.traverse(t.id),t.superClass&&(this.write(" extends "),this.traverse(t.superClass)),this.block()(()=>{this.traverse(t.body)})}visit_ClassExpression(t){this.write("class "),t.id&&this.traverse(t.id),t.superClass&&(this.write(" extends "),this.traverse(t.superClass)),t.body.body.length?this.block()(()=>{this.traverse(t.body)}):this.write("{}")}visit_ClassBody(t){this.traverse(t.body)}visit_PropertyDefinition(t){this.fill(),t.static&&this.write("static "),this.delimit_if("[","]",t.computed)(()=>{this.traverse(t.key)}),this.write(" = "),this.traverse(t.value)}visit_MethodDefinition(t){switch(this.fill(),t.kind){case"get":this.write("get ");break;case"set":this.write("set ")}const i=t.key;t.static&&this.write("static "),(t=>{t.async&&this.write("async "),t.generator&&this.write("*"),this.traverse(i),this.write(" "),this.delimit("(",")")(()=>{this.items_view(this.traverse,t.params)}),this.write(" "),this.traverse(t.body)})(t.value)}visit_TemplateLiteral(t){const i=[];for(let e=0;e<2*t.quasis.length-1;e++)e%2?i.push(t.expressions[e]):i.push(t.quasis[e]);for(;void 0===i.pop()&&i.length;);this.delimit("`","`")(()=>{for(const t of i)this.delimit_if("${","}","TemplateElement"!==t.type)(()=>{this.traverse(t)})})}visit_TemplateElement(t){this.write(t.value.raw)}visit_Super(t){this.write("super")}visit_ExportNamedDeclaration(t){this.fill("export "),this.delimit_if("{","}",t.specifiers.length)(()=>{this.items_view(this.traverse,t.specifiers)}),t.declaration&&this.inline(()=>{this.traverse(t.declaration)}),t.attributes.length&&(this.write(" with "),this.delimit("{","}")(()=>{this.items_view(this.traverse,t.attributes)}))}visit_ExportSpecifier(t){this.traverse(t.local),t.exported!==t.local&&(this.write(" as "),this.traverse(t.exported))}visit_ExportDefaultDeclaration(t){this.fill("export default "),this.inline(()=>{this.traverse(t.declaration)})}visit_ImportDeclaration(t){this.fill("import ");const i=t.specifiers.filter(t=>!["ImportDefaultSpecifier","ImportNamespaceSpecifier"].includes(t.type));i.length&&this.delimit("{","}")(()=>{this.items_view(this.traverse,i)});const e=t.specifiers.find(t=>"ImportDefaultSpecifier"===t.type);e&&(i.length&&this.write(","),this.traverse(e));const s=t.specifiers.find(t=>"ImportNamespaceSpecifier"===t.type);s&&(i.length&&this.write(","),this.traverse(s)),this.write(" from "),this.traverse(t.source),t.attributes.length&&(this.write(" with "),this.delimit("{","}")(()=>{this.items_view(this.traverse,t.attributes)}))}visit_ImportSpecifier(t){this.traverse(t.local),t.imported!==t.local&&(this.write(" as "),this.traverse(t.imported))}visit_ImportNamespaceSpecifier(t){this.write("* as "),this.traverse(t.local)}visit_ImportDefaultSpecifier(t){this.traverse(t.local)}visit_TryStatement(t){this.fill("try "),this.blockNode(t.block),t.handler&&this.traverse(t.handler),t.finalizer&&(this.write(" finally "),this.blockNode(t.finalizer))}visit_CatchClause(t){this.fill("catch "),this.delimit("(",")")(()=>{this.traverse(t.param)}),this.write(" "),this.blockNode(t.body)}visit_ThrowStatement(t){this.fill("throw "),this.traverse(t.argument)}visit_ChainExpression(t){this.traverse(t.expression)}visit_AwaitExpression(t){this.write("await "),this.traverse(t.argument)}visit_SequenceExpression(t){this.items_view(this.traverse,t.expressions)}}e.exports={Unparser:h,unparse:function(t,i){return new h(i).visit(t)}}}},"./index.js");
@@ -1 +1 @@
1
- const module=((t,e)=>{let i="estree-toolbox";const s={dirname(t){return t===this.sep?t:t.split(this.sep).slice(0,-1).join(this.sep)},resolve(...t){if(!t.length)return this.sep;if(t[0][0]===this.sep)return t.join(this.sep);const e=[...i.split(this.sep),...t.join(this.sep).split(this.sep)],s=[];for(const t of e)".."!==t?"."!==t&&t&&s.push(t):s.pop();return s.join(this.sep)},join(...t){return t.join(this.sep)},sep:"/"},r={};function n(t,e,i){const s=t?.children;!s||i&&s.includes(e)||s.push(e)}function o(t,e,i){return a._load.call({__proto__:null,parentFilename:e?.filename,id:t},t,e,i)}function a(t="",e){this.id=t,this.path=s.dirname(t),this.exports={},n(e,this,!1),this.filename=null,this.loaded=!1,this.children=[]}a.Module=a,a._nodeModulePaths=function(t){const e=[];let i=s.resolve(t);for(;;){e.push(s.join(i,"node_modules"));const t=s.dirname(i);if(t===i)break;i=t}return e},a._cache=Object.create(null),a._extensions=Object.create(null),a._load=function(t,e,i){const o=s.resolve(t).split(s.sep),h=[];for(const t of o)".."!==t?"."!==t&&h.push(t):h.pop();const l=s.resolve(t),p=a._cache[l];if(void 0!==p){if(n(e,p,!0),p.loaded)return p.exports;if(!p[kIsCachedByESMLoader])return getExportsForCircularRequire(p);if(p[kModuleCircularVisited])return getExportsForCircularRequire(p);p[kModuleCircularVisited]=!0}const c=p||new a(l,e);return p||(i&&(r.mainModule=c,c.require.main=r.mainModule,c.id="."),a._cache[l]=c,c.load(l)),c.exports},a.prototype.load=function(t){this.filename??=t,this.paths??=a._nodeModulePaths(s.dirname(t));const e=t.includes(".")?"."+t.split(".").slice(-1)[0]:"";a._extensions[e](this,t),this.loaded=!0},a.prototype.require=function(t){return o(t,this,!1)},Object.assign(a._extensions,{".js":function(e,n){function o(t){return e.require(t)}o.main=r.mainModule,o.extensions=a._extensions,o.cache=a._cache;const h=t[n],l=i;i=s.dirname(n),h(o,e.exports,e),i=l}});const h=()=>o(e,new a(e),!0);return h()})({"estree-toolbox/index.js"(t,e,i){const s=t("./lib/node-visitor.js"),r=t("./lib/node-transformer.js"),n=t("./lib/code-generator.js"),{Unparser:o,unparse:a}=t("./lib/unparser.js");i.exports={NodeVisitor:s,NodeTransformer:r,BaseCodeGenerator:n,Unparser:o,unparse:a}},"estree-toolbox/lib/code-generator.js"(t,e,i){const s=t("./node-visitor.js");i.exports=class extends s{constructor(t){super(),this._source=[],this._indent=0,this.indentLevel=t?.indent??2}items_view(t,e,i=", "){if(!Array.isArray(e))throw new TypeError(e+" is not a Array.");1===e.length?t.call(this,e[0]):e.forEach((s,r)=>{t.call(this,s),r!==e.length-1&&this.write(i)})}maybe_newline(t=!0){this._source.filter(t=>t.trim()).length&&(t&&this.write(";"),this.write("\n"))}fill(t=""){this.maybe_newline(),this.write(" ".repeat(this._indent*this.indentLevel)+t)}fillBlock(t=!0){t&&this.maybe_newline(!1),this.write(" ".repeat(this._indent*this.indentLevel))}inline(t){const e=this.maybe_newline,i=this.block;this.block=(...t)=>{const r=i.apply(this,t);return t=>{this.maybe_newline=e,this.block=i,r(t),this.maybe_newline=()=>{},this.block=s}};const s=this.block;this.maybe_newline=()=>{},t(),this.maybe_newline=e,this.block=i}write(...t){let e;if(e=t.find(t=>"string"!=typeof t))throw console.error(e),new TypeError(e+" is not a string.");this._source.push(...t)}buffered(t){return t??=[],e=>{const i=this._source;return this._source=t,e(t),this._source=i,t}}block({braces:t}={braces:!0}){return e=>{this.delimit_if("{","}",t)(()=>{const t=this.buffered()(()=>{this._indent++,this.write("\n"),e(),this._indent--});this.write(...t),this.fillBlock()})}}delimit(t,e){return i=>{this.write(t),i(),this.write(e)}}delimit_if(t,e,i){return i?this.delimit(t,e):t=>t()}traverse(t){if(Array.isArray(t))for(const e of t)this.traverse(e);else super.visit(t)}visit(t){return this._source=[],this.traverse(t),this._source.join("")}generic_visit(t){console.warn("Supplementary required "+t.type)}}},"estree-toolbox/lib/node-transformer.js"(t,e,i){const s=t("./node-visitor.js");i.exports=class extends s{generic_visit(t){for(const[e,i]of Object.entries(t))if(Array.isArray(i)){const t=[];for(let e of i){if(e.type){if(e=this.visit(e),!e)continue;if(!e?.type){t.push(...e);continue}}t.push(e)}i.splice(0,i.length,...t)}else if(i?.type){let s=this.visit(i);null==s?delete t[e]:t[e]=s}return t}}},"estree-toolbox/lib/node-visitor.js"(t,e,i){i.exports=class{visit(t){if(!t?.type)throw TypeError(`'${t}' is not a node.`);return(this["visit_"+t.type]??this.generic_visit).call(this,t)}generic_visit(t){for(const[e,i]of Object.entries(t))if(Array.isArray(i))for(const t of i)t?.type&&this.visit(t);else i?.type&&this.visit(i)}}},"estree-toolbox/lib/unparser.js"(t,e,i){const s=t("./code-generator.js");class r{constructor(...t){var e;1!==t.length||(!(e=t[0])||!["object","function"].includes(typeof e)||"number"!=typeof e.length||e.length<0||e.length%1)||(t=t[0]),((t,e,i)=>{for(let s=0;s<t.length;s++){const r=t[s];void 0!==i?e.call(i,r,s):e(r,s)}})(t,(t,e)=>{this[e]=t}),this.length=t.length}has(t){return Array.from(this).includes(t)}}const n=(()=>{let t=0;const e=e=>e?t:t++;return[["MemberExpression",e(!0)],["CallExpression",e(!0)],["NewExpression",e(!0)],["UpdateExpression",e()],["UnaryExpression",e()],[{type:"BinaryExpression",operator:"**"},e()],[{type:"BinaryExpression",operator:new r("*","/","%")},e()],[{type:"BinaryExpression",operator:new r("+","-")},e()],[{type:"BinaryExpression",operator:new r("<<",">>",">>>")},e()],[{type:"BinaryExpression",operator:new r(">","<",">=","<=","in","instanceof")},e()],[{type:"BinaryExpression",operator:new r("==","!=","===","!==")},e()],[{type:"BinaryExpression",operator:"&"},e()],[{type:"BinaryExpression",operator:"^"},e()],[{type:"BinaryExpression",operator:"|"},e()],[{type:"LogicalExpression",operator:"&&"},e()],[{type:"LogicalExpression",operator:"||"},e()],[{type:"CoalesceExpression",operator:"??"},e()],["ConditionalExpression",e()],["AssignmentExpression",e()],["SequenceExpression",e()]]})(),o=(t,e)=>{if("string"==typeof e)return t?.type===e;for(const[i,s]of Object.entries(e))if(s instanceof r){if(!s.has(t[i]))return!1}else if("object"==typeof s&&s){if(!o(t[i],s))return!1}else if(s!==t[i])return!1;return!0},a=(t,e)=>{const i=n.find(([e])=>o(t,e))?.[1],s=n.find(([t])=>o(e,t))?.[1];return i<s};class h extends s{blockNode(t){"BlockStatement"!==t.type?this.block({braces:!1})(()=>{this.traverse(t)}):this.traverse(t)}visit_Program(t){this.traverse(t.body)}visit_VariableDeclaration(t){this.fill(),this.write(t.kind),this.write(" ");for(const e of t.declarations)this.traverse(e)}visit_VariableDeclarator(t){this.traverse(t.id),t.init&&(this.write(" = "),this.traverse(t.init))}visit_Identifier(t){this.write(t.name)}visit_Literal(t){switch(typeof t.value){case"string":this.write(JSON.stringify(t.value));break;case"number":case"boolean":this.write(String(t.value));break;case"bigint":this.write(t.value+"n");break;case"object":t.value instanceof RegExp?this.write(String(t.value)):this.write("null")}}visit_CallExpression(t){this.traverse(t.callee),this.delimit("(",")")(()=>{this.items_view(this.traverse,t.arguments)})}visit_NewExpression(t){this.write("new "),this.traverse(t.callee),this.delimit("(",")")(()=>{this.items_view(this.traverse,t.arguments)})}visit_ArrayExpression(t){this.delimit("[","]")(()=>{this.items_view(this.traverse,t.elements)})}visit_ObjectExpression(t){this.delimit("{","}")(()=>{this.items_view(this.traverse,t.properties)})}visit_Property(t){this.traverse(t.key),this.write(": "),this.traverse(t.value)}visit_ArrowFunctionExpression(t){t.async&&this.write("async "),1===t.params.length&&"Identifier"===t.params[0].type?this.traverse(t.params[0]):this.delimit("(",")")(()=>{this.items_view(this.traverse,t.params)}),this.write(" => "),this.delimit_if("(",")","BlockStatement"!==t.body.type)(()=>{this.traverse(t.body)})}visit_BlockStatement(t){this.block()(()=>{this.traverse(t.body)})}visit_ExpressionStatement(t){this.fill(),this.traverse(t.expression)}visit_AssignmentExpression(t){this.visit_BinaryExpression(t)}visit_BinaryExpression(t){const{left:e,right:i}=t;this.delimit_if("(",")",a(t,e))(()=>{this.traverse(e)}),this.delimit(" "," ")(()=>{this.write(t.operator)}),this.delimit_if("(",")",a(t,i))(()=>{this.traverse(i)})}visit_LogicalExpression(t){this.visit_BinaryExpression(t)}visit_UnaryExpression(t){t.prefix&&(this.write(t.operator),/^\w+$/.test(t.operator)&&this.write(" ")),this.traverse(t.argument),t.prefix||this.write(t.operator)}visit_ConditionalExpression(t){this.delimit_if("(",")",a(t,t.test))(()=>{this.traverse(t.test)}),this.write(" ? "),this.traverse(t.consequent),this.write(" : "),this.delimit_if("(",")",a(t,t.alternate))(()=>{this.traverse(t.alternate)})}visit_MemberExpression(t){this.delimit_if("(",")",a(t,t.object))(()=>{this.traverse(t.object)}),t.optional&&this.write("?."),t.computed?this.delimit("[","]")(()=>{this.traverse(t.property)}):(this.write(t.optional?"?.":"."),this.traverse(t.property))}visit_IfStatement(t){this.fill(),this.write("if "),this.delimit("(",")")(()=>{this.traverse(t.test)}),this.write(" "),this.blockNode(t.consequent),t.alternate&&(this.write("else "),this.blockNode(t.alternate))}visit_SwitchStatement(t){this.fill(),this.write("switch "),this.delimit("(",")")(()=>{this.traverse(t.discriminant)}),this.block()(()=>{this.traverse(t.cases)})}visit_SwitchCase(t){this.fillBlock(),t.test?(this.write("case "),this.delimit("(",")")(()=>{this.traverse(t.test)})):this.write("default "),this.write(":"),this.blockNode(t.consequent)}visit_BreakStatement(t){this.fill(),this.write("break"),t.label&&(this.write(" "),this.traverse(t.label))}visit_ContinueStatement(t){this.fill(),this.write("continue"),t.label&&(this.write(" "),this.traverse(t.label))}visit_ForStatement(t){this.fill(),this.write("for "),this.delimit("(",")")(()=>{let e=this.buffered()(()=>{this.traverse(t.init),this.write(" ; "),this.traverse(t.test),this.write(" ; "),this.traverse(t.update)});this.write(...e)}),this.blockNode(t.body)}visit_UpdateExpression(t){t.prefix&&this.write(t.operator),this.delimit_if("(",")",a(t,t.argument))(()=>{this.traverse(t.argument)}),t.prefix||this.write(t.operator)}visit_ForInStatement(t){this.fill(),this.write("for "),this.delimit("(",")")(()=>{this.inline(()=>{this.traverse(t.left)}),this.write(" in "),this.traverse(t.right)}),this.blockNode(t.body)}visit_EmptyStatement(t){this.fill()}visit_ForOfStatement(t){this.fill(),this.write("for "),t.await&&this.write("await "),this.delimit("(",")")(()=>{this.inline(()=>{this.traverse(t.left)}),this.write(" of "),this.traverse(t.right)}),this.blockNode(t.body)}visit_WhileStatement(t){this.fill(),this.write("while "),this.delimit("(",")")(()=>{this.traverse(t.test)}),this.blockNode(t.body)}visit_DoWhileStatement(t){this.fill(),this.write("do "),this.blockNode(t.body),this.write(" while "),this.delimit("(",")")(()=>{this.traverse(t.test)})}visit_FunctionDeclaration(t){this.fill(),t.async&&this.write("async "),this.write("function"),t.generator&&this.write("*"),this.write(" "),t.id&&this.traverse(t.id),this.delimit("(",")")(()=>{this.items_view(this.traverse,t.params)}),this.write(" "),this.traverse(t.body)}visit_FunctionExpression(t){this.delimit("(",")")(()=>{t.async&&this.write("async "),this.write("function"),t.generator&&this.write("*"),this.write(" "),t.id&&this.traverse(t.id),this.delimit("(",")")(()=>{this.items_view(this.traverse,t.params)}),this.write(" "),this.traverse(t.body)})}visit_AssignmentPattern(t){this.traverse(t.left),this.write(" = "),this.traverse(t.right)}visit_ReturnStatement(t){this.fill("return"),t.argument&&(this.write(" "),this.traverse(t.argument)),this.write(";")}visit_RestElement(t){this.write("..."),this.traverse(t.argument)}visit_SpreadElement(t){this.write("..."),this.traverse(t.argument)}visit_ObjectPattern(t){this.delimit("{","}")(()=>{this.items_view(this.traverse,t.properties)})}visit_ArrayPattern(t){this.delimit("[","]")(()=>{this.items_view(this.traverse,t.elements)})}visit_YieldExpression(t){this.write("yield"),t.delegate&&this.write("*"),t.argument&&(this.write(" "),this.traverse(t.argument))}visit_ThisExpression(t){this.write("this")}visit_ClassDeclaration(t){this.fill("class "),t.id&&this.traverse(t.id),t.superClass&&(this.write(" extends "),this.traverse(t.superClass)),this.block()(()=>{this.traverse(t.body)})}visit_ClassBody(t){this.traverse(t.body)}visit_MethodDefinition(t){switch(this.fill(),t.kind){case"get":this.write("get ");break;case"set":this.write("set ")}const e=t.key;(t=>{t.async&&this.write("async "),t.generator&&this.write("*"),this.traverse(e),this.write(" "),this.delimit("(",")")(()=>{this.items_view(this.traverse,t.params)}),this.write(" "),this.traverse(t.body)})(t.value)}visit_TemplateLiteral(t){const e=[];for(let i=0;i<2*t.quasis.length-1;i++)i%2?e.push(t.expressions[i]):e.push(t.quasis[i]);for(;void 0===e.pop()&&e.length;);this.delimit("`","`")(()=>{for(const t of e)this.delimit_if("${","}","TemplateElement"!==t.type)(()=>{this.traverse(t)})})}visit_TemplateElement(t){this.write(t.value.raw)}visit_Super(t){this.write("super")}visit_ExportNamedDeclaration(t){this.fill("export "),this.delimit_if("{","}",t.specifiers.length)(()=>{this.items_view(this.traverse,t.specifiers)}),t.declaration&&this.inline(()=>{this.traverse(t.declaration)}),t.attributes.length&&(this.write(" with "),this.delimit("{","}")(()=>{this.items_view(this.traverse,t.attributes)}))}visit_ExportSpecifier(t){this.traverse(t.local),t.exported!==t.local&&(this.write(" as "),this.traverse(t.exported))}visit_ExportDefaultDeclaration(t){this.fill("export default "),this.inline(()=>{this.traverse(t.declaration)})}visit_ImportDeclaration(t){this.fill("import ");const e=t.specifiers.filter(t=>!["ImportDefaultSpecifier","ImportNamespaceSpecifier"].includes(t.type));e.length&&this.delimit("{","}")(()=>{this.items_view(this.traverse,e)});const i=t.specifiers.find(t=>"ImportDefaultSpecifier"===t.type);i&&(e.length&&this.write(","),this.traverse(i));const s=t.specifiers.find(t=>"ImportNamespaceSpecifier"===t.type);s&&(e.length&&this.write(","),this.traverse(s)),this.write(" from "),this.traverse(t.source),t.attributes.length&&(this.write(" with "),this.delimit("{","}")(()=>{this.items_view(this.traverse,t.attributes)}))}visit_ImportSpecifier(t){this.traverse(t.local),t.imported!==t.local&&(this.write(" as "),this.traverse(t.imported))}visit_ImportNamespaceSpecifier(t){this.write("* as "),this.traverse(t.local)}visit_ImportDefaultSpecifier(t){this.traverse(t.local)}visit_TryStatement(t){this.fill("try "),this.blockNode(t.block),t.handler&&this.traverse(t.handler),t.finalizer&&(this.write(" finally "),this.blockNode(t.finalizer))}visit_CatchClause(t){this.fill("catch "),this.delimit("(",")")(()=>{this.traverse(t.param)}),this.write(" "),this.blockNode(t.body)}visit_ThrowStatement(t){this.fill("throw "),this.traverse(t.argument)}visit_ChainExpression(t){this.traverse(t.expression)}visit_AwaitExpression(t){this.write("await "),this.traverse(t.argument)}visit_SequenceExpression(t){this.items_view(this.traverse,t.expressions)}}i.exports={Unparser:h,unparse:function(t,e){return new h(e).visit(t)}}}},"./index.js");export default module;export const{NodeVisitor:NodeVisitor,NodeTransformer:NodeTransformer,BaseCodeGenerator:BaseCodeGenerator,Unparser:Unparser,unparse:unparse}=module;
1
+ const module=((t,e)=>{let i="estree-toolbox";const s={dirname(t){return t===this.sep?t:t.split(this.sep).slice(0,-1).join(this.sep)},resolve(...t){if(!t.length)return this.sep;if(t[0][0]===this.sep)return t.join(this.sep);const e=[...i.split(this.sep),...t.join(this.sep).split(this.sep)],s=[];for(const t of e)".."!==t?"."!==t&&t&&s.push(t):s.pop();return s.join(this.sep)},join(...t){return t.join(this.sep)},sep:"/"},r={};function n(t,e,i){const s=t?.children;!s||i&&s.includes(e)||s.push(e)}function o(t,e,i){return a._load.call({__proto__:null,parentFilename:e?.filename,id:t},t,e,i)}function a(t="",e){this.id=t,this.path=s.dirname(t),this.exports={},n(e,this,!1),this.filename=null,this.loaded=!1,this.children=[]}a.Module=a,a._nodeModulePaths=function(t){const e=[];let i=s.resolve(t);for(;;){e.push(s.join(i,"node_modules"));const t=s.dirname(i);if(t===i)break;i=t}return e},a._cache=Object.create(null),a._extensions=Object.create(null),a._load=function(t,e,i){const o=s.resolve(t).split(s.sep),h=[];for(const t of o)".."!==t?"."!==t&&h.push(t):h.pop();const l=s.resolve(t),p=a._cache[l];if(void 0!==p){if(n(e,p,!0),p.loaded)return p.exports;if(!p[kIsCachedByESMLoader])return getExportsForCircularRequire(p);if(p[kModuleCircularVisited])return getExportsForCircularRequire(p);p[kModuleCircularVisited]=!0}const c=p||new a(l,e);return p||(i&&(r.mainModule=c,c.require.main=r.mainModule,c.id="."),a._cache[l]=c,c.load(l)),c.exports},a.prototype.load=function(t){this.filename??=t,this.paths??=a._nodeModulePaths(s.dirname(t));const e=t.includes(".")?"."+t.split(".").slice(-1)[0]:"";a._extensions[e](this,t),this.loaded=!0},a.prototype.require=function(t){return o(t,this,!1)},Object.assign(a._extensions,{".js":function(e,n){function o(t){return e.require(t)}o.main=r.mainModule,o.extensions=a._extensions,o.cache=a._cache;const h=t[n],l=i;i=s.dirname(n),h(o,e.exports,e),i=l}});const h=()=>o(e,new a(e),!0);return h()})({"estree-toolbox/index.js"(t,e,i){const s=t("./lib/node-visitor.js"),r=t("./lib/node-transformer.js"),n=t("./lib/code-generator.js"),{Unparser:o,unparse:a}=t("./lib/unparser.js");i.exports={NodeVisitor:s,NodeTransformer:r,BaseCodeGenerator:n,Unparser:o,unparse:a}},"estree-toolbox/lib/code-generator.js"(t,e,i){const s=t("./node-visitor.js");i.exports=class extends s{constructor(t){super(),this._source=[],this._indent=0,this.indentLevel=t?.indent??2}items_view(t,e,i=", "){if(!Array.isArray(e))throw new TypeError(e+" is not a Array.");1===e.length?t.call(this,e[0]):e.forEach((s,r)=>{t.call(this,s),r!==e.length-1&&this.write(i)})}maybe_newline(t=!0){this._source.filter(t=>t.trim()).length&&(t&&this.write(";"),this.write("\n"))}fill(t=""){this.maybe_newline(),this.write(" ".repeat(this._indent*this.indentLevel)+t)}fillBlock(t=!0){t&&this.maybe_newline(!1),this.write(" ".repeat(this._indent*this.indentLevel))}inline(t){const e=this.maybe_newline,i=this.block;this.block=(...t)=>{const r=i.apply(this,t);return t=>{this.maybe_newline=e,this.block=i,r(t),this.maybe_newline=()=>{},this.block=s}};const s=this.block;this.maybe_newline=()=>{},t(),this.maybe_newline=e,this.block=i}write(...t){let e;if(e=t.find(t=>"string"!=typeof t))throw console.error(e),new TypeError(e+" is not a string.");this._source.push(...t)}buffered(t){return t??=[],e=>{const i=this._source;return this._source=t,e(t),this._source=i,t}}block({braces:t}={braces:!0}){return e=>{this.delimit_if("{","}",t)(()=>{const t=this.buffered()(()=>{this._indent++,this.write("\n"),e(),this._indent--});this.write(...t),this.fillBlock()})}}delimit(t,e){return i=>{this.write(t),i(),this.write(e)}}delimit_if(t,e,i){return i?this.delimit(t,e):t=>t()}traverse(t){if(Array.isArray(t))for(const e of t)this.traverse(e);else super.visit(t)}visit(t){return this._source=[],this.traverse(t),this._source.join("")}generic_visit(t){console.warn("Supplementary required "+t.type)}}},"estree-toolbox/lib/node-transformer.js"(t,e,i){const s=t("./node-visitor.js");i.exports=class extends s{generic_visit(t){for(const[e,i]of Object.entries(t))if(Array.isArray(i)){const t=[];for(let e of i){if(e.type){if(e=this.visit(e),!e)continue;if(!e?.type){t.push(...e);continue}}t.push(e)}i.splice(0,i.length,...t)}else if(i?.type){let s=this.visit(i);null==s?delete t[e]:t[e]=s}return t}}},"estree-toolbox/lib/node-visitor.js"(t,e,i){i.exports=class{visit(t){if(!t?.type)throw TypeError(`'${t}' is not a node.`);return(this["visit_"+t.type]??this.generic_visit).call(this,t)}generic_visit(t){for(const[e,i]of Object.entries(t))if(Array.isArray(i))for(const t of i)t?.type&&this.visit(t);else i?.type&&this.visit(i)}}},"estree-toolbox/lib/unparser.js"(t,e,i){const s=t("./code-generator.js");class r{constructor(...t){var e;1!==t.length||(!(e=t[0])||!["object","function"].includes(typeof e)||"number"!=typeof e.length||e.length<0||e.length%1)||(t=t[0]),((t,e,i)=>{for(let s=0;s<t.length;s++){const r=t[s];void 0!==i?e.call(i,r,s):e(r,s)}})(t,(t,e)=>{this[e]=t}),this.length=t.length}has(t){return Array.from(this).includes(t)}}const n=(()=>{let t=0;const e=e=>e?t:t++;return[["MemberExpression",e(!0)],["CallExpression",e(!0)],["NewExpression",e(!0)],["UpdateExpression",e()],["UnaryExpression",e()],[{type:"BinaryExpression",operator:"**"},e()],[{type:"BinaryExpression",operator:new r("*","/","%")},e()],[{type:"BinaryExpression",operator:new r("+","-")},e()],[{type:"BinaryExpression",operator:new r("<<",">>",">>>")},e()],[{type:"BinaryExpression",operator:new r(">","<",">=","<=","in","instanceof")},e()],[{type:"BinaryExpression",operator:new r("==","!=","===","!==")},e()],[{type:"BinaryExpression",operator:"&"},e()],[{type:"BinaryExpression",operator:"^"},e()],[{type:"BinaryExpression",operator:"|"},e()],[{type:"LogicalExpression",operator:"&&"},e()],[{type:"LogicalExpression",operator:"||"},e()],[{type:"CoalesceExpression",operator:"??"},e()],["ConditionalExpression",e()],["AssignmentExpression",e()],["SequenceExpression",e()]]})(),o=(t,e)=>{if("string"==typeof e)return t?.type===e;for(const[i,s]of Object.entries(e))if(s instanceof r){if(!s.has(t[i]))return!1}else if("object"==typeof s&&s){if(!o(t[i],s))return!1}else if(s!==t[i])return!1;return!0},a=(t,e)=>{const i=n.find(([e])=>o(t,e))?.[1],s=n.find(([t])=>o(e,t))?.[1];return i<s};class h extends s{blockNode(t){"BlockStatement"!==t.type?this.block({braces:!1})(()=>{this.traverse(t)}):this.traverse(t)}visit_Program(t){this.traverse(t.body)}visit_VariableDeclaration(t){this.fill(),this.write(t.kind),this.write(" ");for(const e of t.declarations)this.traverse(e)}visit_VariableDeclarator(t){this.traverse(t.id),t.init&&(this.write(" = "),this.traverse(t.init))}visit_Identifier(t){this.write(t.name)}visit_Literal(t){switch(typeof t.value){case"string":this.write(JSON.stringify(t.value));break;case"number":case"boolean":this.write(String(t.value));break;case"bigint":this.write(t.value+"n");break;case"object":t.value instanceof RegExp?this.write(String(t.value)):this.write("null")}}visit_CallExpression(t){this.traverse(t.callee),this.delimit("(",")")(()=>{this.items_view(this.traverse,t.arguments)})}visit_NewExpression(t){this.write("new "),this.traverse(t.callee),this.delimit("(",")")(()=>{this.items_view(this.traverse,t.arguments)})}visit_ArrayExpression(t){this.delimit("[","]")(()=>{this.items_view(this.traverse,t.elements)})}visit_ObjectExpression(t){this.delimit("{","}")(()=>{this.items_view(this.traverse,t.properties)})}visit_Property(t){this.traverse(t.key),this.write(": "),this.traverse(t.value)}visit_ArrowFunctionExpression(t){t.async&&this.write("async "),1===t.params.length&&"Identifier"===t.params[0].type?this.traverse(t.params[0]):this.delimit("(",")")(()=>{this.items_view(this.traverse,t.params)}),this.write(" => "),this.delimit_if("(",")","BlockStatement"!==t.body.type)(()=>{this.traverse(t.body)})}visit_BlockStatement(t){this.block()(()=>{this.traverse(t.body)})}visit_ExpressionStatement(t){this.fill(),this.traverse(t.expression)}visit_AssignmentExpression(t){this.visit_BinaryExpression(t)}visit_BinaryExpression(t){const{left:e,right:i}=t;this.delimit_if("(",")",a(t,e))(()=>{this.traverse(e)}),this.delimit(" "," ")(()=>{this.write(t.operator)}),this.delimit_if("(",")",a(t,i))(()=>{this.traverse(i)})}visit_LogicalExpression(t){this.visit_BinaryExpression(t)}visit_UnaryExpression(t){t.prefix&&(this.write(t.operator),/^\w+$/.test(t.operator)&&this.write(" ")),this.traverse(t.argument),t.prefix||this.write(t.operator)}visit_ConditionalExpression(t){this.delimit_if("(",")",a(t,t.test))(()=>{this.traverse(t.test)}),this.write(" ? "),this.traverse(t.consequent),this.write(" : "),this.delimit_if("(",")",a(t,t.alternate))(()=>{this.traverse(t.alternate)})}visit_MemberExpression(t){this.delimit_if("(",")",a(t,t.object))(()=>{this.traverse(t.object)}),t.optional&&this.write("?."),t.computed?this.delimit("[","]")(()=>{this.traverse(t.property)}):(this.write(t.optional?"?.":"."),this.traverse(t.property))}visit_IfStatement(t){this.fill(),this.write("if "),this.delimit("(",")")(()=>{this.traverse(t.test)}),this.write(" "),this.blockNode(t.consequent),t.alternate&&(this.write("else "),this.blockNode(t.alternate))}visit_SwitchStatement(t){this.fill(),this.write("switch "),this.delimit("(",")")(()=>{this.traverse(t.discriminant)}),this.block()(()=>{this.traverse(t.cases)})}visit_SwitchCase(t){this.fillBlock(),t.test?(this.write("case "),this.delimit("(",")")(()=>{this.traverse(t.test)})):this.write("default "),this.write(":"),this.blockNode(t.consequent)}visit_BreakStatement(t){this.fill(),this.write("break"),t.label&&(this.write(" "),this.traverse(t.label))}visit_ContinueStatement(t){this.fill(),this.write("continue"),t.label&&(this.write(" "),this.traverse(t.label))}visit_ForStatement(t){this.fill(),this.write("for "),this.delimit("(",")")(()=>{let e=this.buffered()(()=>{this.traverse(t.init),this.write(" ; "),this.traverse(t.test),this.write(" ; "),this.traverse(t.update)});this.write(...e)}),this.blockNode(t.body)}visit_UpdateExpression(t){t.prefix&&this.write(t.operator),this.delimit_if("(",")",a(t,t.argument))(()=>{this.traverse(t.argument)}),t.prefix||this.write(t.operator)}visit_ForInStatement(t){this.fill(),this.write("for "),this.delimit("(",")")(()=>{this.inline(()=>{this.traverse(t.left)}),this.write(" in "),this.traverse(t.right)}),this.blockNode(t.body)}visit_EmptyStatement(t){this.fill()}visit_ForOfStatement(t){this.fill(),this.write("for "),t.await&&this.write("await "),this.delimit("(",")")(()=>{this.inline(()=>{this.traverse(t.left)}),this.write(" of "),this.traverse(t.right)}),this.blockNode(t.body)}visit_WhileStatement(t){this.fill(),this.write("while "),this.delimit("(",")")(()=>{this.traverse(t.test)}),this.blockNode(t.body)}visit_DoWhileStatement(t){this.fill(),this.write("do "),this.blockNode(t.body),this.write(" while "),this.delimit("(",")")(()=>{this.traverse(t.test)})}visit_FunctionDeclaration(t){this.fill(),t.async&&this.write("async "),this.write("function"),t.generator&&this.write("*"),this.write(" "),t.id&&this.traverse(t.id),this.delimit("(",")")(()=>{this.items_view(this.traverse,t.params)}),this.write(" "),this.traverse(t.body)}visit_FunctionExpression(t){this.delimit("(",")")(()=>{t.async&&this.write("async "),this.write("function"),t.generator&&this.write("*"),this.write(" "),t.id&&this.traverse(t.id),this.delimit("(",")")(()=>{this.items_view(this.traverse,t.params)}),this.write(" "),this.traverse(t.body)})}visit_AssignmentPattern(t){this.traverse(t.left),this.write(" = "),this.traverse(t.right)}visit_ReturnStatement(t){this.fill("return"),t.argument&&(this.write(" "),this.traverse(t.argument)),this.write(";")}visit_RestElement(t){this.write("..."),this.traverse(t.argument)}visit_SpreadElement(t){this.write("..."),this.traverse(t.argument)}visit_ObjectPattern(t){this.delimit("{","}")(()=>{this.items_view(this.traverse,t.properties)})}visit_ArrayPattern(t){this.delimit("[","]")(()=>{this.items_view(this.traverse,t.elements)})}visit_YieldExpression(t){this.write("yield"),t.delegate&&this.write("*"),t.argument&&(this.write(" "),this.traverse(t.argument))}visit_ThisExpression(t){this.write("this")}visit_ClassDeclaration(t){this.fill("class "),t.id&&this.traverse(t.id),t.superClass&&(this.write(" extends "),this.traverse(t.superClass)),this.block()(()=>{this.traverse(t.body)})}visit_ClassExpression(t){this.write("class "),t.id&&this.traverse(t.id),t.superClass&&(this.write(" extends "),this.traverse(t.superClass)),t.body.body.length?this.block()(()=>{this.traverse(t.body)}):this.write("{}")}visit_ClassBody(t){this.traverse(t.body)}visit_PropertyDefinition(t){this.fill(),t.static&&this.write("static "),this.delimit_if("[","]",t.computed)(()=>{this.traverse(t.key)}),this.write(" = "),this.traverse(t.value)}visit_MethodDefinition(t){switch(this.fill(),t.kind){case"get":this.write("get ");break;case"set":this.write("set ")}const e=t.key;t.static&&this.write("static "),(t=>{t.async&&this.write("async "),t.generator&&this.write("*"),this.traverse(e),this.write(" "),this.delimit("(",")")(()=>{this.items_view(this.traverse,t.params)}),this.write(" "),this.traverse(t.body)})(t.value)}visit_TemplateLiteral(t){const e=[];for(let i=0;i<2*t.quasis.length-1;i++)i%2?e.push(t.expressions[i]):e.push(t.quasis[i]);for(;void 0===e.pop()&&e.length;);this.delimit("`","`")(()=>{for(const t of e)this.delimit_if("${","}","TemplateElement"!==t.type)(()=>{this.traverse(t)})})}visit_TemplateElement(t){this.write(t.value.raw)}visit_Super(t){this.write("super")}visit_ExportNamedDeclaration(t){this.fill("export "),this.delimit_if("{","}",t.specifiers.length)(()=>{this.items_view(this.traverse,t.specifiers)}),t.declaration&&this.inline(()=>{this.traverse(t.declaration)}),t.attributes.length&&(this.write(" with "),this.delimit("{","}")(()=>{this.items_view(this.traverse,t.attributes)}))}visit_ExportSpecifier(t){this.traverse(t.local),t.exported!==t.local&&(this.write(" as "),this.traverse(t.exported))}visit_ExportDefaultDeclaration(t){this.fill("export default "),this.inline(()=>{this.traverse(t.declaration)})}visit_ImportDeclaration(t){this.fill("import ");const e=t.specifiers.filter(t=>!["ImportDefaultSpecifier","ImportNamespaceSpecifier"].includes(t.type));e.length&&this.delimit("{","}")(()=>{this.items_view(this.traverse,e)});const i=t.specifiers.find(t=>"ImportDefaultSpecifier"===t.type);i&&(e.length&&this.write(","),this.traverse(i));const s=t.specifiers.find(t=>"ImportNamespaceSpecifier"===t.type);s&&(e.length&&this.write(","),this.traverse(s)),this.write(" from "),this.traverse(t.source),t.attributes.length&&(this.write(" with "),this.delimit("{","}")(()=>{this.items_view(this.traverse,t.attributes)}))}visit_ImportSpecifier(t){this.traverse(t.local),t.imported!==t.local&&(this.write(" as "),this.traverse(t.imported))}visit_ImportNamespaceSpecifier(t){this.write("* as "),this.traverse(t.local)}visit_ImportDefaultSpecifier(t){this.traverse(t.local)}visit_TryStatement(t){this.fill("try "),this.blockNode(t.block),t.handler&&this.traverse(t.handler),t.finalizer&&(this.write(" finally "),this.blockNode(t.finalizer))}visit_CatchClause(t){this.fill("catch "),this.delimit("(",")")(()=>{this.traverse(t.param)}),this.write(" "),this.blockNode(t.body)}visit_ThrowStatement(t){this.fill("throw "),this.traverse(t.argument)}visit_ChainExpression(t){this.traverse(t.expression)}visit_AwaitExpression(t){this.write("await "),this.traverse(t.argument)}visit_SequenceExpression(t){this.items_view(this.traverse,t.expressions)}}i.exports={Unparser:h,unparse:function(t,e){return new h(e).visit(t)}}}},"./index.js");export default module;export const{NodeVisitor:NodeVisitor,NodeTransformer:NodeTransformer,BaseCodeGenerator:BaseCodeGenerator,Unparser:Unparser,unparse:unparse}=module;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "estree-toolbox",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "A comprehensive toolbox for working with ESTree ASTs: visitors, transformers, and code generators, unparesrs",
5
5
  "main": "./dist/estree-toolbox.js",
6
6
  "module": "./dist/estree-toolbox.mjs",
@@ -37,4 +37,4 @@
37
37
  ],
38
38
  "author": "stevena_star",
39
39
  "license": "MIT"
40
- }
40
+ }