1 |
- {"version":3,"file":"estree-walker.umd.js","sources":["../src/estree-walker.js"],"sourcesContent":["export function walk ( ast, { enter, leave }) {\n\tvisit( ast, null, enter, leave );\n}\n\nlet shouldSkip = false;\nconst context = { skip: () => shouldSkip = true };\n\nexport const childKeys = {};\n\nconst toString = Object.prototype.toString;\n\nfunction isArray ( thing ) {\n\treturn toString.call( thing ) === '[object Array]';\n}\n\nfunction visit ( node, parent, enter, leave, prop, index ) {\n\tif ( !node ) return;\n\n\tif ( enter ) {\n\t\tlet _shouldSkip = shouldSkip;\n\t\tshouldSkip = false;\n\t\tenter.call( context, node, parent, prop, index );\n\t\tconst skipped = shouldSkip;\n\t\tshouldSkip = _shouldSkip;\n\n\t\tif ( skipped ) return;\n\t}\n\n\tconst keys = childKeys[ node.type ] || (\n\t\tchildKeys[ node.type ] = Object.keys( node ).filter( key => typeof node[ key ] === 'object' )\n\t);\n\n\tfor ( let i = 0; i < keys.length; i += 1 ) {\n\t\tconst key = keys[i];\n\t\tconst value = node[ key ];\n\n\t\tif ( isArray( value ) ) {\n\t\t\tfor ( let j = 0; j < value.length; j += 1 ) {\n\t\t\t\tvisit( value[j], node, enter, leave, key, j );\n\t\t\t}\n\t\t}\n\n\t\telse if ( value && value.type ) {\n\t\t\tvisit( value, node, enter, leave, key, null );\n\t\t}\n\t}\n\n\tif ( leave ) {\n\t\tleave( node, parent, prop, index );\n\t}\n}\n"],"names":["let","const"],"mappings":";;;;;;AAAO,SAAS,IAAI,GAAG,GAAG,EAAE,GAAA,EAAkB;KAAhB,KAAK,aAAE;KAAA,KAAK;;CACzC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;CACjC;;AAEDA,IAAI,UAAU,GAAG,KAAK,CAAC;AACvBC,IAAM,OAAO,GAAG,EAAE,IAAI,EAAE,YAAG,SAAG,UAAU,GAAG,IAAI,GAAA,EAAE,CAAC;;AAElD,AAAOA,IAAM,SAAS,GAAG,EAAE,CAAC;;A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