@cdklabs/cdk-ssm-documents 0.0.70 → 0.0.71
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.
- package/.jsii +25 -25
- package/lib/construct/synth-utils.js +1 -1
- package/lib/document/automation-document.js +1 -1
- package/lib/document/command-document.js +1 -1
- package/lib/document/document-builder.js +2 -2
- package/lib/document/ssm-document.js +1 -1
- package/lib/domain/aws-service.js +1 -1
- package/lib/domain/choice.js +1 -1
- package/lib/domain/data-type.js +1 -1
- package/lib/domain/enum/install-action.js +2 -2
- package/lib/domain/enum/install-uninstall-repair.js +2 -2
- package/lib/domain/enum/installation-type.js +2 -2
- package/lib/domain/enum/package-name.js +2 -2
- package/lib/domain/input.js +1 -1
- package/lib/domain/operation.js +1 -1
- package/lib/domain/platform.js +1 -1
- package/lib/domain/precondition.js +1 -1
- package/lib/incident-response/incident-response.js +3 -3
- package/lib/interface/approve-hook.js +2 -2
- package/lib/interface/auth-method.js +3 -3
- package/lib/interface/aws-invoker.js +2 -2
- package/lib/interface/downloadable-content.js +8 -8
- package/lib/interface/environment.js +3 -3
- package/lib/interface/execute-automation-hook/api-execute-automation-hook.js +1 -1
- package/lib/interface/observer.js +1 -1
- package/lib/interface/on-failure.js +6 -6
- package/lib/interface/pause-hook.js +2 -2
- package/lib/interface/run-command-hook/api-run-command-hook.js +1 -1
- package/lib/interface/run-document-location.js +2 -2
- package/lib/interface/sleep-hook.js +2 -2
- package/lib/interface/step-ref.js +1 -1
- package/lib/interface/variables/boolean-variable.js +2 -2
- package/lib/interface/variables/map-list-variable.js +2 -2
- package/lib/interface/variables/number-variable.js +2 -2
- package/lib/interface/variables/secure-string-variable.js +4 -4
- package/lib/interface/variables/string-list-variable.js +2 -2
- package/lib/interface/variables/string-map-variable.js +2 -2
- package/lib/interface/variables/string-variable.js +4 -4
- package/lib/interface/variables/variable.js +2 -2
- package/lib/interface/webhook.js +1 -1
- package/lib/parent-steps/automation/approve-step.js +1 -1
- package/lib/parent-steps/automation/assert-aws-resource-step.js +1 -1
- package/lib/parent-steps/automation/aws-api-step.js +1 -1
- package/lib/parent-steps/automation/branch-step.js +1 -1
- package/lib/parent-steps/automation/change-instance-state-step.js +3 -3
- package/lib/parent-steps/automation/copy-image-step.js +1 -1
- package/lib/parent-steps/automation/create-image-step.js +1 -1
- package/lib/parent-steps/automation/create-stack-step.js +3 -3
- package/lib/parent-steps/automation/create-tags-step.js +3 -3
- package/lib/parent-steps/automation/delete-image-step.js +1 -1
- package/lib/parent-steps/automation/delete-stack-step.js +1 -1
- package/lib/parent-steps/automation/execute-automation-step.js +1 -1
- package/lib/parent-steps/automation/execute-script-step.js +5 -5
- package/lib/parent-steps/automation/execute-state-machine-step.js +1 -1
- package/lib/parent-steps/automation/invoke-lambda-function-step.js +1 -1
- package/lib/parent-steps/automation/invoke-webhook-step.js +1 -1
- package/lib/parent-steps/automation/pause-step.js +1 -1
- package/lib/parent-steps/automation/run-command-step.js +3 -3
- package/lib/parent-steps/automation/run-instance-step.js +1 -1
- package/lib/parent-steps/automation/sleep-step.js +1 -1
- package/lib/parent-steps/automation/update-variable.js +1 -1
- package/lib/parent-steps/automation/wait-for-resource-step.js +1 -1
- package/lib/parent-steps/automation-step.js +1 -1
- package/lib/parent-steps/command/applications-step.js +1 -1
- package/lib/parent-steps/command/configure-docker-step.js +1 -1
- package/lib/parent-steps/command/configure-package-step.js +1 -1
- package/lib/parent-steps/command/domain-join-step.js +1 -1
- package/lib/parent-steps/command/download-content-step.js +1 -1
- package/lib/parent-steps/command/ps-module-step.js +1 -1
- package/lib/parent-steps/command/run-docker-action-step.js +1 -1
- package/lib/parent-steps/command/run-document-step.js +1 -1
- package/lib/parent-steps/command/run-powershell-script-step.js +1 -1
- package/lib/parent-steps/command/run-shell-script-step.js +1 -1
- package/lib/parent-steps/command/software-inventory-step.js +1 -1
- package/lib/parent-steps/command/update-agent-step.js +1 -1
- package/lib/parent-steps/command/update-ssm-agent-step.js +1 -1
- package/lib/parent-steps/command-step.js +1 -1
- package/lib/parent-steps/step.js +1 -1
- package/lib/patterns/automation/composite-step.js +2 -2
- package/lib/patterns/automation/reboot-instance-and-wait.js +1 -1
- package/lib/patterns/automation/string-step.js +1 -1
- package/lib/patterns/document/string-document.js +1 -1
- package/lib/patterns/document/timed-document.js +1 -1
- package/lib/samples/hello-world.js +1 -1
- package/lib/simulation/automation/approve-simulation.js +1 -1
- package/lib/simulation/automation/assert-aws-resource-simulation.js +4 -5
- package/lib/simulation/automation/automation-simulation-base.js +1 -1
- package/lib/simulation/automation/aws-api-simulation.js +1 -1
- package/lib/simulation/automation/branch-simulation.js +1 -1
- package/lib/simulation/automation/change-instance-state-simulation.js +1 -1
- package/lib/simulation/automation/copy-image-simulation.js +1 -1
- package/lib/simulation/automation/create-image-simulation.js +1 -1
- package/lib/simulation/automation/create-stack-simulation.js +1 -1
- package/lib/simulation/automation/create-tags-simulation.js +1 -1
- package/lib/simulation/automation/delete-image-simulation.js +1 -1
- package/lib/simulation/automation/delete-stack-simulation.js +1 -1
- package/lib/simulation/automation/execute-script-simulation.js +1 -1
- package/lib/simulation/automation/execute-state-machine-simulation.js +1 -1
- package/lib/simulation/automation/invoke-lambda-function-simulation.js +1 -1
- package/lib/simulation/automation/invoke-webhook-simulation.js +1 -1
- package/lib/simulation/automation/pause-simulation.js +1 -1
- package/lib/simulation/automation/run-command-simulation.js +1 -1
- package/lib/simulation/automation/run-instance-simulation.js +1 -1
- package/lib/simulation/automation/sleep-simulation.js +1 -1
- package/lib/simulation/automation/update-variable-simulation.js +1 -1
- package/lib/simulation/automation/wait-for-resource-simulation.js +1 -1
- package/lib/simulation/automation-step-simulation.js +4 -5
- package/lib/simulation/command/command-simulation-base.js +1 -1
- package/lib/simulation/command/ps-module-simulation.js +1 -1
- package/lib/simulation/command/run-powershell-script-simulation.js +1 -1
- package/lib/simulation/command/run-shell-script-simulation.js +1 -1
- package/lib/simulation/command-step-simulation.js +1 -1
- package/lib/simulation/document/automation-simulation.js +1 -1
- package/lib/simulation/document/command-simulation.js +1 -1
- package/lib/simulation/simulation.js +1 -1
- package/node_modules/@jsep-plugin/assignment/LICENSE +20 -0
- package/node_modules/@jsep-plugin/assignment/README.md +37 -0
- package/node_modules/@jsep-plugin/assignment/dist/cjs/index.cjs.js +95 -0
- package/node_modules/@jsep-plugin/assignment/dist/cjs/index.cjs.js.map +1 -0
- package/node_modules/@jsep-plugin/assignment/dist/cjs/index.cjs.min.js +2 -0
- package/node_modules/@jsep-plugin/assignment/dist/cjs/index.cjs.min.js.map +1 -0
- package/node_modules/@jsep-plugin/assignment/dist/cjs/package.json +3 -0
- package/node_modules/@jsep-plugin/assignment/dist/iife/index.iife.js +98 -0
- package/node_modules/@jsep-plugin/assignment/dist/iife/index.iife.js.map +1 -0
- package/node_modules/@jsep-plugin/assignment/dist/iife/index.iife.min.js +2 -0
- package/node_modules/@jsep-plugin/assignment/dist/iife/index.iife.min.js.map +1 -0
- package/node_modules/@jsep-plugin/assignment/dist/index.js +92 -0
- package/node_modules/@jsep-plugin/assignment/dist/index.min.js +2 -0
- package/node_modules/@jsep-plugin/assignment/dist/index.min.js.map +1 -0
- package/node_modules/@jsep-plugin/assignment/package.json +39 -0
- package/node_modules/@jsep-plugin/assignment/types/tsd.d.ts +39 -0
- package/node_modules/@jsep-plugin/regex/LICENSE +20 -0
- package/node_modules/@jsep-plugin/regex/README.md +36 -0
- package/node_modules/@jsep-plugin/regex/dist/cjs/index.cjs.js +66 -0
- package/node_modules/@jsep-plugin/regex/dist/cjs/index.cjs.js.map +1 -0
- package/node_modules/@jsep-plugin/regex/dist/cjs/index.cjs.min.js +2 -0
- package/node_modules/@jsep-plugin/regex/dist/cjs/index.cjs.min.js.map +1 -0
- package/node_modules/@jsep-plugin/regex/dist/cjs/package.json +3 -0
- package/node_modules/@jsep-plugin/regex/dist/iife/index.iife.js +69 -0
- package/node_modules/@jsep-plugin/regex/dist/iife/index.iife.js.map +1 -0
- package/node_modules/@jsep-plugin/regex/dist/iife/index.iife.min.js +2 -0
- package/node_modules/@jsep-plugin/regex/dist/iife/index.iife.min.js.map +1 -0
- package/node_modules/@jsep-plugin/regex/dist/index.js +63 -0
- package/node_modules/@jsep-plugin/regex/dist/index.min.js +2 -0
- package/node_modules/@jsep-plugin/regex/dist/index.min.js.map +1 -0
- package/node_modules/@jsep-plugin/regex/package.json +39 -0
- package/node_modules/@jsep-plugin/regex/types/tsd.d.ts +7 -0
- package/node_modules/jsep/LICENSE +20 -0
- package/node_modules/jsep/README.md +208 -0
- package/node_modules/jsep/dist/cjs/jsep.cjs.js +1129 -0
- package/node_modules/jsep/dist/cjs/jsep.cjs.js.map +1 -0
- package/node_modules/jsep/dist/cjs/jsep.cjs.min.js +2 -0
- package/node_modules/jsep/dist/cjs/jsep.cjs.min.js.map +1 -0
- package/node_modules/jsep/dist/cjs/package.json +3 -0
- package/node_modules/jsep/dist/iife/jsep.iife.js +1132 -0
- package/node_modules/jsep/dist/iife/jsep.iife.js.map +1 -0
- package/node_modules/jsep/dist/iife/jsep.iife.min.js +2 -0
- package/node_modules/jsep/dist/iife/jsep.iife.min.js.map +1 -0
- package/node_modules/jsep/dist/jsep.js +1126 -0
- package/node_modules/jsep/dist/jsep.min.js +2 -0
- package/node_modules/jsep/dist/jsep.min.js.map +1 -0
- package/node_modules/jsep/package.json +153 -0
- package/node_modules/jsep/typings/tsd.d.ts +180 -0
- package/node_modules/jsonpath-plus/.claude/settings.local.json +9 -0
- package/node_modules/jsonpath-plus/CHANGES.md +453 -0
- package/node_modules/jsonpath-plus/LICENSE +22 -0
- package/node_modules/jsonpath-plus/README.md +412 -0
- package/node_modules/jsonpath-plus/SECURITY.md +38 -0
- package/node_modules/jsonpath-plus/bin/jsonpath-cli.js +36 -0
- package/node_modules/jsonpath-plus/dist/index-browser-esm.js +2164 -0
- package/node_modules/jsonpath-plus/dist/index-browser-esm.min.js +2 -0
- package/node_modules/jsonpath-plus/dist/index-browser-esm.min.js.map +1 -0
- package/node_modules/jsonpath-plus/dist/index-browser-umd.cjs +2172 -0
- package/node_modules/jsonpath-plus/dist/index-browser-umd.min.cjs +2 -0
- package/node_modules/jsonpath-plus/dist/index-browser-umd.min.cjs.map +1 -0
- package/node_modules/jsonpath-plus/dist/index-node-cjs.cjs +2076 -0
- package/node_modules/jsonpath-plus/dist/index-node-esm.js +2074 -0
- package/node_modules/jsonpath-plus/package.json +141 -0
- package/node_modules/jsonpath-plus/pnpm-workspace.yaml +2 -0
- package/node_modules/jsonpath-plus/src/Safe-Script.js +208 -0
- package/node_modules/jsonpath-plus/src/jsonpath-browser.js +102 -0
- package/node_modules/jsonpath-plus/src/jsonpath-node.js +8 -0
- package/node_modules/jsonpath-plus/src/jsonpath.d.ts +226 -0
- package/node_modules/jsonpath-plus/src/jsonpath.js +784 -0
- package/package.json +3 -3
- package/node_modules/escodegen/LICENSE.BSD +0 -21
- package/node_modules/escodegen/README.md +0 -84
- package/node_modules/escodegen/bin/escodegen.js +0 -77
- package/node_modules/escodegen/bin/esgenerate.js +0 -64
- package/node_modules/escodegen/escodegen.js +0 -2667
- package/node_modules/escodegen/package.json +0 -63
- package/node_modules/esprima/LICENSE.BSD +0 -21
- package/node_modules/esprima/README.md +0 -46
- package/node_modules/esprima/bin/esparse.js +0 -139
- package/node_modules/esprima/bin/esvalidate.js +0 -236
- package/node_modules/esprima/dist/esprima.js +0 -6709
- package/node_modules/esprima/package.json +0 -112
- package/node_modules/estraverse/.jshintrc +0 -16
- package/node_modules/estraverse/LICENSE.BSD +0 -19
- package/node_modules/estraverse/README.md +0 -153
- package/node_modules/estraverse/estraverse.js +0 -805
- package/node_modules/estraverse/gulpfile.js +0 -70
- package/node_modules/estraverse/package.json +0 -40
- package/node_modules/esutils/LICENSE.BSD +0 -19
- package/node_modules/esutils/README.md +0 -174
- package/node_modules/esutils/lib/ast.js +0 -144
- package/node_modules/esutils/lib/code.js +0 -135
- package/node_modules/esutils/lib/keyword.js +0 -165
- package/node_modules/esutils/lib/utils.js +0 -33
- package/node_modules/esutils/package.json +0 -44
- package/node_modules/jsonpath/.jscsrc +0 -60
- package/node_modules/jsonpath/.jshintrc +0 -9
- package/node_modules/jsonpath/.travis.yml +0 -3
- package/node_modules/jsonpath/Dockerfile +0 -1
- package/node_modules/jsonpath/Gruntfile.js +0 -83
- package/node_modules/jsonpath/LICENSE +0 -7
- package/node_modules/jsonpath/README.md +0 -216
- package/node_modules/jsonpath/bin/generate_parser.js +0 -8
- package/node_modules/jsonpath/fig.yml +0 -5
- package/node_modules/jsonpath/generated/parser.js +0 -721
- package/node_modules/jsonpath/include/action.js +0 -4
- package/node_modules/jsonpath/include/module.js +0 -34
- package/node_modules/jsonpath/index.js +0 -1
- package/node_modules/jsonpath/jsonpath.js +0 -7093
- package/node_modules/jsonpath/jsonpath.min.js +0 -4
- package/node_modules/jsonpath/lib/aesprim.js +0 -18
- package/node_modules/jsonpath/lib/dict.js +0 -6
- package/node_modules/jsonpath/lib/grammar.js +0 -106
- package/node_modules/jsonpath/lib/handlers.js +0 -409
- package/node_modules/jsonpath/lib/index.js +0 -304
- package/node_modules/jsonpath/lib/parser.js +0 -21
- package/node_modules/jsonpath/lib/slice.js +0 -41
- package/node_modules/jsonpath/node_modules/esprima/LICENSE.BSD +0 -19
- package/node_modules/jsonpath/node_modules/esprima/README.md +0 -24
- package/node_modules/jsonpath/node_modules/esprima/bin/esparse.js +0 -127
- package/node_modules/jsonpath/node_modules/esprima/bin/esvalidate.js +0 -199
- package/node_modules/jsonpath/node_modules/esprima/esprima.js +0 -3772
- package/node_modules/jsonpath/node_modules/esprima/package.json +0 -83
- package/node_modules/jsonpath/node_modules/esprima/test/compat.js +0 -241
- package/node_modules/jsonpath/node_modules/esprima/test/reflect.js +0 -422
- package/node_modules/jsonpath/node_modules/esprima/test/run.js +0 -67
- package/node_modules/jsonpath/node_modules/esprima/test/runner.js +0 -495
- package/node_modules/jsonpath/node_modules/esprima/test/test.js +0 -25593
- package/node_modules/jsonpath/package.json +0 -45
- package/node_modules/jsonpath/test/data/store.json +0 -31
- package/node_modules/jsonpath/test/lessons.js +0 -38
- package/node_modules/jsonpath/test/parse.js +0 -164
- package/node_modules/jsonpath/test/query.js +0 -359
- package/node_modules/jsonpath/test/security.js +0 -238
- package/node_modules/jsonpath/test/slice.js +0 -57
- package/node_modules/jsonpath/test/stringify.js +0 -54
- package/node_modules/jsonpath/test/sugar.js +0 -72
- package/node_modules/source-map/LICENSE +0 -28
- package/node_modules/source-map/README.md +0 -742
- package/node_modules/source-map/dist/source-map.debug.js +0 -3234
- package/node_modules/source-map/dist/source-map.js +0 -3233
- package/node_modules/source-map/dist/source-map.min.js +0 -2
- package/node_modules/source-map/dist/source-map.min.js.map +0 -1
- package/node_modules/source-map/lib/array-set.js +0 -121
- package/node_modules/source-map/lib/base64-vlq.js +0 -140
- package/node_modules/source-map/lib/base64.js +0 -67
- package/node_modules/source-map/lib/binary-search.js +0 -111
- package/node_modules/source-map/lib/mapping-list.js +0 -79
- package/node_modules/source-map/lib/quick-sort.js +0 -114
- package/node_modules/source-map/lib/source-map-consumer.js +0 -1145
- package/node_modules/source-map/lib/source-map-generator.js +0 -425
- package/node_modules/source-map/lib/source-node.js +0 -413
- package/node_modules/source-map/lib/util.js +0 -488
- package/node_modules/source-map/package.json +0 -73
- package/node_modules/source-map/source-map.d.ts +0 -98
- package/node_modules/source-map/source-map.js +0 -8
- package/node_modules/static-eval/.travis.yml +0 -18
- package/node_modules/static-eval/CHANGELOG.md +0 -21
- package/node_modules/static-eval/LICENSE +0 -20
- package/node_modules/static-eval/example/eval.js +0 -7
- package/node_modules/static-eval/example/vars.js +0 -11
- package/node_modules/static-eval/index.js +0 -209
- package/node_modules/static-eval/package.json +0 -54
- package/node_modules/static-eval/readme.markdown +0 -87
- package/node_modules/static-eval/security.md +0 -15
- package/node_modules/static-eval/test/eval.js +0 -177
- package/node_modules/static-eval/test/prop.js +0 -16
- package/node_modules/static-eval/test/template-strings.js +0 -33
- package/node_modules/underscore/LICENSE +0 -22
- package/node_modules/underscore/README.md +0 -34
- package/node_modules/underscore/amd/_baseCreate.js +0 -21
- package/node_modules/underscore/amd/_baseIteratee.js +0 -15
- package/node_modules/underscore/amd/_cb.js +0 -12
- package/node_modules/underscore/amd/_chainResult.js +0 -10
- package/node_modules/underscore/amd/_collectNonEnumProps.js +0 -42
- package/node_modules/underscore/amd/_createAssigner.js +0 -24
- package/node_modules/underscore/amd/_createEscaper.js +0 -21
- package/node_modules/underscore/amd/_createIndexFinder.js +0 -30
- package/node_modules/underscore/amd/_createPredicateIndexFinder.js +0 -18
- package/node_modules/underscore/amd/_createReduce.js +0 -30
- package/node_modules/underscore/amd/_createSizePropertyCheck.js +0 -13
- package/node_modules/underscore/amd/_deepGet.js +0 -15
- package/node_modules/underscore/amd/_escapeMap.js +0 -15
- package/node_modules/underscore/amd/_executeBound.js +0 -16
- package/node_modules/underscore/amd/_flatten.js +0 -32
- package/node_modules/underscore/amd/_getByteLength.js +0 -8
- package/node_modules/underscore/amd/_getLength.js +0 -8
- package/node_modules/underscore/amd/_group.js +0 -18
- package/node_modules/underscore/amd/_has.js +0 -10
- package/node_modules/underscore/amd/_hasObjectTag.js +0 -7
- package/node_modules/underscore/amd/_isArrayLike.js +0 -11
- package/node_modules/underscore/amd/_isBufferLike.js +0 -9
- package/node_modules/underscore/amd/_keyInObj.js +0 -11
- package/node_modules/underscore/amd/_methodFingerprint.js +0 -44
- package/node_modules/underscore/amd/_optimizeCb.js +0 -27
- package/node_modules/underscore/amd/_set.js +0 -21
- package/node_modules/underscore/amd/_setup.js +0 -70
- package/node_modules/underscore/amd/_shallowProperty.js +0 -12
- package/node_modules/underscore/amd/_stringTagBug.js +0 -16
- package/node_modules/underscore/amd/_tagTester.js +0 -13
- package/node_modules/underscore/amd/_toBufferView.js +0 -15
- package/node_modules/underscore/amd/_toPath.js +0 -11
- package/node_modules/underscore/amd/_unescapeMap.js +0 -8
- package/node_modules/underscore/amd/after.js +0 -14
- package/node_modules/underscore/amd/allKeys.js +0 -15
- package/node_modules/underscore/amd/before.js +0 -18
- package/node_modules/underscore/amd/bind.js +0 -15
- package/node_modules/underscore/amd/bindAll.js +0 -19
- package/node_modules/underscore/amd/chain.js +0 -12
- package/node_modules/underscore/amd/chunk.js +0 -17
- package/node_modules/underscore/amd/clone.js +0 -11
- package/node_modules/underscore/amd/compact.js +0 -10
- package/node_modules/underscore/amd/compose.js +0 -18
- package/node_modules/underscore/amd/constant.js +0 -12
- package/node_modules/underscore/amd/contains.js +0 -12
- package/node_modules/underscore/amd/countBy.js +0 -12
- package/node_modules/underscore/amd/create.js +0 -14
- package/node_modules/underscore/amd/debounce.js +0 -43
- package/node_modules/underscore/amd/defaults.js +0 -8
- package/node_modules/underscore/amd/defer.js +0 -9
- package/node_modules/underscore/amd/delay.js +0 -13
- package/node_modules/underscore/amd/difference.js +0 -14
- package/node_modules/underscore/amd/each.js +0 -25
- package/node_modules/underscore/amd/escape.js +0 -8
- package/node_modules/underscore/amd/every.js +0 -17
- package/node_modules/underscore/amd/extend.js +0 -8
- package/node_modules/underscore/amd/extendOwn.js +0 -10
- package/node_modules/underscore/amd/filter.js +0 -15
- package/node_modules/underscore/amd/find.js +0 -12
- package/node_modules/underscore/amd/findIndex.js +0 -8
- package/node_modules/underscore/amd/findKey.js +0 -15
- package/node_modules/underscore/amd/findLastIndex.js +0 -8
- package/node_modules/underscore/amd/findWhere.js +0 -11
- package/node_modules/underscore/amd/first.js +0 -13
- package/node_modules/underscore/amd/flatten.js +0 -11
- package/node_modules/underscore/amd/functions.js +0 -14
- package/node_modules/underscore/amd/get.js +0 -14
- package/node_modules/underscore/amd/groupBy.js +0 -11
- package/node_modules/underscore/amd/has.js +0 -19
- package/node_modules/underscore/amd/identity.js +0 -10
- package/node_modules/underscore/amd/index-default.js +0 -12
- package/node_modules/underscore/amd/index.js +0 -154
- package/node_modules/underscore/amd/indexBy.js +0 -11
- package/node_modules/underscore/amd/indexOf.js +0 -11
- package/node_modules/underscore/amd/initial.js +0 -12
- package/node_modules/underscore/amd/intersection.js +0 -22
- package/node_modules/underscore/amd/invert.js +0 -15
- package/node_modules/underscore/amd/invoke.js +0 -28
- package/node_modules/underscore/amd/isArguments.js +0 -19
- package/node_modules/underscore/amd/isArray.js +0 -9
- package/node_modules/underscore/amd/isArrayBuffer.js +0 -7
- package/node_modules/underscore/amd/isBoolean.js +0 -10
- package/node_modules/underscore/amd/isDataView.js +0 -15
- package/node_modules/underscore/amd/isDate.js +0 -7
- package/node_modules/underscore/amd/isElement.js +0 -10
- package/node_modules/underscore/amd/isEmpty.js +0 -18
- package/node_modules/underscore/amd/isEqual.js +0 -133
- package/node_modules/underscore/amd/isError.js +0 -7
- package/node_modules/underscore/amd/isFinite.js +0 -10
- package/node_modules/underscore/amd/isFunction.js +0 -18
- package/node_modules/underscore/amd/isMap.js +0 -7
- package/node_modules/underscore/amd/isMatch.js +0 -17
- package/node_modules/underscore/amd/isNaN.js +0 -10
- package/node_modules/underscore/amd/isNull.js +0 -10
- package/node_modules/underscore/amd/isNumber.js +0 -7
- package/node_modules/underscore/amd/isObject.js +0 -11
- package/node_modules/underscore/amd/isRegExp.js +0 -7
- package/node_modules/underscore/amd/isSet.js +0 -7
- package/node_modules/underscore/amd/isString.js +0 -7
- package/node_modules/underscore/amd/isSymbol.js +0 -7
- package/node_modules/underscore/amd/isTypedArray.js +0 -16
- package/node_modules/underscore/amd/isUndefined.js +0 -10
- package/node_modules/underscore/amd/isWeakMap.js +0 -7
- package/node_modules/underscore/amd/isWeakSet.js +0 -7
- package/node_modules/underscore/amd/iteratee.js +0 -13
- package/node_modules/underscore/amd/keys.js +0 -17
- package/node_modules/underscore/amd/last.js +0 -13
- package/node_modules/underscore/amd/lastIndexOf.js +0 -9
- package/node_modules/underscore/amd/map.js +0 -18
- package/node_modules/underscore/amd/mapObject.js +0 -19
- package/node_modules/underscore/amd/matcher.js +0 -14
- package/node_modules/underscore/amd/max.js +0 -30
- package/node_modules/underscore/amd/memoize.js +0 -17
- package/node_modules/underscore/amd/min.js +0 -30
- package/node_modules/underscore/amd/mixin.js +0 -18
- package/node_modules/underscore/amd/negate.js +0 -12
- package/node_modules/underscore/amd/noop.js +0 -8
- package/node_modules/underscore/amd/now.js +0 -10
- package/node_modules/underscore/amd/object.js +0 -20
- package/node_modules/underscore/amd/omit.js +0 -20
- package/node_modules/underscore/amd/once.js +0 -9
- package/node_modules/underscore/amd/pairs.js +0 -17
- package/node_modules/underscore/amd/partial.js +0 -25
- package/node_modules/underscore/amd/partition.js +0 -11
- package/node_modules/underscore/amd/pick.js +0 -25
- package/node_modules/underscore/amd/pluck.js +0 -10
- package/node_modules/underscore/amd/property.js +0 -14
- package/node_modules/underscore/amd/propertyOf.js +0 -13
- package/node_modules/underscore/amd/random.js +0 -14
- package/node_modules/underscore/amd/range.js +0 -27
- package/node_modules/underscore/amd/reduce.js +0 -9
- package/node_modules/underscore/amd/reduceRight.js +0 -8
- package/node_modules/underscore/amd/reject.js +0 -10
- package/node_modules/underscore/amd/rest.js +0 -12
- package/node_modules/underscore/amd/restArguments.js +0 -33
- package/node_modules/underscore/amd/result.js +0 -25
- package/node_modules/underscore/amd/sample.js +0 -27
- package/node_modules/underscore/amd/set.js +0 -15
- package/node_modules/underscore/amd/shuffle.js +0 -10
- package/node_modules/underscore/amd/size.js +0 -11
- package/node_modules/underscore/amd/some.js +0 -17
- package/node_modules/underscore/amd/sortBy.js +0 -26
- package/node_modules/underscore/amd/sortedIndex.js +0 -18
- package/node_modules/underscore/amd/tap.js +0 -13
- package/node_modules/underscore/amd/template.js +0 -103
- package/node_modules/underscore/amd/templateSettings.js +0 -13
- package/node_modules/underscore/amd/throttle.js +0 -51
- package/node_modules/underscore/amd/times.js +0 -13
- package/node_modules/underscore/amd/toArray.js +0 -18
- package/node_modules/underscore/amd/toPath.js +0 -12
- package/node_modules/underscore/amd/underscore-array-methods.js +0 -30
- package/node_modules/underscore/amd/underscore.js +0 -29
- package/node_modules/underscore/amd/unescape.js +0 -8
- package/node_modules/underscore/amd/union.js +0 -11
- package/node_modules/underscore/amd/uniq.js +0 -37
- package/node_modules/underscore/amd/uniqueId.js +0 -13
- package/node_modules/underscore/amd/unzip.js +0 -17
- package/node_modules/underscore/amd/values.js +0 -16
- package/node_modules/underscore/amd/where.js +0 -11
- package/node_modules/underscore/amd/without.js +0 -10
- package/node_modules/underscore/amd/wrap.js +0 -12
- package/node_modules/underscore/amd/zip.js +0 -9
- package/node_modules/underscore/cjs/_baseCreate.js +0 -20
- package/node_modules/underscore/cjs/_baseIteratee.js +0 -19
- package/node_modules/underscore/cjs/_cb.js +0 -12
- package/node_modules/underscore/cjs/_chainResult.js +0 -8
- package/node_modules/underscore/cjs/_collectNonEnumProps.js +0 -42
- package/node_modules/underscore/cjs/_createAssigner.js +0 -20
- package/node_modules/underscore/cjs/_createEscaper.js +0 -19
- package/node_modules/underscore/cjs/_createIndexFinder.js +0 -30
- package/node_modules/underscore/cjs/_createPredicateIndexFinder.js +0 -17
- package/node_modules/underscore/cjs/_createReduce.js +0 -30
- package/node_modules/underscore/cjs/_createSizePropertyCheck.js +0 -11
- package/node_modules/underscore/cjs/_deepGet.js +0 -11
- package/node_modules/underscore/cjs/_escapeMap.js +0 -11
- package/node_modules/underscore/cjs/_executeBound.js +0 -15
- package/node_modules/underscore/cjs/_flatten.js +0 -33
- package/node_modules/underscore/cjs/_getByteLength.js +0 -6
- package/node_modules/underscore/cjs/_getLength.js +0 -6
- package/node_modules/underscore/cjs/_group.js +0 -17
- package/node_modules/underscore/cjs/_has.js +0 -8
- package/node_modules/underscore/cjs/_hasObjectTag.js +0 -5
- package/node_modules/underscore/cjs/_isArrayLike.js +0 -10
- package/node_modules/underscore/cjs/_isBufferLike.js +0 -8
- package/node_modules/underscore/cjs/_keyInObj.js +0 -7
- package/node_modules/underscore/cjs/_methodFingerprint.js +0 -44
- package/node_modules/underscore/cjs/_optimizeCb.js +0 -23
- package/node_modules/underscore/cjs/_set.js +0 -21
- package/node_modules/underscore/cjs/_setup.js +0 -66
- package/node_modules/underscore/cjs/_shallowProperty.js +0 -8
- package/node_modules/underscore/cjs/_stringTagBug.js +0 -15
- package/node_modules/underscore/cjs/_tagTester.js +0 -11
- package/node_modules/underscore/cjs/_toBufferView.js +0 -13
- package/node_modules/underscore/cjs/_toPath.js +0 -10
- package/node_modules/underscore/cjs/_unescapeMap.js +0 -7
- package/node_modules/underscore/cjs/after.js +0 -10
- package/node_modules/underscore/cjs/allKeys.js +0 -15
- package/node_modules/underscore/cjs/before.js +0 -14
- package/node_modules/underscore/cjs/bind.js +0 -15
- package/node_modules/underscore/cjs/bindAll.js +0 -19
- package/node_modules/underscore/cjs/chain.js +0 -10
- package/node_modules/underscore/cjs/chunk.js +0 -15
- package/node_modules/underscore/cjs/clone.js +0 -11
- package/node_modules/underscore/cjs/compact.js +0 -8
- package/node_modules/underscore/cjs/compose.js +0 -14
- package/node_modules/underscore/cjs/constant.js +0 -8
- package/node_modules/underscore/cjs/contains.js +0 -12
- package/node_modules/underscore/cjs/countBy.js +0 -11
- package/node_modules/underscore/cjs/create.js +0 -13
- package/node_modules/underscore/cjs/debounce.js +0 -42
- package/node_modules/underscore/cjs/defaults.js +0 -7
- package/node_modules/underscore/cjs/defer.js +0 -9
- package/node_modules/underscore/cjs/delay.js +0 -11
- package/node_modules/underscore/cjs/difference.js +0 -15
- package/node_modules/underscore/cjs/each.js +0 -25
- package/node_modules/underscore/cjs/escape.js +0 -7
- package/node_modules/underscore/cjs/every.js +0 -17
- package/node_modules/underscore/cjs/extend.js +0 -7
- package/node_modules/underscore/cjs/extendOwn.js +0 -9
- package/node_modules/underscore/cjs/filter.js +0 -14
- package/node_modules/underscore/cjs/find.js +0 -12
- package/node_modules/underscore/cjs/findIndex.js +0 -6
- package/node_modules/underscore/cjs/findKey.js +0 -14
- package/node_modules/underscore/cjs/findLastIndex.js +0 -6
- package/node_modules/underscore/cjs/findWhere.js +0 -10
- package/node_modules/underscore/cjs/first.js +0 -11
- package/node_modules/underscore/cjs/flatten.js +0 -9
- package/node_modules/underscore/cjs/functions.js +0 -12
- package/node_modules/underscore/cjs/get.js +0 -14
- package/node_modules/underscore/cjs/groupBy.js +0 -10
- package/node_modules/underscore/cjs/has.js +0 -18
- package/node_modules/underscore/cjs/identity.js +0 -6
- package/node_modules/underscore/cjs/index-default.js +0 -11
- package/node_modules/underscore/cjs/index.js +0 -278
- package/node_modules/underscore/cjs/indexBy.js +0 -9
- package/node_modules/underscore/cjs/indexOf.js +0 -11
- package/node_modules/underscore/cjs/initial.js +0 -10
- package/node_modules/underscore/cjs/intersection.js +0 -21
- package/node_modules/underscore/cjs/invert.js +0 -13
- package/node_modules/underscore/cjs/invoke.js +0 -30
- package/node_modules/underscore/cjs/isArguments.js +0 -18
- package/node_modules/underscore/cjs/isArray.js +0 -8
- package/node_modules/underscore/cjs/isArrayBuffer.js +0 -5
- package/node_modules/underscore/cjs/isBoolean.js +0 -8
- package/node_modules/underscore/cjs/isDataView.js +0 -16
- package/node_modules/underscore/cjs/isDate.js +0 -5
- package/node_modules/underscore/cjs/isElement.js +0 -6
- package/node_modules/underscore/cjs/isEmpty.js +0 -20
- package/node_modules/underscore/cjs/isEqual.js +0 -140
- package/node_modules/underscore/cjs/isError.js +0 -5
- package/node_modules/underscore/cjs/isFinite.js +0 -9
- package/node_modules/underscore/cjs/isFunction.js +0 -17
- package/node_modules/underscore/cjs/isMap.js +0 -7
- package/node_modules/underscore/cjs/isMatch.js +0 -15
- package/node_modules/underscore/cjs/isNaN.js +0 -9
- package/node_modules/underscore/cjs/isNull.js +0 -6
- package/node_modules/underscore/cjs/isNumber.js +0 -5
- package/node_modules/underscore/cjs/isObject.js +0 -7
- package/node_modules/underscore/cjs/isRegExp.js +0 -5
- package/node_modules/underscore/cjs/isSet.js +0 -7
- package/node_modules/underscore/cjs/isString.js +0 -5
- package/node_modules/underscore/cjs/isSymbol.js +0 -5
- package/node_modules/underscore/cjs/isTypedArray.js +0 -17
- package/node_modules/underscore/cjs/isUndefined.js +0 -6
- package/node_modules/underscore/cjs/isWeakMap.js +0 -7
- package/node_modules/underscore/cjs/isWeakSet.js +0 -5
- package/node_modules/underscore/cjs/iteratee.js +0 -12
- package/node_modules/underscore/cjs/keys.js +0 -18
- package/node_modules/underscore/cjs/last.js +0 -11
- package/node_modules/underscore/cjs/lastIndexOf.js +0 -8
- package/node_modules/underscore/cjs/map.js +0 -18
- package/node_modules/underscore/cjs/mapObject.js +0 -18
- package/node_modules/underscore/cjs/matcher.js +0 -13
- package/node_modules/underscore/cjs/max.js +0 -31
- package/node_modules/underscore/cjs/memoize.js +0 -15
- package/node_modules/underscore/cjs/min.js +0 -31
- package/node_modules/underscore/cjs/mixin.js +0 -20
- package/node_modules/underscore/cjs/negate.js +0 -8
- package/node_modules/underscore/cjs/noop.js +0 -4
- package/node_modules/underscore/cjs/now.js +0 -6
- package/node_modules/underscore/cjs/object.js +0 -18
- package/node_modules/underscore/cjs/omit.js +0 -24
- package/node_modules/underscore/cjs/once.js +0 -8
- package/node_modules/underscore/cjs/pairs.js +0 -15
- package/node_modules/underscore/cjs/partial.js +0 -25
- package/node_modules/underscore/cjs/partition.js +0 -9
- package/node_modules/underscore/cjs/pick.js +0 -28
- package/node_modules/underscore/cjs/pluck.js +0 -9
- package/node_modules/underscore/cjs/property.js +0 -13
- package/node_modules/underscore/cjs/propertyOf.js +0 -12
- package/node_modules/underscore/cjs/random.js +0 -10
- package/node_modules/underscore/cjs/range.js +0 -23
- package/node_modules/underscore/cjs/reduce.js +0 -7
- package/node_modules/underscore/cjs/reduceRight.js +0 -6
- package/node_modules/underscore/cjs/reject.js +0 -10
- package/node_modules/underscore/cjs/rest.js +0 -10
- package/node_modules/underscore/cjs/restArguments.js +0 -29
- package/node_modules/underscore/cjs/result.js +0 -24
- package/node_modules/underscore/cjs/sample.js +0 -29
- package/node_modules/underscore/cjs/set.js +0 -15
- package/node_modules/underscore/cjs/shuffle.js +0 -8
- package/node_modules/underscore/cjs/size.js +0 -10
- package/node_modules/underscore/cjs/some.js +0 -17
- package/node_modules/underscore/cjs/sortBy.js +0 -26
- package/node_modules/underscore/cjs/sortedIndex.js +0 -17
- package/node_modules/underscore/cjs/tap.js +0 -9
- package/node_modules/underscore/cjs/template.js +0 -103
- package/node_modules/underscore/cjs/templateSettings.js +0 -11
- package/node_modules/underscore/cjs/throttle.js +0 -49
- package/node_modules/underscore/cjs/times.js +0 -11
- package/node_modules/underscore/cjs/toArray.js +0 -22
- package/node_modules/underscore/cjs/toPath.js +0 -11
- package/node_modules/underscore/cjs/underscore-array-methods.js +0 -31
- package/node_modules/underscore/cjs/underscore.js +0 -27
- package/node_modules/underscore/cjs/unescape.js +0 -7
- package/node_modules/underscore/cjs/union.js +0 -11
- package/node_modules/underscore/cjs/uniq.js +0 -38
- package/node_modules/underscore/cjs/uniqueId.js +0 -9
- package/node_modules/underscore/cjs/unzip.js +0 -17
- package/node_modules/underscore/cjs/values.js +0 -14
- package/node_modules/underscore/cjs/where.js +0 -10
- package/node_modules/underscore/cjs/without.js +0 -9
- package/node_modules/underscore/cjs/wrap.js +0 -10
- package/node_modules/underscore/cjs/zip.js +0 -8
- package/node_modules/underscore/modules/.eslintrc +0 -21
- package/node_modules/underscore/modules/_baseCreate.js +0 -18
- package/node_modules/underscore/modules/_baseIteratee.js +0 -17
- package/node_modules/underscore/modules/_cb.js +0 -10
- package/node_modules/underscore/modules/_chainResult.js +0 -6
- package/node_modules/underscore/modules/_collectNonEnumProps.js +0 -40
- package/node_modules/underscore/modules/_createAssigner.js +0 -18
- package/node_modules/underscore/modules/_createEscaper.js +0 -17
- package/node_modules/underscore/modules/_createIndexFinder.js +0 -28
- package/node_modules/underscore/modules/_createPredicateIndexFinder.js +0 -15
- package/node_modules/underscore/modules/_createReduce.js +0 -28
- package/node_modules/underscore/modules/_createSizePropertyCheck.js +0 -9
- package/node_modules/underscore/modules/_deepGet.js +0 -9
- package/node_modules/underscore/modules/_escapeMap.js +0 -9
- package/node_modules/underscore/modules/_executeBound.js +0 -13
- package/node_modules/underscore/modules/_flatten.js +0 -31
- package/node_modules/underscore/modules/_getByteLength.js +0 -4
- package/node_modules/underscore/modules/_getLength.js +0 -4
- package/node_modules/underscore/modules/_group.js +0 -15
- package/node_modules/underscore/modules/_has.js +0 -6
- package/node_modules/underscore/modules/_hasObjectTag.js +0 -3
- package/node_modules/underscore/modules/_isArrayLike.js +0 -8
- package/node_modules/underscore/modules/_isBufferLike.js +0 -6
- package/node_modules/underscore/modules/_keyInObj.js +0 -5
- package/node_modules/underscore/modules/_methodFingerprint.js +0 -37
- package/node_modules/underscore/modules/_optimizeCb.js +0 -21
- package/node_modules/underscore/modules/_setup.js +0 -43
- package/node_modules/underscore/modules/_shallowProperty.js +0 -6
- package/node_modules/underscore/modules/_stringTagBug.js +0 -10
- package/node_modules/underscore/modules/_tagTester.js +0 -9
- package/node_modules/underscore/modules/_toBufferView.js +0 -11
- package/node_modules/underscore/modules/_toPath.js +0 -8
- package/node_modules/underscore/modules/_unescapeMap.js +0 -5
- package/node_modules/underscore/modules/after.js +0 -8
- package/node_modules/underscore/modules/allKeys.js +0 -13
- package/node_modules/underscore/modules/before.js +0 -12
- package/node_modules/underscore/modules/bind.js +0 -13
- package/node_modules/underscore/modules/bindAll.js +0 -17
- package/node_modules/underscore/modules/chain.js +0 -8
- package/node_modules/underscore/modules/chunk.js +0 -13
- package/node_modules/underscore/modules/clone.js +0 -9
- package/node_modules/underscore/modules/compact.js +0 -6
- package/node_modules/underscore/modules/compose.js +0 -12
- package/node_modules/underscore/modules/constant.js +0 -6
- package/node_modules/underscore/modules/contains.js +0 -10
- package/node_modules/underscore/modules/countBy.js +0 -9
- package/node_modules/underscore/modules/create.js +0 -11
- package/node_modules/underscore/modules/debounce.js +0 -40
- package/node_modules/underscore/modules/defaults.js +0 -5
- package/node_modules/underscore/modules/defer.js +0 -7
- package/node_modules/underscore/modules/delay.js +0 -9
- package/node_modules/underscore/modules/difference.js +0 -13
- package/node_modules/underscore/modules/each.js +0 -23
- package/node_modules/underscore/modules/escape.js +0 -5
- package/node_modules/underscore/modules/every.js +0 -15
- package/node_modules/underscore/modules/extend.js +0 -5
- package/node_modules/underscore/modules/extendOwn.js +0 -7
- package/node_modules/underscore/modules/filter.js +0 -12
- package/node_modules/underscore/modules/find.js +0 -10
- package/node_modules/underscore/modules/findIndex.js +0 -4
- package/node_modules/underscore/modules/findKey.js +0 -12
- package/node_modules/underscore/modules/findLastIndex.js +0 -4
- package/node_modules/underscore/modules/findWhere.js +0 -8
- package/node_modules/underscore/modules/first.js +0 -9
- package/node_modules/underscore/modules/flatten.js +0 -7
- package/node_modules/underscore/modules/functions.js +0 -10
- package/node_modules/underscore/modules/get.js +0 -12
- package/node_modules/underscore/modules/groupBy.js +0 -8
- package/node_modules/underscore/modules/has.js +0 -16
- package/node_modules/underscore/modules/identity.js +0 -4
- package/node_modules/underscore/modules/index-all.js +0 -18
- package/node_modules/underscore/modules/index-default.js +0 -27
- package/node_modules/underscore/modules/index.js +0 -200
- package/node_modules/underscore/modules/indexBy.js +0 -7
- package/node_modules/underscore/modules/indexOf.js +0 -9
- package/node_modules/underscore/modules/initial.js +0 -8
- package/node_modules/underscore/modules/intersection.js +0 -19
- package/node_modules/underscore/modules/invert.js +0 -11
- package/node_modules/underscore/modules/invoke.js +0 -28
- package/node_modules/underscore/modules/isArguments.js +0 -16
- package/node_modules/underscore/modules/isArray.js +0 -6
- package/node_modules/underscore/modules/isArrayBuffer.js +0 -3
- package/node_modules/underscore/modules/isBoolean.js +0 -6
- package/node_modules/underscore/modules/isDataView.js +0 -14
- package/node_modules/underscore/modules/isDate.js +0 -3
- package/node_modules/underscore/modules/isElement.js +0 -4
- package/node_modules/underscore/modules/isEmpty.js +0 -18
- package/node_modules/underscore/modules/isEqual.js +0 -138
- package/node_modules/underscore/modules/isError.js +0 -3
- package/node_modules/underscore/modules/isFinite.js +0 -7
- package/node_modules/underscore/modules/isFunction.js +0 -15
- package/node_modules/underscore/modules/isMap.js +0 -5
- package/node_modules/underscore/modules/isMatch.js +0 -13
- package/node_modules/underscore/modules/isNaN.js +0 -7
- package/node_modules/underscore/modules/isNull.js +0 -4
- package/node_modules/underscore/modules/isNumber.js +0 -3
- package/node_modules/underscore/modules/isObject.js +0 -5
- package/node_modules/underscore/modules/isRegExp.js +0 -3
- package/node_modules/underscore/modules/isSet.js +0 -5
- package/node_modules/underscore/modules/isString.js +0 -3
- package/node_modules/underscore/modules/isSymbol.js +0 -3
- package/node_modules/underscore/modules/isTypedArray.js +0 -15
- package/node_modules/underscore/modules/isUndefined.js +0 -4
- package/node_modules/underscore/modules/isWeakMap.js +0 -5
- package/node_modules/underscore/modules/isWeakSet.js +0 -3
- package/node_modules/underscore/modules/iteratee.js +0 -10
- package/node_modules/underscore/modules/keys.js +0 -16
- package/node_modules/underscore/modules/last.js +0 -9
- package/node_modules/underscore/modules/lastIndexOf.js +0 -6
- package/node_modules/underscore/modules/map.js +0 -16
- package/node_modules/underscore/modules/mapObject.js +0 -16
- package/node_modules/underscore/modules/matcher.js +0 -11
- package/node_modules/underscore/modules/max.js +0 -29
- package/node_modules/underscore/modules/memoize.js +0 -13
- package/node_modules/underscore/modules/min.js +0 -29
- package/node_modules/underscore/modules/mixin.js +0 -18
- package/node_modules/underscore/modules/negate.js +0 -6
- package/node_modules/underscore/modules/noop.js +0 -2
- package/node_modules/underscore/modules/now.js +0 -4
- package/node_modules/underscore/modules/object.js +0 -16
- package/node_modules/underscore/modules/omit.js +0 -22
- package/node_modules/underscore/modules/once.js +0 -6
- package/node_modules/underscore/modules/package.json +0 -1
- package/node_modules/underscore/modules/pairs.js +0 -13
- package/node_modules/underscore/modules/partial.js +0 -24
- package/node_modules/underscore/modules/partition.js +0 -7
- package/node_modules/underscore/modules/pick.js +0 -26
- package/node_modules/underscore/modules/pluck.js +0 -7
- package/node_modules/underscore/modules/property.js +0 -11
- package/node_modules/underscore/modules/propertyOf.js +0 -10
- package/node_modules/underscore/modules/random.js +0 -8
- package/node_modules/underscore/modules/range.js +0 -21
- package/node_modules/underscore/modules/reduce.js +0 -5
- package/node_modules/underscore/modules/reduceRight.js +0 -4
- package/node_modules/underscore/modules/reject.js +0 -8
- package/node_modules/underscore/modules/rest.js +0 -8
- package/node_modules/underscore/modules/restArguments.js +0 -27
- package/node_modules/underscore/modules/result.js +0 -22
- package/node_modules/underscore/modules/sample.js +0 -27
- package/node_modules/underscore/modules/shuffle.js +0 -6
- package/node_modules/underscore/modules/size.js +0 -8
- package/node_modules/underscore/modules/some.js +0 -15
- package/node_modules/underscore/modules/sortBy.js +0 -24
- package/node_modules/underscore/modules/sortedIndex.js +0 -15
- package/node_modules/underscore/modules/tap.js +0 -7
- package/node_modules/underscore/modules/template.js +0 -101
- package/node_modules/underscore/modules/templateSettings.js +0 -9
- package/node_modules/underscore/modules/throttle.js +0 -47
- package/node_modules/underscore/modules/times.js +0 -9
- package/node_modules/underscore/modules/toArray.js +0 -20
- package/node_modules/underscore/modules/toPath.js +0 -9
- package/node_modules/underscore/modules/underscore-array-methods.js +0 -31
- package/node_modules/underscore/modules/underscore.js +0 -25
- package/node_modules/underscore/modules/unescape.js +0 -5
- package/node_modules/underscore/modules/union.js +0 -9
- package/node_modules/underscore/modules/uniq.js +0 -36
- package/node_modules/underscore/modules/uniqueId.js +0 -7
- package/node_modules/underscore/modules/unzip.js +0 -15
- package/node_modules/underscore/modules/values.js +0 -12
- package/node_modules/underscore/modules/where.js +0 -8
- package/node_modules/underscore/modules/without.js +0 -7
- package/node_modules/underscore/modules/wrap.js +0 -8
- package/node_modules/underscore/modules/zip.js +0 -6
- package/node_modules/underscore/package.json +0 -124
- package/node_modules/underscore/underscore-esm-min.js +0 -5
- package/node_modules/underscore/underscore-esm-min.js.map +0 -1
- package/node_modules/underscore/underscore-esm.js +0 -2034
- package/node_modules/underscore/underscore-esm.js.map +0 -1
- package/node_modules/underscore/underscore-min.js +0 -6
- package/node_modules/underscore/underscore-min.js.map +0 -1
- package/node_modules/underscore/underscore-node-f.cjs +0 -2158
- package/node_modules/underscore/underscore-node-f.cjs.map +0 -1
- package/node_modules/underscore/underscore-node.cjs +0 -11
- package/node_modules/underscore/underscore-node.cjs.map +0 -1
- package/node_modules/underscore/underscore-node.mjs +0 -7
- package/node_modules/underscore/underscore-node.mjs.map +0 -1
- package/node_modules/underscore/underscore-umd-min.js +0 -6
- package/node_modules/underscore/underscore-umd-min.js.map +0 -1
- package/node_modules/underscore/underscore-umd.js +0 -2042
- package/node_modules/underscore/underscore-umd.js.map +0 -1
- package/node_modules/underscore/underscore.js +0 -2042
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
var index = (function () {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const PLUS_CODE = 43; // +
|
|
5
|
+
const MINUS_CODE = 45; // -
|
|
6
|
+
|
|
7
|
+
const plugin = {
|
|
8
|
+
name: 'assignment',
|
|
9
|
+
|
|
10
|
+
assignmentOperators: new Set([
|
|
11
|
+
'=',
|
|
12
|
+
'*=',
|
|
13
|
+
'**=',
|
|
14
|
+
'/=',
|
|
15
|
+
'%=',
|
|
16
|
+
'+=',
|
|
17
|
+
'-=',
|
|
18
|
+
'<<=',
|
|
19
|
+
'>>=',
|
|
20
|
+
'>>>=',
|
|
21
|
+
'&=',
|
|
22
|
+
'^=',
|
|
23
|
+
'|=',
|
|
24
|
+
'||=',
|
|
25
|
+
'&&=',
|
|
26
|
+
'??=',
|
|
27
|
+
]),
|
|
28
|
+
updateOperators: [PLUS_CODE, MINUS_CODE],
|
|
29
|
+
assignmentPrecedence: 0.9,
|
|
30
|
+
|
|
31
|
+
init(jsep) {
|
|
32
|
+
const updateNodeTypes = [jsep.IDENTIFIER, jsep.MEMBER_EXP];
|
|
33
|
+
plugin.assignmentOperators.forEach(op => jsep.addBinaryOp(op, plugin.assignmentPrecedence, true));
|
|
34
|
+
|
|
35
|
+
jsep.hooks.add('gobble-token', function gobbleUpdatePrefix(env) {
|
|
36
|
+
const code = this.code;
|
|
37
|
+
if (plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) {
|
|
38
|
+
this.index += 2;
|
|
39
|
+
env.node = {
|
|
40
|
+
type: 'UpdateExpression',
|
|
41
|
+
operator: code === PLUS_CODE ? '++' : '--',
|
|
42
|
+
argument: this.gobbleTokenProperty(this.gobbleIdentifier()),
|
|
43
|
+
prefix: true,
|
|
44
|
+
};
|
|
45
|
+
if (!env.node.argument || !updateNodeTypes.includes(env.node.argument.type)) {
|
|
46
|
+
this.throwError(`Unexpected ${env.node.operator}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
jsep.hooks.add('after-token', function gobbleUpdatePostfix(env) {
|
|
52
|
+
if (env.node) {
|
|
53
|
+
const code = this.code;
|
|
54
|
+
if (plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) {
|
|
55
|
+
if (!updateNodeTypes.includes(env.node.type)) {
|
|
56
|
+
this.throwError(`Unexpected ${env.node.operator}`);
|
|
57
|
+
}
|
|
58
|
+
this.index += 2;
|
|
59
|
+
env.node = {
|
|
60
|
+
type: 'UpdateExpression',
|
|
61
|
+
operator: code === PLUS_CODE ? '++' : '--',
|
|
62
|
+
argument: env.node,
|
|
63
|
+
prefix: false,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
jsep.hooks.add('after-expression', function gobbleAssignment(env) {
|
|
70
|
+
if (env.node) {
|
|
71
|
+
// Note: Binaries can be chained in a single expression to respect
|
|
72
|
+
// operator precedence (i.e. a = b = 1 + 2 + 3)
|
|
73
|
+
// Update all binary assignment nodes in the tree
|
|
74
|
+
updateBinariesToAssignments(env.node);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
function updateBinariesToAssignments(node) {
|
|
79
|
+
if (plugin.assignmentOperators.has(node.operator)) {
|
|
80
|
+
node.type = 'AssignmentExpression';
|
|
81
|
+
updateBinariesToAssignments(node.left);
|
|
82
|
+
updateBinariesToAssignments(node.right);
|
|
83
|
+
}
|
|
84
|
+
else if (!node.operator) {
|
|
85
|
+
Object.values(node).forEach((val) => {
|
|
86
|
+
if (val && typeof val === 'object') {
|
|
87
|
+
updateBinariesToAssignments(val);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
return plugin;
|
|
96
|
+
|
|
97
|
+
}());
|
|
98
|
+
//# sourceMappingURL=index.iife.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.iife.js","sources":["../../src/index.js"],"sourcesContent":["const PLUS_CODE = 43; // +\nconst MINUS_CODE = 45; // -\n\nconst plugin = {\n\tname: 'assignment',\n\n\tassignmentOperators: new Set([\n\t\t'=',\n\t\t'*=',\n\t\t'**=',\n\t\t'/=',\n\t\t'%=',\n\t\t'+=',\n\t\t'-=',\n\t\t'<<=',\n\t\t'>>=',\n\t\t'>>>=',\n\t\t'&=',\n\t\t'^=',\n\t\t'|=',\n\t\t'||=',\n\t\t'&&=',\n\t\t'??=',\n\t]),\n\tupdateOperators: [PLUS_CODE, MINUS_CODE],\n\tassignmentPrecedence: 0.9,\n\n\tinit(jsep) {\n\t\tconst updateNodeTypes = [jsep.IDENTIFIER, jsep.MEMBER_EXP];\n\t\tplugin.assignmentOperators.forEach(op => jsep.addBinaryOp(op, plugin.assignmentPrecedence, true));\n\n\t\tjsep.hooks.add('gobble-token', function gobbleUpdatePrefix(env) {\n\t\t\tconst code = this.code;\n\t\t\tif (plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) {\n\t\t\t\tthis.index += 2;\n\t\t\t\tenv.node = {\n\t\t\t\t\ttype: 'UpdateExpression',\n\t\t\t\t\toperator: code === PLUS_CODE ? '++' : '--',\n\t\t\t\t\targument: this.gobbleTokenProperty(this.gobbleIdentifier()),\n\t\t\t\t\tprefix: true,\n\t\t\t\t};\n\t\t\t\tif (!env.node.argument || !updateNodeTypes.includes(env.node.argument.type)) {\n\t\t\t\t\tthis.throwError(`Unexpected ${env.node.operator}`);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tjsep.hooks.add('after-token', function gobbleUpdatePostfix(env) {\n\t\t\tif (env.node) {\n\t\t\t\tconst code = this.code;\n\t\t\t\tif (plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) {\n\t\t\t\t\tif (!updateNodeTypes.includes(env.node.type)) {\n\t\t\t\t\t\tthis.throwError(`Unexpected ${env.node.operator}`);\n\t\t\t\t\t}\n\t\t\t\t\tthis.index += 2;\n\t\t\t\t\tenv.node = {\n\t\t\t\t\t\ttype: 'UpdateExpression',\n\t\t\t\t\t\toperator: code === PLUS_CODE ? '++' : '--',\n\t\t\t\t\t\targument: env.node,\n\t\t\t\t\t\tprefix: false,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tjsep.hooks.add('after-expression', function gobbleAssignment(env) {\n\t\t\tif (env.node) {\n\t\t\t\t// Note: Binaries can be chained in a single expression to respect\n\t\t\t\t// operator precedence (i.e. a = b = 1 + 2 + 3)\n\t\t\t\t// Update all binary assignment nodes in the tree\n\t\t\t\tupdateBinariesToAssignments(env.node);\n\t\t\t}\n\t\t});\n\n\t\tfunction updateBinariesToAssignments(node) {\n\t\t\tif (plugin.assignmentOperators.has(node.operator)) {\n\t\t\t\tnode.type = 'AssignmentExpression';\n\t\t\t\tupdateBinariesToAssignments(node.left);\n\t\t\t\tupdateBinariesToAssignments(node.right);\n\t\t\t}\n\t\t\telse if (!node.operator) {\n\t\t\t\tObject.values(node).forEach((val) => {\n\t\t\t\t\tif (val && typeof val === 'object') {\n\t\t\t\t\t\tupdateBinariesToAssignments(val);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t},\n};\nexport default plugin;\n"],"names":[],"mappings":";;;CAAA,MAAM,SAAS,GAAG,EAA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","^=","|=","||=","&&=","??="]),updateOperators:[43,45],assignmentPrecedence:.9,init(t){const o=[t.IDENTIFIER,t.MEMBER_EXP];function n(t){e.assignmentOperators.has(t.operator)?(t.type="AssignmentExpression",n(t.left),n(t.right)):t.operator||Object.values(t).forEach((e=>{e&&"object"==typeof e&&n(e)}))}e.assignmentOperators.forEach((o=>t.addBinaryOp(o,e.assignmentPrecedence,!0))),t.hooks.add("gobble-token",(function(t){const n=this.code;e.updateOperators.some((e=>e===n&&e===this.expr.charCodeAt(this.index+1)))&&(this.index+=2,t.node={type:"UpdateExpression",operator:43===n?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},t.node.argument&&o.includes(t.node.argument.type)||this.throwError(`Unexpected ${t.node.operator}`))})),t.hooks.add("after-token",(function(t){if(t.node){const n=this.code;e.updateOperators.some((e=>e===n&&e===this.expr.charCodeAt(this.index+1)))&&(o.includes(t.node.type)||this.throwError(`Unexpected ${t.node.operator}`),this.index+=2,t.node={type:"UpdateExpression",operator:43===n?"++":"--",argument:t.node,prefix:!1})}})),t.hooks.add("after-expression",(function(e){e.node&&n(e.node)}))}};return e}();
|
|
2
|
+
//# sourceMappingURL=index.iife.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.iife.min.js","sources":["../../src/index.js"],"sourcesContent":["const PLUS_CODE = 43; // +\nconst MINUS_CODE = 45; // -\n\nconst plugin = {\n\tname: 'assignment',\n\n\tassignmentOperators: new Set([\n\t\t'=',\n\t\t'*=',\n\t\t'**=',\n\t\t'/=',\n\t\t'%=',\n\t\t'+=',\n\t\t'-=',\n\t\t'<<=',\n\t\t'>>=',\n\t\t'>>>=',\n\t\t'&=',\n\t\t'^=',\n\t\t'|=',\n\t\t'||=',\n\t\t'&&=',\n\t\t'??=',\n\t]),\n\tupdateOperators: [PLUS_CODE, MINUS_CODE],\n\tassignmentPrecedence: 0.9,\n\n\tinit(jsep) {\n\t\tconst updateNodeTypes = [jsep.IDENTIFIER, jsep.MEMBER_EXP];\n\t\tplugin.assignmentOperators.forEach(op => jsep.addBinaryOp(op, plugin.assignmentPrecedence, true));\n\n\t\tjsep.hooks.add('gobble-token', function gobbleUpdatePrefix(env) {\n\t\t\tconst code = this.code;\n\t\t\tif (plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) {\n\t\t\t\tthis.index += 2;\n\t\t\t\tenv.node = {\n\t\t\t\t\ttype: 'UpdateExpression',\n\t\t\t\t\toperator: code === PLUS_CODE ? '++' : '--',\n\t\t\t\t\targument: this.gobbleTokenProperty(this.gobbleIdentifier()),\n\t\t\t\t\tprefix: true,\n\t\t\t\t};\n\t\t\t\tif (!env.node.argument || !updateNodeTypes.includes(env.node.argument.type)) {\n\t\t\t\t\tthis.throwError(`Unexpected ${env.node.operator}`);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tjsep.hooks.add('after-token', function gobbleUpdatePostfix(env) {\n\t\t\tif (env.node) {\n\t\t\t\tconst code = this.code;\n\t\t\t\tif (plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) {\n\t\t\t\t\tif (!updateNodeTypes.includes(env.node.type)) {\n\t\t\t\t\t\tthis.throwError(`Unexpected ${env.node.operator}`);\n\t\t\t\t\t}\n\t\t\t\t\tthis.index += 2;\n\t\t\t\t\tenv.node = {\n\t\t\t\t\t\ttype: 'UpdateExpression',\n\t\t\t\t\t\toperator: code === PLUS_CODE ? '++' : '--',\n\t\t\t\t\t\targument: env.node,\n\t\t\t\t\t\tprefix: false,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tjsep.hooks.add('after-expression', function gobbleAssignment(env) {\n\t\t\tif (env.node) {\n\t\t\t\t// Note: Binaries can be chained in a single expression to respect\n\t\t\t\t// operator precedence (i.e. a = b = 1 + 2 + 3)\n\t\t\t\t// Update all binary assignment nodes in the tree\n\t\t\t\tupdateBinariesToAssignments(env.node);\n\t\t\t}\n\t\t});\n\n\t\tfunction updateBinariesToAssignments(node) {\n\t\t\tif (plugin.assignmentOperators.has(node.operator)) {\n\t\t\t\tnode.type = 'AssignmentExpression';\n\t\t\t\tupdateBinariesToAssignments(node.left);\n\t\t\t\tupdateBinariesToAssignments(node.right);\n\t\t\t}\n\t\t\telse if (!node.operator) {\n\t\t\t\tObject.values(node).forEach((val) => {\n\t\t\t\t\tif (val && typeof val === 'object') {\n\t\t\t\t\t\tupdateBinariesToAssignments(val);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t},\n};\nexport default plugin;\n"],"names":["plugin","name","assignmentOperators","Set","updateOperators","assignmentPrecedence","init","jsep","updateNodeTypes","IDENTIFIER","MEMBER_EXP","updateBinariesToAssignments","node","has","operator","type","left","right","Object","values","forEach","val","op","addBinaryOp","hooks","add","env","code","this","some","c","expr","charCodeAt","index","argument","gobbleTokenProperty","gobbleIdentifier","prefix","includes","throwError"],"mappings":"kCAAA,MAGMA,EAAS,CACdC,KAAM,aAENC,oBAAqB,IAAIC,IAAI,CAC5B,IACA,KACA,MACA,KACA,KACA,KACA,KACA,MACA,MACA,OACA,KACA,KACA,KACA,MACA,MACA,QAEDC,gBAAiB,CAxBA,GACC,IAwBlBC,qBAAsB,GAEtBC,KAAKC,GACJ,MAAMC,EAAkB,CAACD,EAAKE,WAAYF,EAAKG,YA8C/C,SAASC,EAA4BC,GAChCZ,EAAOE,oBAAoBW,IAAID,EAAKE,WACvCF,EAAKG,KAAO,uBACZJ,EAA4BC,EAAKI,MACjCL,EAA4BC,EAAKK,QAExBL,EAAKE,UACdI,OAAOC,OAAOP,GAAMQ,SAASC,IACxBA,GAAsB,iBAARA,GACjBV,EAA4BU,MAtDhCrB,EAAOE,oBAAoBkB,SAAQE,GAAMf,EAAKgB,YAAYD,EAAItB,EAAOK,sBAAsB,KAE3FE,EAAKiB,MAAMC,IAAI,gBAAgB,SAA4BC,GAC1D,MAAMC,EAAOC,KAAKD,KACd3B,EAAOI,gBAAgByB,MAAKC,GAAKA,IAAMH,GAAQG,IAAMF,KAAKG,KAAKC,WAAWJ,KAAKK,MAAQ,OAC1FL,KAAKK,OAAS,EACdP,EAAId,KAAO,CACVG,KAAM,mBACND,SArCa,KAqCHa,EAAqB,KAAO,KACtCO,SAAUN,KAAKO,oBAAoBP,KAAKQ,oBACxCC,QAAQ,GAEJX,EAAId,KAAKsB,UAAa1B,EAAgB8B,SAASZ,EAAId,KAAKsB,SAASnB,OACrEa,KAAKW,WAAW,cAAcb,EAAId,KAAKE,gBAK1CP,EAAKiB,MAAMC,IAAI,eAAe,SAA6BC,GAC1D,GAAIA,EAAId,KAAM,CACb,MAAMe,EAAOC,KAAKD,KACd3B,EAAOI,gBAAgByB,MAAKC,GAAKA,IAAMH,GAAQG,IAAMF,KAAKG,KAAKC,WAAWJ,KAAKK,MAAQ,OACrFzB,EAAgB8B,SAASZ,EAAId,KAAKG,OACtCa,KAAKW,WAAW,cAAcb,EAAId,KAAKE,YAExCc,KAAKK,OAAS,EACdP,EAAId,KAAO,CACVG,KAAM,mBACND,SAzDY,KAyDFa,EAAqB,KAAO,KACtCO,SAAUR,EAAId,KACdyB,QAAQ,QAMZ9B,EAAKiB,MAAMC,IAAI,oBAAoB,SAA0BC,GACxDA,EAAId,MAIPD,EAA4Be,EAAId"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
const PLUS_CODE = 43; // +
|
|
2
|
+
const MINUS_CODE = 45; // -
|
|
3
|
+
|
|
4
|
+
const plugin = {
|
|
5
|
+
name: 'assignment',
|
|
6
|
+
|
|
7
|
+
assignmentOperators: new Set([
|
|
8
|
+
'=',
|
|
9
|
+
'*=',
|
|
10
|
+
'**=',
|
|
11
|
+
'/=',
|
|
12
|
+
'%=',
|
|
13
|
+
'+=',
|
|
14
|
+
'-=',
|
|
15
|
+
'<<=',
|
|
16
|
+
'>>=',
|
|
17
|
+
'>>>=',
|
|
18
|
+
'&=',
|
|
19
|
+
'^=',
|
|
20
|
+
'|=',
|
|
21
|
+
'||=',
|
|
22
|
+
'&&=',
|
|
23
|
+
'??=',
|
|
24
|
+
]),
|
|
25
|
+
updateOperators: [PLUS_CODE, MINUS_CODE],
|
|
26
|
+
assignmentPrecedence: 0.9,
|
|
27
|
+
|
|
28
|
+
init(jsep) {
|
|
29
|
+
const updateNodeTypes = [jsep.IDENTIFIER, jsep.MEMBER_EXP];
|
|
30
|
+
plugin.assignmentOperators.forEach(op => jsep.addBinaryOp(op, plugin.assignmentPrecedence, true));
|
|
31
|
+
|
|
32
|
+
jsep.hooks.add('gobble-token', function gobbleUpdatePrefix(env) {
|
|
33
|
+
const code = this.code;
|
|
34
|
+
if (plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) {
|
|
35
|
+
this.index += 2;
|
|
36
|
+
env.node = {
|
|
37
|
+
type: 'UpdateExpression',
|
|
38
|
+
operator: code === PLUS_CODE ? '++' : '--',
|
|
39
|
+
argument: this.gobbleTokenProperty(this.gobbleIdentifier()),
|
|
40
|
+
prefix: true,
|
|
41
|
+
};
|
|
42
|
+
if (!env.node.argument || !updateNodeTypes.includes(env.node.argument.type)) {
|
|
43
|
+
this.throwError(`Unexpected ${env.node.operator}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
jsep.hooks.add('after-token', function gobbleUpdatePostfix(env) {
|
|
49
|
+
if (env.node) {
|
|
50
|
+
const code = this.code;
|
|
51
|
+
if (plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) {
|
|
52
|
+
if (!updateNodeTypes.includes(env.node.type)) {
|
|
53
|
+
this.throwError(`Unexpected ${env.node.operator}`);
|
|
54
|
+
}
|
|
55
|
+
this.index += 2;
|
|
56
|
+
env.node = {
|
|
57
|
+
type: 'UpdateExpression',
|
|
58
|
+
operator: code === PLUS_CODE ? '++' : '--',
|
|
59
|
+
argument: env.node,
|
|
60
|
+
prefix: false,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
jsep.hooks.add('after-expression', function gobbleAssignment(env) {
|
|
67
|
+
if (env.node) {
|
|
68
|
+
// Note: Binaries can be chained in a single expression to respect
|
|
69
|
+
// operator precedence (i.e. a = b = 1 + 2 + 3)
|
|
70
|
+
// Update all binary assignment nodes in the tree
|
|
71
|
+
updateBinariesToAssignments(env.node);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
function updateBinariesToAssignments(node) {
|
|
76
|
+
if (plugin.assignmentOperators.has(node.operator)) {
|
|
77
|
+
node.type = 'AssignmentExpression';
|
|
78
|
+
updateBinariesToAssignments(node.left);
|
|
79
|
+
updateBinariesToAssignments(node.right);
|
|
80
|
+
}
|
|
81
|
+
else if (!node.operator) {
|
|
82
|
+
Object.values(node).forEach((val) => {
|
|
83
|
+
if (val && typeof val === 'object') {
|
|
84
|
+
updateBinariesToAssignments(val);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export { plugin as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e={name:"assignment",assignmentOperators:new Set(["=","*=","**=","/=","%=","+=","-=","<<=",">>=",">>>=","&=","^=","|=","||=","&&=","??="]),updateOperators:[43,45],assignmentPrecedence:.9,init(t){const o=[t.IDENTIFIER,t.MEMBER_EXP];function n(t){e.assignmentOperators.has(t.operator)?(t.type="AssignmentExpression",n(t.left),n(t.right)):t.operator||Object.values(t).forEach((e=>{e&&"object"==typeof e&&n(e)}))}e.assignmentOperators.forEach((o=>t.addBinaryOp(o,e.assignmentPrecedence,!0))),t.hooks.add("gobble-token",(function(t){const n=this.code;e.updateOperators.some((e=>e===n&&e===this.expr.charCodeAt(this.index+1)))&&(this.index+=2,t.node={type:"UpdateExpression",operator:43===n?"++":"--",argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},t.node.argument&&o.includes(t.node.argument.type)||this.throwError(`Unexpected ${t.node.operator}`))})),t.hooks.add("after-token",(function(t){if(t.node){const n=this.code;e.updateOperators.some((e=>e===n&&e===this.expr.charCodeAt(this.index+1)))&&(o.includes(t.node.type)||this.throwError(`Unexpected ${t.node.operator}`),this.index+=2,t.node={type:"UpdateExpression",operator:43===n?"++":"--",argument:t.node,prefix:!1})}})),t.hooks.add("after-expression",(function(e){e.node&&n(e.node)}))}};export{e as default};
|
|
2
|
+
//# sourceMappingURL=index.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.min.js","sources":["../src/index.js"],"sourcesContent":["const PLUS_CODE = 43; // +\nconst MINUS_CODE = 45; // -\n\nconst plugin = {\n\tname: 'assignment',\n\n\tassignmentOperators: new Set([\n\t\t'=',\n\t\t'*=',\n\t\t'**=',\n\t\t'/=',\n\t\t'%=',\n\t\t'+=',\n\t\t'-=',\n\t\t'<<=',\n\t\t'>>=',\n\t\t'>>>=',\n\t\t'&=',\n\t\t'^=',\n\t\t'|=',\n\t\t'||=',\n\t\t'&&=',\n\t\t'??=',\n\t]),\n\tupdateOperators: [PLUS_CODE, MINUS_CODE],\n\tassignmentPrecedence: 0.9,\n\n\tinit(jsep) {\n\t\tconst updateNodeTypes = [jsep.IDENTIFIER, jsep.MEMBER_EXP];\n\t\tplugin.assignmentOperators.forEach(op => jsep.addBinaryOp(op, plugin.assignmentPrecedence, true));\n\n\t\tjsep.hooks.add('gobble-token', function gobbleUpdatePrefix(env) {\n\t\t\tconst code = this.code;\n\t\t\tif (plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) {\n\t\t\t\tthis.index += 2;\n\t\t\t\tenv.node = {\n\t\t\t\t\ttype: 'UpdateExpression',\n\t\t\t\t\toperator: code === PLUS_CODE ? '++' : '--',\n\t\t\t\t\targument: this.gobbleTokenProperty(this.gobbleIdentifier()),\n\t\t\t\t\tprefix: true,\n\t\t\t\t};\n\t\t\t\tif (!env.node.argument || !updateNodeTypes.includes(env.node.argument.type)) {\n\t\t\t\t\tthis.throwError(`Unexpected ${env.node.operator}`);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tjsep.hooks.add('after-token', function gobbleUpdatePostfix(env) {\n\t\t\tif (env.node) {\n\t\t\t\tconst code = this.code;\n\t\t\t\tif (plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) {\n\t\t\t\t\tif (!updateNodeTypes.includes(env.node.type)) {\n\t\t\t\t\t\tthis.throwError(`Unexpected ${env.node.operator}`);\n\t\t\t\t\t}\n\t\t\t\t\tthis.index += 2;\n\t\t\t\t\tenv.node = {\n\t\t\t\t\t\ttype: 'UpdateExpression',\n\t\t\t\t\t\toperator: code === PLUS_CODE ? '++' : '--',\n\t\t\t\t\t\targument: env.node,\n\t\t\t\t\t\tprefix: false,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tjsep.hooks.add('after-expression', function gobbleAssignment(env) {\n\t\t\tif (env.node) {\n\t\t\t\t// Note: Binaries can be chained in a single expression to respect\n\t\t\t\t// operator precedence (i.e. a = b = 1 + 2 + 3)\n\t\t\t\t// Update all binary assignment nodes in the tree\n\t\t\t\tupdateBinariesToAssignments(env.node);\n\t\t\t}\n\t\t});\n\n\t\tfunction updateBinariesToAssignments(node) {\n\t\t\tif (plugin.assignmentOperators.has(node.operator)) {\n\t\t\t\tnode.type = 'AssignmentExpression';\n\t\t\t\tupdateBinariesToAssignments(node.left);\n\t\t\t\tupdateBinariesToAssignments(node.right);\n\t\t\t}\n\t\t\telse if (!node.operator) {\n\t\t\t\tObject.values(node).forEach((val) => {\n\t\t\t\t\tif (val && typeof val === 'object') {\n\t\t\t\t\t\tupdateBinariesToAssignments(val);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t},\n};\nexport default plugin;\n"],"names":["plugin","name","assignmentOperators","Set","updateOperators","assignmentPrecedence","init","jsep","updateNodeTypes","IDENTIFIER","MEMBER_EXP","updateBinariesToAssignments","node","has","operator","type","left","right","Object","values","forEach","val","op","addBinaryOp","hooks","add","env","code","this","some","c","expr","charCodeAt","index","argument","gobbleTokenProperty","gobbleIdentifier","prefix","includes","throwError"],"mappings":"AAAA,MAGMA,EAAS,CACdC,KAAM,aAENC,oBAAqB,IAAIC,IAAI,CAC5B,IACA,KACA,MACA,KACA,KACA,KACA,KACA,MACA,MACA,OACA,KACA,KACA,KACA,MACA,MACA,QAEDC,gBAAiB,CAxBA,GACC,IAwBlBC,qBAAsB,GAEtBC,KAAKC,GACJ,MAAMC,EAAkB,CAACD,EAAKE,WAAYF,EAAKG,YA8C/C,SAASC,EAA4BC,GAChCZ,EAAOE,oBAAoBW,IAAID,EAAKE,WACvCF,EAAKG,KAAO,uBACZJ,EAA4BC,EAAKI,MACjCL,EAA4BC,EAAKK,QAExBL,EAAKE,UACdI,OAAOC,OAAOP,GAAMQ,SAASC,IACxBA,GAAsB,iBAARA,GACjBV,EAA4BU,MAtDhCrB,EAAOE,oBAAoBkB,SAAQE,GAAMf,EAAKgB,YAAYD,EAAItB,EAAOK,sBAAsB,KAE3FE,EAAKiB,MAAMC,IAAI,gBAAgB,SAA4BC,GAC1D,MAAMC,EAAOC,KAAKD,KACd3B,EAAOI,gBAAgByB,MAAKC,GAAKA,IAAMH,GAAQG,IAAMF,KAAKG,KAAKC,WAAWJ,KAAKK,MAAQ,OAC1FL,KAAKK,OAAS,EACdP,EAAId,KAAO,CACVG,KAAM,mBACND,SArCa,KAqCHa,EAAqB,KAAO,KACtCO,SAAUN,KAAKO,oBAAoBP,KAAKQ,oBACxCC,QAAQ,GAEJX,EAAId,KAAKsB,UAAa1B,EAAgB8B,SAASZ,EAAId,KAAKsB,SAASnB,OACrEa,KAAKW,WAAW,cAAcb,EAAId,KAAKE,gBAK1CP,EAAKiB,MAAMC,IAAI,eAAe,SAA6BC,GAC1D,GAAIA,EAAId,KAAM,CACb,MAAMe,EAAOC,KAAKD,KACd3B,EAAOI,gBAAgByB,MAAKC,GAAKA,IAAMH,GAAQG,IAAMF,KAAKG,KAAKC,WAAWJ,KAAKK,MAAQ,OACrFzB,EAAgB8B,SAASZ,EAAId,KAAKG,OACtCa,KAAKW,WAAW,cAAcb,EAAId,KAAKE,YAExCc,KAAKK,OAAS,EACdP,EAAId,KAAO,CACVG,KAAM,mBACND,SAzDY,KAyDFa,EAAqB,KAAO,KACtCO,SAAUR,EAAId,KACdyB,QAAQ,QAMZ9B,EAAKiB,MAAMC,IAAI,oBAAoB,SAA0BC,GACxDA,EAAId,MAIPD,EAA4Be,EAAId"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jsep-plugin/assignment",
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "Adds assignment expression support",
|
|
5
|
+
"author": "Shelly (https://github.com/6utt3rfly)",
|
|
6
|
+
"maintainers": [
|
|
7
|
+
"Eric Smekens (https://github.com/EricSmekens)",
|
|
8
|
+
"Lea Verou (https://github.com/LeaVerou)",
|
|
9
|
+
"Shelly (https://github.com/6utt3rfly)"
|
|
10
|
+
],
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://ericsmekens.github.io/jsep/tree/master/packages/assignment#readme",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"repository": {
|
|
17
|
+
"url": "EricSmekens/jsep",
|
|
18
|
+
"directory": "packages/assignment"
|
|
19
|
+
},
|
|
20
|
+
"type": "module",
|
|
21
|
+
"main": "./dist/cjs/index.cjs.js",
|
|
22
|
+
"module": "./dist/index.js",
|
|
23
|
+
"types": "types/tsd.d.ts",
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"jsep": "^0.4.0||^1.0.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"rollup": "^2.44.0",
|
|
29
|
+
"rollup-plugin-delete": "^2.0.0"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">= 10.16.0"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "rollup -c ../../plugin.rollup.config.js && cp ../../package-cjs.json dist/cjs/package.json && cp ../../LICENSE ./",
|
|
36
|
+
"test": "cd ../../ && http-server -p 49649 --silent & node-qunit-puppeteer http://localhost:49649/packages/assignment/test/unit_tests.html",
|
|
37
|
+
"lint": "eslint src/**/*.js test/**/*.js"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as jsep from 'jsep';
|
|
2
|
+
import { Expression, IPlugin } from 'jsep';
|
|
3
|
+
export const name: string;
|
|
4
|
+
export const assignmentOperators: Set<string>;
|
|
5
|
+
export const updateOperators: number[];
|
|
6
|
+
export const assignmentPrecedence: number;
|
|
7
|
+
export function init(this: typeof jsep): void;
|
|
8
|
+
|
|
9
|
+
export interface UpdateExpression extends Expression {
|
|
10
|
+
type: 'UpdateExpression';
|
|
11
|
+
operator: '++' | '--';
|
|
12
|
+
argument: Expression;
|
|
13
|
+
prefix: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface AssignmentExpression extends Expression {
|
|
17
|
+
type: 'AssignmentExpression';
|
|
18
|
+
operator: '='
|
|
19
|
+
| '*='
|
|
20
|
+
| '**='
|
|
21
|
+
| '/='
|
|
22
|
+
| '%='
|
|
23
|
+
| '+='
|
|
24
|
+
| '-='
|
|
25
|
+
| '<<='
|
|
26
|
+
| '>>='
|
|
27
|
+
| '>>>='
|
|
28
|
+
| '&='
|
|
29
|
+
| '^='
|
|
30
|
+
| '|='
|
|
31
|
+
| '||='
|
|
32
|
+
| '&&='
|
|
33
|
+
| '??=';
|
|
34
|
+
left: Expression;
|
|
35
|
+
right: Expression;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare const _export: IPlugin;
|
|
39
|
+
export default _export;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2013 Stephen Oney, https://ericsmekens.github.io/jsep/
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[npm]: https://img.shields.io/npm/v/@jsep-plugin/regex
|
|
2
|
+
[npm-url]: https://www.npmjs.com/package/@jsep-plugin/regex
|
|
3
|
+
[size]: https://packagephobia.now.sh/badge?p=@jsep-plugin/regex
|
|
4
|
+
[size-url]: https://packagephobia.now.sh/result?p=@jsep-plugin/regex
|
|
5
|
+
|
|
6
|
+
[![npm][npm]][npm-url]
|
|
7
|
+
[![size][size]][size-url]
|
|
8
|
+
|
|
9
|
+
# @jsep-plugin/regex
|
|
10
|
+
|
|
11
|
+
A JSEP plugin for adding regex expression support. Allows expressions of the form:
|
|
12
|
+
|
|
13
|
+
```javascript
|
|
14
|
+
jsep('/abc/');
|
|
15
|
+
jsep('/abc/ig');
|
|
16
|
+
jsep('/[a-z]{3}/ig.test(a)');
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
```console
|
|
22
|
+
npm install @jsep-plugin/regex
|
|
23
|
+
# or
|
|
24
|
+
yarn add @jsep-plugin/regex
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
```javascript
|
|
29
|
+
import jsep from 'jsep';
|
|
30
|
+
import jsepRegex from '@jsep-plugin/regex';
|
|
31
|
+
jsep.plugins.register(jsepRegex);
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Meta
|
|
35
|
+
|
|
36
|
+
[LICENSE (MIT)](/LICENSE)
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const FSLASH_CODE = 47; // '/'
|
|
4
|
+
const BSLASH_CODE = 92; // '\\'
|
|
5
|
+
|
|
6
|
+
var index = {
|
|
7
|
+
name: 'regex',
|
|
8
|
+
|
|
9
|
+
init(jsep) {
|
|
10
|
+
// Regex literal: /abc123/ig
|
|
11
|
+
jsep.hooks.add('gobble-token', function gobbleRegexLiteral(env) {
|
|
12
|
+
if (this.code === FSLASH_CODE) {
|
|
13
|
+
const patternIndex = ++this.index;
|
|
14
|
+
|
|
15
|
+
let inCharSet = false;
|
|
16
|
+
while (this.index < this.expr.length) {
|
|
17
|
+
if (this.code === FSLASH_CODE && !inCharSet) {
|
|
18
|
+
const pattern = this.expr.slice(patternIndex, this.index);
|
|
19
|
+
|
|
20
|
+
let flags = '';
|
|
21
|
+
while (++this.index < this.expr.length) {
|
|
22
|
+
const code = this.code;
|
|
23
|
+
if ((code >= 97 && code <= 122) // a...z
|
|
24
|
+
|| (code >= 65 && code <= 90) // A...Z
|
|
25
|
+
|| (code >= 48 && code <= 57)) { // 0-9
|
|
26
|
+
flags += this.char;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let value;
|
|
34
|
+
try {
|
|
35
|
+
value = new RegExp(pattern, flags);
|
|
36
|
+
}
|
|
37
|
+
catch (e) {
|
|
38
|
+
this.throwError(e.message);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
env.node = {
|
|
42
|
+
type: jsep.LITERAL,
|
|
43
|
+
value,
|
|
44
|
+
raw: this.expr.slice(patternIndex - 1, this.index),
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// allow . [] and () after regex: /regex/.test(a)
|
|
48
|
+
env.node = this.gobbleTokenProperty(env.node);
|
|
49
|
+
return env.node;
|
|
50
|
+
}
|
|
51
|
+
if (this.code === jsep.OBRACK_CODE) {
|
|
52
|
+
inCharSet = true;
|
|
53
|
+
}
|
|
54
|
+
else if (inCharSet && this.code === jsep.CBRACK_CODE) {
|
|
55
|
+
inCharSet = false;
|
|
56
|
+
}
|
|
57
|
+
this.index += this.code === BSLASH_CODE ? 2 : 1;
|
|
58
|
+
}
|
|
59
|
+
this.throwError('Unclosed Regex');
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
module.exports = index;
|
|
66
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../src/index.js"],"sourcesContent":["const FSLASH_CODE = 47; // '/'\nconst BSLASH_CODE = 92; // '\\\\'\n\nexport default {\n\tname: 'regex',\n\n\tinit(jsep) {\n\t\t// Regex literal: /abc123/ig\n\t\tjsep.hooks.add('gobble-token', function gobbleRegexLiteral(env) {\n\t\t\tif (this.code === FSLASH_CODE) {\n\t\t\t\tconst patternIndex = ++this.index;\n\n\t\t\t\tlet inCharSet = false;\n\t\t\t\twhile (this.index < this.expr.length) {\n\t\t\t\t\tif (this.code === FSLASH_CODE && !inCharSet) {\n\t\t\t\t\t\tconst pattern = this.expr.slice(patternIndex, this.index);\n\n\t\t\t\t\t\tlet flags = '';\n\t\t\t\t\t\twhile (++this.index < this.expr.length) {\n\t\t\t\t\t\t\tconst code = this.code;\n\t\t\t\t\t\t\tif ((code >= 97 && code <= 122) // a...z\n\t\t\t\t\t\t\t\t|| (code >= 65 && code <= 90) // A...Z\n\t\t\t\t\t\t\t\t|| (code >= 48 && code <= 57)) { // 0-9\n\t\t\t\t\t\t\t\tflags += this.char;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet value;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tvalue = new RegExp(pattern, flags);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (e) {\n\t\t\t\t\t\t\tthis.throwError(e.message);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tenv.node = {\n\t\t\t\t\t\t\ttype: jsep.LITERAL,\n\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\traw: this.expr.slice(patternIndex - 1, this.index),\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// allow . [] and () after regex: /regex/.test(a)\n\t\t\t\t\t\tenv.node = this.gobbleTokenProperty(env.node);\n\t\t\t\t\t\treturn env.node;\n\t\t\t\t\t}\n\t\t\t\t\tif (this.code === jsep.OBRACK_CODE) {\n\t\t\t\t\t\tinCharSet = true;\n\t\t\t\t\t}\n\t\t\t\t\telse if (inCharSet && this.code === jsep.CBRACK_CODE) {\n\t\t\t\t\t\tinCharSet = false;\n\t\t\t\t\t}\n\t\t\t\t\tthis.index += this.code === BSLASH_CODE ? 2 : 1;\n\t\t\t\t}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ACd,QAAQ;AACR,OAAO;AACP;AACA,MAAM,IAAI,KAAK,CAAC;AAChB,MAAM,IAAI;AACV,OAAO,KAAK,GAAG,IAAI,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAC1C,OAAO;AACP,MAAM,OAAO,CAAC,EAAE;AAChB,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAClC,OAAO;AACP;AACA,MAAM,GAAG,CAAC,IAAI,GAAG;AACjB,OAAO,IAAI,EAAE,IAAI,CAAC,OAAO;AACzB,OAAO,KAAK;AACZ,OAAO,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC;AACzD,OAAO,CAAC;AACR;AACA;AACA,MAAM,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACpD,MAAM,OAAO,GAAG,CAAC,IAAI,CAAC;AACtB,MAAM;AACN,KAAK,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,WAAW,EAAE;AACzC,MAAM,SAAS,GAAG,IAAI,CAAC;AACvB,MAAM;AACN,UAAU,IAAI,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,WAAW,EAAE;AAC3D,MAAM,SAAS,GAAG,KAAK,CAAC;AACxB,MAAM;AACN,KAAK,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW,GAAG,CAAC,GAAG,CAAC,CAAC;AACrD,KAAK;AACL,IAAI,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;AACtC,IAAI;AACJ,GAAG,CAAC,CAAC;AACL,EAAE;AACF,CAAC;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e={name:"regex",init(e){e.hooks.add("gobble-token",(function(t){if(47===this.code){const i=++this.index;let s=!1;for(;this.index<this.expr.length;){if(47===this.code&&!s){const s=this.expr.slice(i,this.index);let o,h="";for(;++this.index<this.expr.length;){const e=this.code;if(!(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57))break;h+=this.char}try{o=new RegExp(s,h)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:o,raw:this.expr.slice(i-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?s=!0:s&&this.code===e.CBRACK_CODE&&(s=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}}))}};module.exports=e;
|
|
2
|
+
//# sourceMappingURL=index.cjs.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.min.js","sources":["../../src/index.js"],"sourcesContent":["const FSLASH_CODE = 47; // '/'\nconst BSLASH_CODE = 92; // '\\\\'\n\nexport default {\n\tname: 'regex',\n\n\tinit(jsep) {\n\t\t// Regex literal: /abc123/ig\n\t\tjsep.hooks.add('gobble-token', function gobbleRegexLiteral(env) {\n\t\t\tif (this.code === FSLASH_CODE) {\n\t\t\t\tconst patternIndex = ++this.index;\n\n\t\t\t\tlet inCharSet = false;\n\t\t\t\twhile (this.index < this.expr.length) {\n\t\t\t\t\tif (this.code === FSLASH_CODE && !inCharSet) {\n\t\t\t\t\t\tconst pattern = this.expr.slice(patternIndex, this.index);\n\n\t\t\t\t\t\tlet flags = '';\n\t\t\t\t\t\twhile (++this.index < this.expr.length) {\n\t\t\t\t\t\t\tconst code = this.code;\n\t\t\t\t\t\t\tif ((code >= 97 && code <= 122) // a...z\n\t\t\t\t\t\t\t\t|| (code >= 65 && code <= 90) // A...Z\n\t\t\t\t\t\t\t\t|| (code >= 48 && code <= 57)) { // 0-9\n\t\t\t\t\t\t\t\tflags += this.char;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet value;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tvalue = new RegExp(pattern, flags);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (e) {\n\t\t\t\t\t\t\tthis.throwError(e.message);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tenv.node = {\n\t\t\t\t\t\t\ttype: jsep.LITERAL,\n\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\traw: this.expr.slice(patternIndex - 1, this.index),\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// allow . [] and () after regex: /regex/.test(a)\n\t\t\t\t\t\tenv.node = this.gobbleTokenProperty(env.node);\n\t\t\t\t\t\treturn env.node;\n\t\t\t\t\t}\n\t\t\t\t\tif (this.code === jsep.OBRACK_CODE) {\n\t\t\t\t\t\tinCharSet = true;\n\t\t\t\t\t}\n\t\t\t\t\telse if (inCharSet && this.code === jsep.CBRACK_CODE) {\n\t\t\t\t\t\tinCharSet = false;\n\t\t\t\t\t}\n\t\t\t\t\tthis.index += this.code === BSLASH_CODE ? 2 : 1;\n\t\t\t\t}\n\t\t\t\tthis.throwError('Unclosed Regex');\n\t\t\t}\n\t\t});\n\t},\n};\n"],"names":["name","init","jsep","hooks","add","env","this","code","patternIndex","index","inCharSet","expr","length","pattern","slice","value","flags","char","RegExp","e","throwError","message","node","type","LITERAL","raw","gobbleTokenProperty","OBRACK_CODE","CBRACK_CODE"],"mappings":"aAGA,MAAe,CACdA,KAAM,QAENC,KAAKC,GAEJA,EAAKC,MAAMC,IAAI,gBAAgB,SAA4BC,GAC1D,GATiB,KASbC,KAAKC,KAAsB,CAC9B,MAAMC,IAAiBF,KAAKG,MAE5B,IAAIC,GAAY,EAChB,KAAOJ,KAAKG,MAAQH,KAAKK,KAAKC,QAAQ,CACrC,GAde,KAcXN,KAAKC,OAAyBG,EAAW,CAC5C,MAAMG,EAAUP,KAAKK,KAAKG,MAAMN,EAAcF,KAAKG,OAEnD,IAaIM,EAbAC,EAAQ,GACZ,OAASV,KAAKG,MAAQH,KAAKK,KAAKC,QAAQ,CACvC,MAAML,EAAOD,KAAKC,KAClB,KAAKA,GAAQ,IAAMA,GAAQ,KACtBA,GAAQ,IAAMA,GAAQ,IACtBA,GAAQ,IAAMA,GAAQ,IAI1B,MAHAS,GAASV,KAAKW,KAQhB,IACCF,EAAQ,IAAIG,OAAOL,EAASG,GAE7B,MAAOG,GACNb,KAAKc,WAAWD,EAAEE,SAWnB,OARAhB,EAAIiB,KAAO,CACVC,KAAMrB,EAAKsB,QACXT,MAAAA,EACAU,IAAKnB,KAAKK,KAAKG,MAAMN,EAAe,EAAGF,KAAKG,QAI7CJ,EAAIiB,KAAOhB,KAAKoB,oBAAoBrB,EAAIiB,MACjCjB,EAAIiB,KAERhB,KAAKC,OAASL,EAAKyB,YACtBjB,GAAY,EAEJA,GAAaJ,KAAKC,OAASL,EAAK0B,cACxClB,GAAY,GAEbJ,KAAKG,OArDU,KAqDDH,KAAKC,KAAuB,EAAI,EAE/CD,KAAKc,WAAW"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var index = (function () {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const FSLASH_CODE = 47; // '/'
|
|
5
|
+
const BSLASH_CODE = 92; // '\\'
|
|
6
|
+
|
|
7
|
+
var index = {
|
|
8
|
+
name: 'regex',
|
|
9
|
+
|
|
10
|
+
init(jsep) {
|
|
11
|
+
// Regex literal: /abc123/ig
|
|
12
|
+
jsep.hooks.add('gobble-token', function gobbleRegexLiteral(env) {
|
|
13
|
+
if (this.code === FSLASH_CODE) {
|
|
14
|
+
const patternIndex = ++this.index;
|
|
15
|
+
|
|
16
|
+
let inCharSet = false;
|
|
17
|
+
while (this.index < this.expr.length) {
|
|
18
|
+
if (this.code === FSLASH_CODE && !inCharSet) {
|
|
19
|
+
const pattern = this.expr.slice(patternIndex, this.index);
|
|
20
|
+
|
|
21
|
+
let flags = '';
|
|
22
|
+
while (++this.index < this.expr.length) {
|
|
23
|
+
const code = this.code;
|
|
24
|
+
if ((code >= 97 && code <= 122) // a...z
|
|
25
|
+
|| (code >= 65 && code <= 90) // A...Z
|
|
26
|
+
|| (code >= 48 && code <= 57)) { // 0-9
|
|
27
|
+
flags += this.char;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let value;
|
|
35
|
+
try {
|
|
36
|
+
value = new RegExp(pattern, flags);
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
this.throwError(e.message);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
env.node = {
|
|
43
|
+
type: jsep.LITERAL,
|
|
44
|
+
value,
|
|
45
|
+
raw: this.expr.slice(patternIndex - 1, this.index),
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// allow . [] and () after regex: /regex/.test(a)
|
|
49
|
+
env.node = this.gobbleTokenProperty(env.node);
|
|
50
|
+
return env.node;
|
|
51
|
+
}
|
|
52
|
+
if (this.code === jsep.OBRACK_CODE) {
|
|
53
|
+
inCharSet = true;
|
|
54
|
+
}
|
|
55
|
+
else if (inCharSet && this.code === jsep.CBRACK_CODE) {
|
|
56
|
+
inCharSet = false;
|
|
57
|
+
}
|
|
58
|
+
this.index += this.code === BSLASH_CODE ? 2 : 1;
|
|
59
|
+
}
|
|
60
|
+
this.throwError('Unclosed Regex');
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
return index;
|
|
67
|
+
|
|
68
|
+
}());
|
|
69
|
+
//# sourceMappingURL=index.iife.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.iife.js","sources":["../../src/index.js"],"sourcesContent":["const FSLASH_CODE = 47; // '/'\nconst BSLASH_CODE = 92; // '\\\\'\n\nexport default {\n\tname: 'regex',\n\n\tinit(jsep) {\n\t\t// Regex literal: /abc123/ig\n\t\tjsep.hooks.add('gobble-token', function gobbleRegexLiteral(env) {\n\t\t\tif (this.code === FSLASH_CODE) {\n\t\t\t\tconst patternIndex = ++this.index;\n\n\t\t\t\tlet inCharSet = false;\n\t\t\t\twhile (this.index < this.expr.length) {\n\t\t\t\t\tif (this.code === FSLASH_CODE && !inCharSet) {\n\t\t\t\t\t\tconst pattern = this.expr.slice(patternIndex, this.index);\n\n\t\t\t\t\t\tlet flags = '';\n\t\t\t\t\t\twhile (++this.index < this.expr.length) {\n\t\t\t\t\t\t\tconst code = this.code;\n\t\t\t\t\t\t\tif ((code >= 97 && code <= 122) // a...z\n\t\t\t\t\t\t\t\t|| (code >= 65 && code <= 90) // A...Z\n\t\t\t\t\t\t\t\t|| (code >= 48 && code <= 57)) { // 0-9\n\t\t\t\t\t\t\t\tflags += this.char;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet value;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tvalue = new RegExp(pattern, flags);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (e) {\n\t\t\t\t\t\t\tthis.throwError(e.message);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tenv.node = {\n\t\t\t\t\t\t\ttype: jsep.LITERAL,\n\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\traw: this.expr.slice(patternIndex - 1, this.index),\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// allow . [] and () after regex: /regex/.test(a)\n\t\t\t\t\t\tenv.node = this.gobbleTokenProperty(env.node);\n\t\t\t\t\t\treturn env.node;\n\t\t\t\t\t}\n\t\t\t\t\tif (this.code === jsep.OBRACK_CODE) {\n\t\t\t\t\t\tinCharSet = true;\n\t\t\t\t\t}\n\t\t\t\t\telse if (inCharSet && this.code === jsep.CBRACK_CODE) {\n\t\t\t\t\t\tinCharSet = false;\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var index=function(){"use strict";return{name:"regex",init(e){e.hooks.add("gobble-token",(function(t){if(47===this.code){const i=++this.index;let s=!1;for(;this.index<this.expr.length;){if(47===this.code&&!s){const s=this.expr.slice(i,this.index);let o,n="";for(;++this.index<this.expr.length;){const e=this.code;if(!(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57))break;n+=this.char}try{o=new RegExp(s,n)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:o,raw:this.expr.slice(i-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?s=!0:s&&this.code===e.CBRACK_CODE&&(s=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}}))}}}();
|
|
2
|
+
//# sourceMappingURL=index.iife.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.iife.min.js","sources":["../../src/index.js"],"sourcesContent":["const FSLASH_CODE = 47; // '/'\nconst BSLASH_CODE = 92; // '\\\\'\n\nexport default {\n\tname: 'regex',\n\n\tinit(jsep) {\n\t\t// Regex literal: /abc123/ig\n\t\tjsep.hooks.add('gobble-token', function gobbleRegexLiteral(env) {\n\t\t\tif (this.code === FSLASH_CODE) {\n\t\t\t\tconst patternIndex = ++this.index;\n\n\t\t\t\tlet inCharSet = false;\n\t\t\t\twhile (this.index < this.expr.length) {\n\t\t\t\t\tif (this.code === FSLASH_CODE && !inCharSet) {\n\t\t\t\t\t\tconst pattern = this.expr.slice(patternIndex, this.index);\n\n\t\t\t\t\t\tlet flags = '';\n\t\t\t\t\t\twhile (++this.index < this.expr.length) {\n\t\t\t\t\t\t\tconst code = this.code;\n\t\t\t\t\t\t\tif ((code >= 97 && code <= 122) // a...z\n\t\t\t\t\t\t\t\t|| (code >= 65 && code <= 90) // A...Z\n\t\t\t\t\t\t\t\t|| (code >= 48 && code <= 57)) { // 0-9\n\t\t\t\t\t\t\t\tflags += this.char;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet value;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tvalue = new RegExp(pattern, flags);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (e) {\n\t\t\t\t\t\t\tthis.throwError(e.message);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tenv.node = {\n\t\t\t\t\t\t\ttype: jsep.LITERAL,\n\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\traw: this.expr.slice(patternIndex - 1, this.index),\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// allow . [] and () after regex: /regex/.test(a)\n\t\t\t\t\t\tenv.node = this.gobbleTokenProperty(env.node);\n\t\t\t\t\t\treturn env.node;\n\t\t\t\t\t}\n\t\t\t\t\tif (this.code === jsep.OBRACK_CODE) {\n\t\t\t\t\t\tinCharSet = true;\n\t\t\t\t\t}\n\t\t\t\t\telse if (inCharSet && this.code === jsep.CBRACK_CODE) {\n\t\t\t\t\t\tinCharSet = false;\n\t\t\t\t\t}\n\t\t\t\t\tthis.index += this.code === BSLASH_CODE ? 2 : 1;\n\t\t\t\t}\n\t\t\t\tthis.throwError('Unclosed Regex');\n\t\t\t}\n\t\t});\n\t},\n};\n"],"names":["name","init","jsep","hooks","add","env","this","code","patternIndex","index","inCharSet","expr","length","pattern","slice","value","flags","char","RegExp","e","throwError","message","node","type","LITERAL","raw","gobbleTokenProperty","OBRACK_CODE","CBRACK_CODE"],"mappings":"wCAGe,CACdA,KAAM,QAENC,KAAKC,GAEJA,EAAKC,MAAMC,IAAI,gBAAgB,SAA4BC,GAC1D,GATiB,KASbC,KAAKC,KAAsB,CAC9B,MAAMC,IAAiBF,KAAKG,MAE5B,IAAIC,GAAY,EAChB,KAAOJ,KAAKG,MAAQH,KAAKK,KAAKC,QAAQ,CACrC,GAde,KAcXN,KAAKC,OAAyBG,EAAW,CAC5C,MAAMG,EAAUP,KAAKK,KAAKG,MAAMN,EAAcF,KAAKG,OAEnD,IAaIM,EAbAC,EAAQ,GACZ,OAASV,KAAKG,MAAQH,KAAKK,KAAKC,QAAQ,CACvC,MAAML,EAAOD,KAAKC,KAClB,KAAKA,GAAQ,IAAMA,GAAQ,KACtBA,GAAQ,IAAMA,GAAQ,IACtBA,GAAQ,IAAMA,GAAQ,IAI1B,MAHAS,GAASV,KAAKW,KAQhB,IACCF,EAAQ,IAAIG,OAAOL,EAASG,GAE7B,MAAOG,GACNb,KAAKc,WAAWD,EAAEE,SAWnB,OARAhB,EAAIiB,KAAO,CACVC,KAAMrB,EAAKsB,QACXT,MAAAA,EACAU,IAAKnB,KAAKK,KAAKG,MAAMN,EAAe,EAAGF,KAAKG,QAI7CJ,EAAIiB,KAAOhB,KAAKoB,oBAAoBrB,EAAIiB,MACjCjB,EAAIiB,KAERhB,KAAKC,OAASL,EAAKyB,YACtBjB,GAAY,EAEJA,GAAaJ,KAAKC,OAASL,EAAK0B,cACxClB,GAAY,GAEbJ,KAAKG,OArDU,KAqDDH,KAAKC,KAAuB,EAAI,EAE/CD,KAAKc,WAAW"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const FSLASH_CODE = 47; // '/'
|
|
2
|
+
const BSLASH_CODE = 92; // '\\'
|
|
3
|
+
|
|
4
|
+
var index = {
|
|
5
|
+
name: 'regex',
|
|
6
|
+
|
|
7
|
+
init(jsep) {
|
|
8
|
+
// Regex literal: /abc123/ig
|
|
9
|
+
jsep.hooks.add('gobble-token', function gobbleRegexLiteral(env) {
|
|
10
|
+
if (this.code === FSLASH_CODE) {
|
|
11
|
+
const patternIndex = ++this.index;
|
|
12
|
+
|
|
13
|
+
let inCharSet = false;
|
|
14
|
+
while (this.index < this.expr.length) {
|
|
15
|
+
if (this.code === FSLASH_CODE && !inCharSet) {
|
|
16
|
+
const pattern = this.expr.slice(patternIndex, this.index);
|
|
17
|
+
|
|
18
|
+
let flags = '';
|
|
19
|
+
while (++this.index < this.expr.length) {
|
|
20
|
+
const code = this.code;
|
|
21
|
+
if ((code >= 97 && code <= 122) // a...z
|
|
22
|
+
|| (code >= 65 && code <= 90) // A...Z
|
|
23
|
+
|| (code >= 48 && code <= 57)) { // 0-9
|
|
24
|
+
flags += this.char;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
let value;
|
|
32
|
+
try {
|
|
33
|
+
value = new RegExp(pattern, flags);
|
|
34
|
+
}
|
|
35
|
+
catch (e) {
|
|
36
|
+
this.throwError(e.message);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
env.node = {
|
|
40
|
+
type: jsep.LITERAL,
|
|
41
|
+
value,
|
|
42
|
+
raw: this.expr.slice(patternIndex - 1, this.index),
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// allow . [] and () after regex: /regex/.test(a)
|
|
46
|
+
env.node = this.gobbleTokenProperty(env.node);
|
|
47
|
+
return env.node;
|
|
48
|
+
}
|
|
49
|
+
if (this.code === jsep.OBRACK_CODE) {
|
|
50
|
+
inCharSet = true;
|
|
51
|
+
}
|
|
52
|
+
else if (inCharSet && this.code === jsep.CBRACK_CODE) {
|
|
53
|
+
inCharSet = false;
|
|
54
|
+
}
|
|
55
|
+
this.index += this.code === BSLASH_CODE ? 2 : 1;
|
|
56
|
+
}
|
|
57
|
+
this.throwError('Unclosed Regex');
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export { index as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e={name:"regex",init(e){e.hooks.add("gobble-token",(function(t){if(47===this.code){const i=++this.index;let s=!1;for(;this.index<this.expr.length;){if(47===this.code&&!s){const s=this.expr.slice(i,this.index);let o,h="";for(;++this.index<this.expr.length;){const e=this.code;if(!(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57))break;h+=this.char}try{o=new RegExp(s,h)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:o,raw:this.expr.slice(i-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?s=!0:s&&this.code===e.CBRACK_CODE&&(s=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}}))}};export{e as default};
|
|
2
|
+
//# sourceMappingURL=index.min.js.map
|