Sha256: 77ceefb3a9c882d7122fd75251714549307cc9d0d278316527b75c3760782f73

Contents?: true

Size: 1.45 KB

Versions: 161

Compression:

Stored size: 1.45 KB

Contents

{"version":3,"names":["_index","require","isScope","node","parent","isBlockStatement","isFunction","isCatchClause","isPattern","isScopable"],"sources":["../../src/validators/isScope.ts"],"sourcesContent":["import {\n  isFunction,\n  isCatchClause,\n  isBlockStatement,\n  isScopable,\n  isPattern,\n} from \"./generated/index.ts\";\nimport type * as t from \"../index.ts\";\n\n/**\n * Check if the input `node` is a scope.\n */\nexport default function isScope(node: t.Node, parent: t.Node): boolean {\n  // If a BlockStatement is an immediate descendent of a Function/CatchClause, it must be in the body.\n  // Hence we skipped the parentKey === \"params\" check\n  if (isBlockStatement(node) && (isFunction(parent) || isCatchClause(parent))) {\n    return false;\n  }\n\n  // If a Pattern is an immediate descendent of a Function/CatchClause, it must be in the params.\n  // Hence we skipped the parentKey === \"params\" check\n  if (isPattern(node) && (isFunction(parent) || isCatchClause(parent))) {\n    return true;\n  }\n\n  return isScopable(node);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAYe,SAASC,OAAOA,CAACC,IAAY,EAAEC,MAAc,EAAW;EAGrE,IAAI,IAAAC,uBAAgB,EAACF,IAAI,CAAC,KAAK,IAAAG,iBAAU,EAACF,MAAM,CAAC,IAAI,IAAAG,oBAAa,EAACH,MAAM,CAAC,CAAC,EAAE;IAC3E,OAAO,KAAK;EACd;EAIA,IAAI,IAAAI,gBAAS,EAACL,IAAI,CAAC,KAAK,IAAAG,iBAAU,EAACF,MAAM,CAAC,IAAI,IAAAG,oBAAa,EAACH,MAAM,CAAC,CAAC,EAAE;IACpE,OAAO,IAAI;EACb;EAEA,OAAO,IAAAK,iBAAU,EAACN,IAAI,CAAC;AACzB","ignoreList":[]}

Version data entries

161 entries across 15 versions & 2 rubygems

Version Path
immosquare-cleaner-0.1.51 node_modules/@babel/helper-split-export-declaration/node_modules/@babel/types/lib/validators/isScope.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/plugin-transform-computed-properties/node_modules/@babel/template/node_modules/@babel/types/lib/validators/isScope.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-module-imports/node_modules/@babel/types/lib/validators/isScope.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-skip-transparent-expression-wrappers/node_modules/@babel/types/lib/validators/isScope.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/node_modules/@babel/traverse/node_modules/@babel/types/lib/validators/isScope.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/plugin-transform-classes/node_modules/@babel/traverse/node_modules/@babel/types/lib/validators/isScope.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-environment-visitor/node_modules/@babel/types/lib/validators/isScope.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-member-expression-to-functions/node_modules/@babel/types/lib/validators/isScope.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-remap-async-to-generator/node_modules/@babel/traverse/node_modules/@babel/types/lib/validators/isScope.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-simple-access/node_modules/@babel/types/lib/validators/isScope.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-wrap-function/node_modules/@babel/types/lib/validators/isScope.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helpers/node_modules/@babel/types/lib/validators/isScope.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/plugin-transform-async-generator-functions/node_modules/@babel/traverse/node_modules/@babel/types/lib/validators/isScope.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-replace-supers/node_modules/@babel/helper-member-expression-to-functions/node_modules/@babel/types/lib/validators/isScope.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-annotate-as-pure/node_modules/@babel/types/lib/validators/isScope.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-builder-binary-assignment-operator-visitor/node_modules/@babel/types/lib/validators/isScope.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-function-name/node_modules/@babel/types/lib/validators/isScope.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-hoist-variables/node_modules/@babel/types/lib/validators/isScope.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/helper-optimise-call-expression/node_modules/@babel/types/lib/validators/isScope.js.map
immosquare-cleaner-0.1.51 node_modules/@babel/plugin-transform-function-name/node_modules/@babel/traverse/node_modules/@babel/types/lib/validators/isScope.js.map