{"version":3,"sources":["jsdelivr-header.js","/npm/@resugar/codemod-declarations-block-scope@1.0.3/src/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aACA,IAAI,gBAAmB,MAAQ,KAAK,iBAAoB,SAAU,GAC9D,OAAQ,GAAO,EAAI,WAAc,EAAM,CAAE,QAAW,EACxD,EACA,OAAO,eAAe,QAAS,aAAc,CAAE,OAAO,IACtD,MAAM,oCAAsC,gBAAgB,QAAQ,wCACpE,SAAS,YACL,MAAO,CACH,KAAM,4CACN,QAAS,CACL,mBAAA,CAAoB,EAAM,GACtB,MAAM,KAAE,GAAS,EACX,EAAW,GAAS,EAAM,MAAS,CAAC,EACpC,EAAS,EAAQ,QAAU,MAAU,GAC3C,GAAkB,QAAd,EAAK,KACL,OAEJ,IAAI,EAAO,oCAAoC,QAAQ,GAC1C,QAAT,GACa,UAAT,GAAqB,aAAa,EAAM,KACxC,EAAO,OAEX,EAAK,KAAO,GAGZ,EAAO,EAAM,0BAA2B,uDAEhD,GAGZ,CAKA,SAAS,aAAa,EAAM,GACxB,IAAI,aAAE,GAAiB,EACvB,MAA4B,mBAAjB,GACC,EAAa,IAGb,CAEhB,CAZA,QAAQ,QAAU","file":"/npm/@resugar/codemod-declarations-block-scope@1.0.3/src/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@resugar/codemod-declarations-block-scope@1.0.3/src/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n    return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst mostRestrictiveKindForDeclaration_1 = __importDefault(require(\"./mostRestrictiveKindForDeclaration\"));\nfunction default_1() {\n    return {\n        name: '@resugar/codemod-declarations-block-scope',\n        visitor: {\n            VariableDeclaration(path, state) {\n                const { node } = path;\n                const options = (state && state.opts) || {};\n                const onWarn = options.onWarn || (() => { });\n                if (node.kind !== 'var') {\n                    return;\n                }\n                let kind = mostRestrictiveKindForDeclaration_1.default(path);\n                if (kind !== 'var') {\n                    if (kind === 'const' && !constAllowed(path, options)) {\n                        kind = 'let';\n                    }\n                    node.kind = kind;\n                }\n                else {\n                    onWarn(node, 'unsupported-declaration', `'var' declaration cannot be converted to block scope`);\n                }\n            },\n        },\n    };\n}\nexports.default = default_1;\n/**\n * Delegates to user-supplied options to determine whether `let` is allowed.\n */\nfunction constAllowed(path, options) {\n    let { disableConst } = options;\n    if (typeof disableConst === 'function') {\n        return !disableConst(path);\n    }\n    else {\n        return !disableConst;\n    }\n}\n"]}