@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,1129 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @implements {IHooks}
|
|
5
|
+
*/
|
|
6
|
+
class Hooks {
|
|
7
|
+
/**
|
|
8
|
+
* @callback HookCallback
|
|
9
|
+
* @this {*|Jsep} this
|
|
10
|
+
* @param {Jsep} env
|
|
11
|
+
* @returns: void
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Adds the given callback to the list of callbacks for the given hook.
|
|
15
|
+
*
|
|
16
|
+
* The callback will be invoked when the hook it is registered for is run.
|
|
17
|
+
*
|
|
18
|
+
* One callback function can be registered to multiple hooks and the same hook multiple times.
|
|
19
|
+
*
|
|
20
|
+
* @param {string|object} name The name of the hook, or an object of callbacks keyed by name
|
|
21
|
+
* @param {HookCallback|boolean} callback The callback function which is given environment variables.
|
|
22
|
+
* @param {?boolean} [first=false] Will add the hook to the top of the list (defaults to the bottom)
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
add(name, callback, first) {
|
|
26
|
+
if (typeof arguments[0] != 'string') {
|
|
27
|
+
// Multiple hook callbacks, keyed by name
|
|
28
|
+
for (let name in arguments[0]) {
|
|
29
|
+
this.add(name, arguments[0][name], arguments[1]);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
(Array.isArray(name) ? name : [name]).forEach(function (name) {
|
|
34
|
+
this[name] = this[name] || [];
|
|
35
|
+
|
|
36
|
+
if (callback) {
|
|
37
|
+
this[name][first ? 'unshift' : 'push'](callback);
|
|
38
|
+
}
|
|
39
|
+
}, this);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Runs a hook invoking all registered callbacks with the given environment variables.
|
|
45
|
+
*
|
|
46
|
+
* Callbacks will be invoked synchronously and in the order in which they were registered.
|
|
47
|
+
*
|
|
48
|
+
* @param {string} name The name of the hook.
|
|
49
|
+
* @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
run(name, env) {
|
|
53
|
+
this[name] = this[name] || [];
|
|
54
|
+
this[name].forEach(function (callback) {
|
|
55
|
+
callback.call(env && env.context ? env.context : env, env);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @implements {IPlugins}
|
|
62
|
+
*/
|
|
63
|
+
class Plugins {
|
|
64
|
+
constructor(jsep) {
|
|
65
|
+
this.jsep = jsep;
|
|
66
|
+
this.registered = {};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @callback PluginSetup
|
|
71
|
+
* @this {Jsep} jsep
|
|
72
|
+
* @returns: void
|
|
73
|
+
*/
|
|
74
|
+
/**
|
|
75
|
+
* Adds the given plugin(s) to the registry
|
|
76
|
+
*
|
|
77
|
+
* @param {object} plugins
|
|
78
|
+
* @param {string} plugins.name The name of the plugin
|
|
79
|
+
* @param {PluginSetup} plugins.init The init function
|
|
80
|
+
* @public
|
|
81
|
+
*/
|
|
82
|
+
register(...plugins) {
|
|
83
|
+
plugins.forEach((plugin) => {
|
|
84
|
+
if (typeof plugin !== 'object' || !plugin.name || !plugin.init) {
|
|
85
|
+
throw new Error('Invalid JSEP plugin format');
|
|
86
|
+
}
|
|
87
|
+
if (this.registered[plugin.name]) {
|
|
88
|
+
// already registered. Ignore.
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
plugin.init(this.jsep);
|
|
92
|
+
this.registered[plugin.name] = plugin;
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// JavaScript Expression Parser (JSEP) 1.4.0
|
|
98
|
+
|
|
99
|
+
class Jsep {
|
|
100
|
+
/**
|
|
101
|
+
* @returns {string}
|
|
102
|
+
*/
|
|
103
|
+
static get version() {
|
|
104
|
+
// To be filled in by the template
|
|
105
|
+
return '1.4.0';
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @returns {string}
|
|
110
|
+
*/
|
|
111
|
+
static toString() {
|
|
112
|
+
return 'JavaScript Expression Parser (JSEP) v' + Jsep.version;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
// ==================== CONFIG ================================
|
|
116
|
+
/**
|
|
117
|
+
* @method addUnaryOp
|
|
118
|
+
* @param {string} op_name The name of the unary op to add
|
|
119
|
+
* @returns {Jsep}
|
|
120
|
+
*/
|
|
121
|
+
static addUnaryOp(op_name) {
|
|
122
|
+
Jsep.max_unop_len = Math.max(op_name.length, Jsep.max_unop_len);
|
|
123
|
+
Jsep.unary_ops[op_name] = 1;
|
|
124
|
+
return Jsep;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* @method jsep.addBinaryOp
|
|
129
|
+
* @param {string} op_name The name of the binary op to add
|
|
130
|
+
* @param {number} precedence The precedence of the binary op (can be a float). Higher number = higher precedence
|
|
131
|
+
* @param {boolean} [isRightAssociative=false] whether operator is right-associative
|
|
132
|
+
* @returns {Jsep}
|
|
133
|
+
*/
|
|
134
|
+
static addBinaryOp(op_name, precedence, isRightAssociative) {
|
|
135
|
+
Jsep.max_binop_len = Math.max(op_name.length, Jsep.max_binop_len);
|
|
136
|
+
Jsep.binary_ops[op_name] = precedence;
|
|
137
|
+
if (isRightAssociative) {
|
|
138
|
+
Jsep.right_associative.add(op_name);
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
Jsep.right_associative.delete(op_name);
|
|
142
|
+
}
|
|
143
|
+
return Jsep;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* @method addIdentifierChar
|
|
148
|
+
* @param {string} char The additional character to treat as a valid part of an identifier
|
|
149
|
+
* @returns {Jsep}
|
|
150
|
+
*/
|
|
151
|
+
static addIdentifierChar(char) {
|
|
152
|
+
Jsep.additional_identifier_chars.add(char);
|
|
153
|
+
return Jsep;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* @method addLiteral
|
|
158
|
+
* @param {string} literal_name The name of the literal to add
|
|
159
|
+
* @param {*} literal_value The value of the literal
|
|
160
|
+
* @returns {Jsep}
|
|
161
|
+
*/
|
|
162
|
+
static addLiteral(literal_name, literal_value) {
|
|
163
|
+
Jsep.literals[literal_name] = literal_value;
|
|
164
|
+
return Jsep;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* @method removeUnaryOp
|
|
169
|
+
* @param {string} op_name The name of the unary op to remove
|
|
170
|
+
* @returns {Jsep}
|
|
171
|
+
*/
|
|
172
|
+
static removeUnaryOp(op_name) {
|
|
173
|
+
delete Jsep.unary_ops[op_name];
|
|
174
|
+
if (op_name.length === Jsep.max_unop_len) {
|
|
175
|
+
Jsep.max_unop_len = Jsep.getMaxKeyLen(Jsep.unary_ops);
|
|
176
|
+
}
|
|
177
|
+
return Jsep;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* @method removeAllUnaryOps
|
|
182
|
+
* @returns {Jsep}
|
|
183
|
+
*/
|
|
184
|
+
static removeAllUnaryOps() {
|
|
185
|
+
Jsep.unary_ops = {};
|
|
186
|
+
Jsep.max_unop_len = 0;
|
|
187
|
+
|
|
188
|
+
return Jsep;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* @method removeIdentifierChar
|
|
193
|
+
* @param {string} char The additional character to stop treating as a valid part of an identifier
|
|
194
|
+
* @returns {Jsep}
|
|
195
|
+
*/
|
|
196
|
+
static removeIdentifierChar(char) {
|
|
197
|
+
Jsep.additional_identifier_chars.delete(char);
|
|
198
|
+
return Jsep;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* @method removeBinaryOp
|
|
203
|
+
* @param {string} op_name The name of the binary op to remove
|
|
204
|
+
* @returns {Jsep}
|
|
205
|
+
*/
|
|
206
|
+
static removeBinaryOp(op_name) {
|
|
207
|
+
delete Jsep.binary_ops[op_name];
|
|
208
|
+
|
|
209
|
+
if (op_name.length === Jsep.max_binop_len) {
|
|
210
|
+
Jsep.max_binop_len = Jsep.getMaxKeyLen(Jsep.binary_ops);
|
|
211
|
+
}
|
|
212
|
+
Jsep.right_associative.delete(op_name);
|
|
213
|
+
|
|
214
|
+
return Jsep;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* @method removeAllBinaryOps
|
|
219
|
+
* @returns {Jsep}
|
|
220
|
+
*/
|
|
221
|
+
static removeAllBinaryOps() {
|
|
222
|
+
Jsep.binary_ops = {};
|
|
223
|
+
Jsep.max_binop_len = 0;
|
|
224
|
+
|
|
225
|
+
return Jsep;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* @method removeLiteral
|
|
230
|
+
* @param {string} literal_name The name of the literal to remove
|
|
231
|
+
* @returns {Jsep}
|
|
232
|
+
*/
|
|
233
|
+
static removeLiteral(literal_name) {
|
|
234
|
+
delete Jsep.literals[literal_name];
|
|
235
|
+
return Jsep;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* @method removeAllLiterals
|
|
240
|
+
* @returns {Jsep}
|
|
241
|
+
*/
|
|
242
|
+
static removeAllLiterals() {
|
|
243
|
+
Jsep.literals = {};
|
|
244
|
+
|
|
245
|
+
return Jsep;
|
|
246
|
+
}
|
|
247
|
+
// ==================== END CONFIG ============================
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* @returns {string}
|
|
252
|
+
*/
|
|
253
|
+
get char() {
|
|
254
|
+
return this.expr.charAt(this.index);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* @returns {number}
|
|
259
|
+
*/
|
|
260
|
+
get code() {
|
|
261
|
+
return this.expr.charCodeAt(this.index);
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* @param {string} expr a string with the passed in express
|
|
267
|
+
* @returns Jsep
|
|
268
|
+
*/
|
|
269
|
+
constructor(expr) {
|
|
270
|
+
// `index` stores the character number we are currently at
|
|
271
|
+
// All of the gobbles below will modify `index` as we move along
|
|
272
|
+
this.expr = expr;
|
|
273
|
+
this.index = 0;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* static top-level parser
|
|
278
|
+
* @returns {jsep.Expression}
|
|
279
|
+
*/
|
|
280
|
+
static parse(expr) {
|
|
281
|
+
return (new Jsep(expr)).parse();
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Get the longest key length of any object
|
|
286
|
+
* @param {object} obj
|
|
287
|
+
* @returns {number}
|
|
288
|
+
*/
|
|
289
|
+
static getMaxKeyLen(obj) {
|
|
290
|
+
return Math.max(0, ...Object.keys(obj).map(k => k.length));
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* `ch` is a character code in the next three functions
|
|
295
|
+
* @param {number} ch
|
|
296
|
+
* @returns {boolean}
|
|
297
|
+
*/
|
|
298
|
+
static isDecimalDigit(ch) {
|
|
299
|
+
return (ch >= 48 && ch <= 57); // 0...9
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Returns the precedence of a binary operator or `0` if it isn't a binary operator. Can be float.
|
|
304
|
+
* @param {string} op_val
|
|
305
|
+
* @returns {number}
|
|
306
|
+
*/
|
|
307
|
+
static binaryPrecedence(op_val) {
|
|
308
|
+
return Jsep.binary_ops[op_val] || 0;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Looks for start of identifier
|
|
313
|
+
* @param {number} ch
|
|
314
|
+
* @returns {boolean}
|
|
315
|
+
*/
|
|
316
|
+
static isIdentifierStart(ch) {
|
|
317
|
+
return (ch >= 65 && ch <= 90) || // A...Z
|
|
318
|
+
(ch >= 97 && ch <= 122) || // a...z
|
|
319
|
+
(ch >= 128 && !Jsep.binary_ops[String.fromCharCode(ch)]) || // any non-ASCII that is not an operator
|
|
320
|
+
(Jsep.additional_identifier_chars.has(String.fromCharCode(ch))); // additional characters
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* @param {number} ch
|
|
325
|
+
* @returns {boolean}
|
|
326
|
+
*/
|
|
327
|
+
static isIdentifierPart(ch) {
|
|
328
|
+
return Jsep.isIdentifierStart(ch) || Jsep.isDecimalDigit(ch);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* throw error at index of the expression
|
|
333
|
+
* @param {string} message
|
|
334
|
+
* @throws
|
|
335
|
+
*/
|
|
336
|
+
throwError(message) {
|
|
337
|
+
const error = new Error(message + ' at character ' + this.index);
|
|
338
|
+
error.index = this.index;
|
|
339
|
+
error.description = message;
|
|
340
|
+
throw error;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Run a given hook
|
|
345
|
+
* @param {string} name
|
|
346
|
+
* @param {jsep.Expression|false} [node]
|
|
347
|
+
* @returns {?jsep.Expression}
|
|
348
|
+
*/
|
|
349
|
+
runHook(name, node) {
|
|
350
|
+
if (Jsep.hooks[name]) {
|
|
351
|
+
const env = { context: this, node };
|
|
352
|
+
Jsep.hooks.run(name, env);
|
|
353
|
+
return env.node;
|
|
354
|
+
}
|
|
355
|
+
return node;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Runs a given hook until one returns a node
|
|
360
|
+
* @param {string} name
|
|
361
|
+
* @returns {?jsep.Expression}
|
|
362
|
+
*/
|
|
363
|
+
searchHook(name) {
|
|
364
|
+
if (Jsep.hooks[name]) {
|
|
365
|
+
const env = { context: this };
|
|
366
|
+
Jsep.hooks[name].find(function (callback) {
|
|
367
|
+
callback.call(env.context, env);
|
|
368
|
+
return env.node;
|
|
369
|
+
});
|
|
370
|
+
return env.node;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Push `index` up to the next non-space character
|
|
376
|
+
*/
|
|
377
|
+
gobbleSpaces() {
|
|
378
|
+
let ch = this.code;
|
|
379
|
+
// Whitespace
|
|
380
|
+
while (ch === Jsep.SPACE_CODE
|
|
381
|
+
|| ch === Jsep.TAB_CODE
|
|
382
|
+
|| ch === Jsep.LF_CODE
|
|
383
|
+
|| ch === Jsep.CR_CODE) {
|
|
384
|
+
ch = this.expr.charCodeAt(++this.index);
|
|
385
|
+
}
|
|
386
|
+
this.runHook('gobble-spaces');
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Top-level method to parse all expressions and returns compound or single node
|
|
391
|
+
* @returns {jsep.Expression}
|
|
392
|
+
*/
|
|
393
|
+
parse() {
|
|
394
|
+
this.runHook('before-all');
|
|
395
|
+
const nodes = this.gobbleExpressions();
|
|
396
|
+
|
|
397
|
+
// If there's only one expression just try returning the expression
|
|
398
|
+
const node = nodes.length === 1
|
|
399
|
+
? nodes[0]
|
|
400
|
+
: {
|
|
401
|
+
type: Jsep.COMPOUND,
|
|
402
|
+
body: nodes
|
|
403
|
+
};
|
|
404
|
+
return this.runHook('after-all', node);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* top-level parser (but can be reused within as well)
|
|
409
|
+
* @param {number} [untilICode]
|
|
410
|
+
* @returns {jsep.Expression[]}
|
|
411
|
+
*/
|
|
412
|
+
gobbleExpressions(untilICode) {
|
|
413
|
+
let nodes = [], ch_i, node;
|
|
414
|
+
|
|
415
|
+
while (this.index < this.expr.length) {
|
|
416
|
+
ch_i = this.code;
|
|
417
|
+
|
|
418
|
+
// Expressions can be separated by semicolons, commas, or just inferred without any
|
|
419
|
+
// separators
|
|
420
|
+
if (ch_i === Jsep.SEMCOL_CODE || ch_i === Jsep.COMMA_CODE) {
|
|
421
|
+
this.index++; // ignore separators
|
|
422
|
+
}
|
|
423
|
+
else {
|
|
424
|
+
// Try to gobble each expression individually
|
|
425
|
+
if (node = this.gobbleExpression()) {
|
|
426
|
+
nodes.push(node);
|
|
427
|
+
// If we weren't able to find a binary expression and are out of room, then
|
|
428
|
+
// the expression passed in probably has too much
|
|
429
|
+
}
|
|
430
|
+
else if (this.index < this.expr.length) {
|
|
431
|
+
if (ch_i === untilICode) {
|
|
432
|
+
break;
|
|
433
|
+
}
|
|
434
|
+
this.throwError('Unexpected "' + this.char + '"');
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
return nodes;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* The main parsing function.
|
|
444
|
+
* @returns {?jsep.Expression}
|
|
445
|
+
*/
|
|
446
|
+
gobbleExpression() {
|
|
447
|
+
const node = this.searchHook('gobble-expression') || this.gobbleBinaryExpression();
|
|
448
|
+
this.gobbleSpaces();
|
|
449
|
+
|
|
450
|
+
return this.runHook('after-expression', node);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Search for the operation portion of the string (e.g. `+`, `===`)
|
|
455
|
+
* Start by taking the longest possible binary operations (3 characters: `===`, `!==`, `>>>`)
|
|
456
|
+
* and move down from 3 to 2 to 1 character until a matching binary operation is found
|
|
457
|
+
* then, return that binary operation
|
|
458
|
+
* @returns {string|boolean}
|
|
459
|
+
*/
|
|
460
|
+
gobbleBinaryOp() {
|
|
461
|
+
this.gobbleSpaces();
|
|
462
|
+
let to_check = this.expr.substr(this.index, Jsep.max_binop_len);
|
|
463
|
+
let tc_len = to_check.length;
|
|
464
|
+
|
|
465
|
+
while (tc_len > 0) {
|
|
466
|
+
// Don't accept a binary op when it is an identifier.
|
|
467
|
+
// Binary ops that start with a identifier-valid character must be followed
|
|
468
|
+
// by a non identifier-part valid character
|
|
469
|
+
if (Jsep.binary_ops.hasOwnProperty(to_check) && (
|
|
470
|
+
!Jsep.isIdentifierStart(this.code) ||
|
|
471
|
+
(this.index + to_check.length < this.expr.length && !Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + to_check.length)))
|
|
472
|
+
)) {
|
|
473
|
+
this.index += tc_len;
|
|
474
|
+
return to_check;
|
|
475
|
+
}
|
|
476
|
+
to_check = to_check.substr(0, --tc_len);
|
|
477
|
+
}
|
|
478
|
+
return false;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* This function is responsible for gobbling an individual expression,
|
|
483
|
+
* e.g. `1`, `1+2`, `a+(b*2)-Math.sqrt(2)`
|
|
484
|
+
* @returns {?jsep.BinaryExpression}
|
|
485
|
+
*/
|
|
486
|
+
gobbleBinaryExpression() {
|
|
487
|
+
let node, biop, prec, stack, biop_info, left, right, i, cur_biop;
|
|
488
|
+
|
|
489
|
+
// First, try to get the leftmost thing
|
|
490
|
+
// Then, check to see if there's a binary operator operating on that leftmost thing
|
|
491
|
+
// Don't gobbleBinaryOp without a left-hand-side
|
|
492
|
+
left = this.gobbleToken();
|
|
493
|
+
if (!left) {
|
|
494
|
+
return left;
|
|
495
|
+
}
|
|
496
|
+
biop = this.gobbleBinaryOp();
|
|
497
|
+
|
|
498
|
+
// If there wasn't a binary operator, just return the leftmost node
|
|
499
|
+
if (!biop) {
|
|
500
|
+
return left;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
// Otherwise, we need to start a stack to properly place the binary operations in their
|
|
504
|
+
// precedence structure
|
|
505
|
+
biop_info = { value: biop, prec: Jsep.binaryPrecedence(biop), right_a: Jsep.right_associative.has(biop) };
|
|
506
|
+
|
|
507
|
+
right = this.gobbleToken();
|
|
508
|
+
|
|
509
|
+
if (!right) {
|
|
510
|
+
this.throwError("Expected expression after " + biop);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
stack = [left, biop_info, right];
|
|
514
|
+
|
|
515
|
+
// Properly deal with precedence using [recursive descent](http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm)
|
|
516
|
+
while ((biop = this.gobbleBinaryOp())) {
|
|
517
|
+
prec = Jsep.binaryPrecedence(biop);
|
|
518
|
+
|
|
519
|
+
if (prec === 0) {
|
|
520
|
+
this.index -= biop.length;
|
|
521
|
+
break;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
biop_info = { value: biop, prec, right_a: Jsep.right_associative.has(biop) };
|
|
525
|
+
|
|
526
|
+
cur_biop = biop;
|
|
527
|
+
|
|
528
|
+
// Reduce: make a binary expression from the three topmost entries.
|
|
529
|
+
const comparePrev = prev => biop_info.right_a && prev.right_a
|
|
530
|
+
? prec > prev.prec
|
|
531
|
+
: prec <= prev.prec;
|
|
532
|
+
while ((stack.length > 2) && comparePrev(stack[stack.length - 2])) {
|
|
533
|
+
right = stack.pop();
|
|
534
|
+
biop = stack.pop().value;
|
|
535
|
+
left = stack.pop();
|
|
536
|
+
node = {
|
|
537
|
+
type: Jsep.BINARY_EXP,
|
|
538
|
+
operator: biop,
|
|
539
|
+
left,
|
|
540
|
+
right
|
|
541
|
+
};
|
|
542
|
+
stack.push(node);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
node = this.gobbleToken();
|
|
546
|
+
|
|
547
|
+
if (!node) {
|
|
548
|
+
this.throwError("Expected expression after " + cur_biop);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
stack.push(biop_info, node);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
i = stack.length - 1;
|
|
555
|
+
node = stack[i];
|
|
556
|
+
|
|
557
|
+
while (i > 1) {
|
|
558
|
+
node = {
|
|
559
|
+
type: Jsep.BINARY_EXP,
|
|
560
|
+
operator: stack[i - 1].value,
|
|
561
|
+
left: stack[i - 2],
|
|
562
|
+
right: node
|
|
563
|
+
};
|
|
564
|
+
i -= 2;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
return node;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* An individual part of a binary expression:
|
|
572
|
+
* e.g. `foo.bar(baz)`, `1`, `"abc"`, `(a % 2)` (because it's in parenthesis)
|
|
573
|
+
* @returns {boolean|jsep.Expression}
|
|
574
|
+
*/
|
|
575
|
+
gobbleToken() {
|
|
576
|
+
let ch, to_check, tc_len, node;
|
|
577
|
+
|
|
578
|
+
this.gobbleSpaces();
|
|
579
|
+
node = this.searchHook('gobble-token');
|
|
580
|
+
if (node) {
|
|
581
|
+
return this.runHook('after-token', node);
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
ch = this.code;
|
|
585
|
+
|
|
586
|
+
if (Jsep.isDecimalDigit(ch) || ch === Jsep.PERIOD_CODE) {
|
|
587
|
+
// Char code 46 is a dot `.` which can start off a numeric literal
|
|
588
|
+
return this.gobbleNumericLiteral();
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
if (ch === Jsep.SQUOTE_CODE || ch === Jsep.DQUOTE_CODE) {
|
|
592
|
+
// Single or double quotes
|
|
593
|
+
node = this.gobbleStringLiteral();
|
|
594
|
+
}
|
|
595
|
+
else if (ch === Jsep.OBRACK_CODE) {
|
|
596
|
+
node = this.gobbleArray();
|
|
597
|
+
}
|
|
598
|
+
else {
|
|
599
|
+
to_check = this.expr.substr(this.index, Jsep.max_unop_len);
|
|
600
|
+
tc_len = to_check.length;
|
|
601
|
+
|
|
602
|
+
while (tc_len > 0) {
|
|
603
|
+
// Don't accept an unary op when it is an identifier.
|
|
604
|
+
// Unary ops that start with a identifier-valid character must be followed
|
|
605
|
+
// by a non identifier-part valid character
|
|
606
|
+
if (Jsep.unary_ops.hasOwnProperty(to_check) && (
|
|
607
|
+
!Jsep.isIdentifierStart(this.code) ||
|
|
608
|
+
(this.index + to_check.length < this.expr.length && !Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + to_check.length)))
|
|
609
|
+
)) {
|
|
610
|
+
this.index += tc_len;
|
|
611
|
+
const argument = this.gobbleToken();
|
|
612
|
+
if (!argument) {
|
|
613
|
+
this.throwError('missing unaryOp argument');
|
|
614
|
+
}
|
|
615
|
+
return this.runHook('after-token', {
|
|
616
|
+
type: Jsep.UNARY_EXP,
|
|
617
|
+
operator: to_check,
|
|
618
|
+
argument,
|
|
619
|
+
prefix: true
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
to_check = to_check.substr(0, --tc_len);
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
if (Jsep.isIdentifierStart(ch)) {
|
|
627
|
+
node = this.gobbleIdentifier();
|
|
628
|
+
if (Jsep.literals.hasOwnProperty(node.name)) {
|
|
629
|
+
node = {
|
|
630
|
+
type: Jsep.LITERAL,
|
|
631
|
+
value: Jsep.literals[node.name],
|
|
632
|
+
raw: node.name,
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
else if (node.name === Jsep.this_str) {
|
|
636
|
+
node = { type: Jsep.THIS_EXP };
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
else if (ch === Jsep.OPAREN_CODE) { // open parenthesis
|
|
640
|
+
node = this.gobbleGroup();
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
if (!node) {
|
|
645
|
+
return this.runHook('after-token', false);
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
node = this.gobbleTokenProperty(node);
|
|
649
|
+
return this.runHook('after-token', node);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* Gobble properties of of identifiers/strings/arrays/groups.
|
|
654
|
+
* e.g. `foo`, `bar.baz`, `foo['bar'].baz`
|
|
655
|
+
* It also gobbles function calls:
|
|
656
|
+
* e.g. `Math.acos(obj.angle)`
|
|
657
|
+
* @param {jsep.Expression} node
|
|
658
|
+
* @returns {jsep.Expression}
|
|
659
|
+
*/
|
|
660
|
+
gobbleTokenProperty(node) {
|
|
661
|
+
this.gobbleSpaces();
|
|
662
|
+
|
|
663
|
+
let ch = this.code;
|
|
664
|
+
while (ch === Jsep.PERIOD_CODE || ch === Jsep.OBRACK_CODE || ch === Jsep.OPAREN_CODE || ch === Jsep.QUMARK_CODE) {
|
|
665
|
+
let optional;
|
|
666
|
+
if (ch === Jsep.QUMARK_CODE) {
|
|
667
|
+
if (this.expr.charCodeAt(this.index + 1) !== Jsep.PERIOD_CODE) {
|
|
668
|
+
break;
|
|
669
|
+
}
|
|
670
|
+
optional = true;
|
|
671
|
+
this.index += 2;
|
|
672
|
+
this.gobbleSpaces();
|
|
673
|
+
ch = this.code;
|
|
674
|
+
}
|
|
675
|
+
this.index++;
|
|
676
|
+
|
|
677
|
+
if (ch === Jsep.OBRACK_CODE) {
|
|
678
|
+
node = {
|
|
679
|
+
type: Jsep.MEMBER_EXP,
|
|
680
|
+
computed: true,
|
|
681
|
+
object: node,
|
|
682
|
+
property: this.gobbleExpression()
|
|
683
|
+
};
|
|
684
|
+
if (!node.property) {
|
|
685
|
+
this.throwError('Unexpected "' + this.char + '"');
|
|
686
|
+
}
|
|
687
|
+
this.gobbleSpaces();
|
|
688
|
+
ch = this.code;
|
|
689
|
+
if (ch !== Jsep.CBRACK_CODE) {
|
|
690
|
+
this.throwError('Unclosed [');
|
|
691
|
+
}
|
|
692
|
+
this.index++;
|
|
693
|
+
}
|
|
694
|
+
else if (ch === Jsep.OPAREN_CODE) {
|
|
695
|
+
// A function call is being made; gobble all the arguments
|
|
696
|
+
node = {
|
|
697
|
+
type: Jsep.CALL_EXP,
|
|
698
|
+
'arguments': this.gobbleArguments(Jsep.CPAREN_CODE),
|
|
699
|
+
callee: node
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
else if (ch === Jsep.PERIOD_CODE || optional) {
|
|
703
|
+
if (optional) {
|
|
704
|
+
this.index--;
|
|
705
|
+
}
|
|
706
|
+
this.gobbleSpaces();
|
|
707
|
+
node = {
|
|
708
|
+
type: Jsep.MEMBER_EXP,
|
|
709
|
+
computed: false,
|
|
710
|
+
object: node,
|
|
711
|
+
property: this.gobbleIdentifier(),
|
|
712
|
+
};
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
if (optional) {
|
|
716
|
+
node.optional = true;
|
|
717
|
+
} // else leave undefined for compatibility with esprima
|
|
718
|
+
|
|
719
|
+
this.gobbleSpaces();
|
|
720
|
+
ch = this.code;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
return node;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* Parse simple numeric literals: `12`, `3.4`, `.5`. Do this by using a string to
|
|
728
|
+
* keep track of everything in the numeric literal and then calling `parseFloat` on that string
|
|
729
|
+
* @returns {jsep.Literal}
|
|
730
|
+
*/
|
|
731
|
+
gobbleNumericLiteral() {
|
|
732
|
+
let number = '', ch, chCode;
|
|
733
|
+
|
|
734
|
+
while (Jsep.isDecimalDigit(this.code)) {
|
|
735
|
+
number += this.expr.charAt(this.index++);
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
if (this.code === Jsep.PERIOD_CODE) { // can start with a decimal marker
|
|
739
|
+
number += this.expr.charAt(this.index++);
|
|
740
|
+
|
|
741
|
+
while (Jsep.isDecimalDigit(this.code)) {
|
|
742
|
+
number += this.expr.charAt(this.index++);
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
ch = this.char;
|
|
747
|
+
|
|
748
|
+
if (ch === 'e' || ch === 'E') { // exponent marker
|
|
749
|
+
number += this.expr.charAt(this.index++);
|
|
750
|
+
ch = this.char;
|
|
751
|
+
|
|
752
|
+
if (ch === '+' || ch === '-') { // exponent sign
|
|
753
|
+
number += this.expr.charAt(this.index++);
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
while (Jsep.isDecimalDigit(this.code)) { // exponent itself
|
|
757
|
+
number += this.expr.charAt(this.index++);
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
if (!Jsep.isDecimalDigit(this.expr.charCodeAt(this.index - 1)) ) {
|
|
761
|
+
this.throwError('Expected exponent (' + number + this.char + ')');
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
chCode = this.code;
|
|
766
|
+
|
|
767
|
+
// Check to make sure this isn't a variable name that start with a number (123abc)
|
|
768
|
+
if (Jsep.isIdentifierStart(chCode)) {
|
|
769
|
+
this.throwError('Variable names cannot start with a number (' +
|
|
770
|
+
number + this.char + ')');
|
|
771
|
+
}
|
|
772
|
+
else if (chCode === Jsep.PERIOD_CODE || (number.length === 1 && number.charCodeAt(0) === Jsep.PERIOD_CODE)) {
|
|
773
|
+
this.throwError('Unexpected period');
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
return {
|
|
777
|
+
type: Jsep.LITERAL,
|
|
778
|
+
value: parseFloat(number),
|
|
779
|
+
raw: number
|
|
780
|
+
};
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
/**
|
|
784
|
+
* Parses a string literal, staring with single or double quotes with basic support for escape codes
|
|
785
|
+
* e.g. `"hello world"`, `'this is\nJSEP'`
|
|
786
|
+
* @returns {jsep.Literal}
|
|
787
|
+
*/
|
|
788
|
+
gobbleStringLiteral() {
|
|
789
|
+
let str = '';
|
|
790
|
+
const startIndex = this.index;
|
|
791
|
+
const quote = this.expr.charAt(this.index++);
|
|
792
|
+
let closed = false;
|
|
793
|
+
|
|
794
|
+
while (this.index < this.expr.length) {
|
|
795
|
+
let ch = this.expr.charAt(this.index++);
|
|
796
|
+
|
|
797
|
+
if (ch === quote) {
|
|
798
|
+
closed = true;
|
|
799
|
+
break;
|
|
800
|
+
}
|
|
801
|
+
else if (ch === '\\') {
|
|
802
|
+
// Check for all of the common escape codes
|
|
803
|
+
ch = this.expr.charAt(this.index++);
|
|
804
|
+
|
|
805
|
+
switch (ch) {
|
|
806
|
+
case 'n': str += '\n'; break;
|
|
807
|
+
case 'r': str += '\r'; break;
|
|
808
|
+
case 't': str += '\t'; break;
|
|
809
|
+
case 'b': str += '\b'; break;
|
|
810
|
+
case 'f': str += '\f'; break;
|
|
811
|
+
case 'v': str += '\x0B'; break;
|
|
812
|
+
default : str += ch;
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
else {
|
|
816
|
+
str += ch;
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
if (!closed) {
|
|
821
|
+
this.throwError('Unclosed quote after "' + str + '"');
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
return {
|
|
825
|
+
type: Jsep.LITERAL,
|
|
826
|
+
value: str,
|
|
827
|
+
raw: this.expr.substring(startIndex, this.index),
|
|
828
|
+
};
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
/**
|
|
832
|
+
* Gobbles only identifiers
|
|
833
|
+
* e.g.: `foo`, `_value`, `$x1`
|
|
834
|
+
* Also, this function checks if that identifier is a literal:
|
|
835
|
+
* (e.g. `true`, `false`, `null`) or `this`
|
|
836
|
+
* @returns {jsep.Identifier}
|
|
837
|
+
*/
|
|
838
|
+
gobbleIdentifier() {
|
|
839
|
+
let ch = this.code, start = this.index;
|
|
840
|
+
|
|
841
|
+
if (Jsep.isIdentifierStart(ch)) {
|
|
842
|
+
this.index++;
|
|
843
|
+
}
|
|
844
|
+
else {
|
|
845
|
+
this.throwError('Unexpected ' + this.char);
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
while (this.index < this.expr.length) {
|
|
849
|
+
ch = this.code;
|
|
850
|
+
|
|
851
|
+
if (Jsep.isIdentifierPart(ch)) {
|
|
852
|
+
this.index++;
|
|
853
|
+
}
|
|
854
|
+
else {
|
|
855
|
+
break;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
return {
|
|
859
|
+
type: Jsep.IDENTIFIER,
|
|
860
|
+
name: this.expr.slice(start, this.index),
|
|
861
|
+
};
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
/**
|
|
865
|
+
* Gobbles a list of arguments within the context of a function call
|
|
866
|
+
* or array literal. This function also assumes that the opening character
|
|
867
|
+
* `(` or `[` has already been gobbled, and gobbles expressions and commas
|
|
868
|
+
* until the terminator character `)` or `]` is encountered.
|
|
869
|
+
* e.g. `foo(bar, baz)`, `my_func()`, or `[bar, baz]`
|
|
870
|
+
* @param {number} termination
|
|
871
|
+
* @returns {jsep.Expression[]}
|
|
872
|
+
*/
|
|
873
|
+
gobbleArguments(termination) {
|
|
874
|
+
const args = [];
|
|
875
|
+
let closed = false;
|
|
876
|
+
let separator_count = 0;
|
|
877
|
+
|
|
878
|
+
while (this.index < this.expr.length) {
|
|
879
|
+
this.gobbleSpaces();
|
|
880
|
+
let ch_i = this.code;
|
|
881
|
+
|
|
882
|
+
if (ch_i === termination) { // done parsing
|
|
883
|
+
closed = true;
|
|
884
|
+
this.index++;
|
|
885
|
+
|
|
886
|
+
if (termination === Jsep.CPAREN_CODE && separator_count && separator_count >= args.length){
|
|
887
|
+
this.throwError('Unexpected token ' + String.fromCharCode(termination));
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
break;
|
|
891
|
+
}
|
|
892
|
+
else if (ch_i === Jsep.COMMA_CODE) { // between expressions
|
|
893
|
+
this.index++;
|
|
894
|
+
separator_count++;
|
|
895
|
+
|
|
896
|
+
if (separator_count !== args.length) { // missing argument
|
|
897
|
+
if (termination === Jsep.CPAREN_CODE) {
|
|
898
|
+
this.throwError('Unexpected token ,');
|
|
899
|
+
}
|
|
900
|
+
else if (termination === Jsep.CBRACK_CODE) {
|
|
901
|
+
for (let arg = args.length; arg < separator_count; arg++) {
|
|
902
|
+
args.push(null);
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
else if (args.length !== separator_count && separator_count !== 0) {
|
|
908
|
+
// NOTE: `&& separator_count !== 0` allows for either all commas, or all spaces as arguments
|
|
909
|
+
this.throwError('Expected comma');
|
|
910
|
+
}
|
|
911
|
+
else {
|
|
912
|
+
const node = this.gobbleExpression();
|
|
913
|
+
|
|
914
|
+
if (!node || node.type === Jsep.COMPOUND) {
|
|
915
|
+
this.throwError('Expected comma');
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
args.push(node);
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
if (!closed) {
|
|
923
|
+
this.throwError('Expected ' + String.fromCharCode(termination));
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
return args;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
/**
|
|
930
|
+
* Responsible for parsing a group of things within parentheses `()`
|
|
931
|
+
* that have no identifier in front (so not a function call)
|
|
932
|
+
* This function assumes that it needs to gobble the opening parenthesis
|
|
933
|
+
* and then tries to gobble everything within that parenthesis, assuming
|
|
934
|
+
* that the next thing it should see is the close parenthesis. If not,
|
|
935
|
+
* then the expression probably doesn't have a `)`
|
|
936
|
+
* @returns {boolean|jsep.Expression}
|
|
937
|
+
*/
|
|
938
|
+
gobbleGroup() {
|
|
939
|
+
this.index++;
|
|
940
|
+
let nodes = this.gobbleExpressions(Jsep.CPAREN_CODE);
|
|
941
|
+
if (this.code === Jsep.CPAREN_CODE) {
|
|
942
|
+
this.index++;
|
|
943
|
+
if (nodes.length === 1) {
|
|
944
|
+
return nodes[0];
|
|
945
|
+
}
|
|
946
|
+
else if (!nodes.length) {
|
|
947
|
+
return false;
|
|
948
|
+
}
|
|
949
|
+
else {
|
|
950
|
+
return {
|
|
951
|
+
type: Jsep.SEQUENCE_EXP,
|
|
952
|
+
expressions: nodes,
|
|
953
|
+
};
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
else {
|
|
957
|
+
this.throwError('Unclosed (');
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
/**
|
|
962
|
+
* Responsible for parsing Array literals `[1, 2, 3]`
|
|
963
|
+
* This function assumes that it needs to gobble the opening bracket
|
|
964
|
+
* and then tries to gobble the expressions as arguments.
|
|
965
|
+
* @returns {jsep.ArrayExpression}
|
|
966
|
+
*/
|
|
967
|
+
gobbleArray() {
|
|
968
|
+
this.index++;
|
|
969
|
+
|
|
970
|
+
return {
|
|
971
|
+
type: Jsep.ARRAY_EXP,
|
|
972
|
+
elements: this.gobbleArguments(Jsep.CBRACK_CODE)
|
|
973
|
+
};
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
// Static fields:
|
|
978
|
+
const hooks = new Hooks();
|
|
979
|
+
Object.assign(Jsep, {
|
|
980
|
+
hooks,
|
|
981
|
+
plugins: new Plugins(Jsep),
|
|
982
|
+
|
|
983
|
+
// Node Types
|
|
984
|
+
// ----------
|
|
985
|
+
// This is the full set of types that any JSEP node can be.
|
|
986
|
+
// Store them here to save space when minified
|
|
987
|
+
COMPOUND: 'Compound',
|
|
988
|
+
SEQUENCE_EXP: 'SequenceExpression',
|
|
989
|
+
IDENTIFIER: 'Identifier',
|
|
990
|
+
MEMBER_EXP: 'MemberExpression',
|
|
991
|
+
LITERAL: 'Literal',
|
|
992
|
+
THIS_EXP: 'ThisExpression',
|
|
993
|
+
CALL_EXP: 'CallExpression',
|
|
994
|
+
UNARY_EXP: 'UnaryExpression',
|
|
995
|
+
BINARY_EXP: 'BinaryExpression',
|
|
996
|
+
ARRAY_EXP: 'ArrayExpression',
|
|
997
|
+
|
|
998
|
+
TAB_CODE: 9,
|
|
999
|
+
LF_CODE: 10,
|
|
1000
|
+
CR_CODE: 13,
|
|
1001
|
+
SPACE_CODE: 32,
|
|
1002
|
+
PERIOD_CODE: 46, // '.'
|
|
1003
|
+
COMMA_CODE: 44, // ','
|
|
1004
|
+
SQUOTE_CODE: 39, // single quote
|
|
1005
|
+
DQUOTE_CODE: 34, // double quotes
|
|
1006
|
+
OPAREN_CODE: 40, // (
|
|
1007
|
+
CPAREN_CODE: 41, // )
|
|
1008
|
+
OBRACK_CODE: 91, // [
|
|
1009
|
+
CBRACK_CODE: 93, // ]
|
|
1010
|
+
QUMARK_CODE: 63, // ?
|
|
1011
|
+
SEMCOL_CODE: 59, // ;
|
|
1012
|
+
COLON_CODE: 58, // :
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
// Operations
|
|
1016
|
+
// ----------
|
|
1017
|
+
// Use a quickly-accessible map to store all of the unary operators
|
|
1018
|
+
// Values are set to `1` (it really doesn't matter)
|
|
1019
|
+
unary_ops: {
|
|
1020
|
+
'-': 1,
|
|
1021
|
+
'!': 1,
|
|
1022
|
+
'~': 1,
|
|
1023
|
+
'+': 1
|
|
1024
|
+
},
|
|
1025
|
+
|
|
1026
|
+
// Also use a map for the binary operations but set their values to their
|
|
1027
|
+
// binary precedence for quick reference (higher number = higher precedence)
|
|
1028
|
+
// see [Order of operations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence)
|
|
1029
|
+
binary_ops: {
|
|
1030
|
+
'||': 1, '??': 1,
|
|
1031
|
+
'&&': 2, '|': 3, '^': 4, '&': 5,
|
|
1032
|
+
'==': 6, '!=': 6, '===': 6, '!==': 6,
|
|
1033
|
+
'<': 7, '>': 7, '<=': 7, '>=': 7,
|
|
1034
|
+
'<<': 8, '>>': 8, '>>>': 8,
|
|
1035
|
+
'+': 9, '-': 9,
|
|
1036
|
+
'*': 10, '/': 10, '%': 10,
|
|
1037
|
+
'**': 11,
|
|
1038
|
+
},
|
|
1039
|
+
|
|
1040
|
+
// sets specific binary_ops as right-associative
|
|
1041
|
+
right_associative: new Set(['**']),
|
|
1042
|
+
|
|
1043
|
+
// Additional valid identifier chars, apart from a-z, A-Z and 0-9 (except on the starting char)
|
|
1044
|
+
additional_identifier_chars: new Set(['$', '_']),
|
|
1045
|
+
|
|
1046
|
+
// Literals
|
|
1047
|
+
// ----------
|
|
1048
|
+
// Store the values to return for the various literals we may encounter
|
|
1049
|
+
literals: {
|
|
1050
|
+
'true': true,
|
|
1051
|
+
'false': false,
|
|
1052
|
+
'null': null
|
|
1053
|
+
},
|
|
1054
|
+
|
|
1055
|
+
// Except for `this`, which is special. This could be changed to something like `'self'` as well
|
|
1056
|
+
this_str: 'this',
|
|
1057
|
+
});
|
|
1058
|
+
Jsep.max_unop_len = Jsep.getMaxKeyLen(Jsep.unary_ops);
|
|
1059
|
+
Jsep.max_binop_len = Jsep.getMaxKeyLen(Jsep.binary_ops);
|
|
1060
|
+
|
|
1061
|
+
// Backward Compatibility:
|
|
1062
|
+
const jsep = expr => (new Jsep(expr)).parse();
|
|
1063
|
+
const stdClassProps = Object.getOwnPropertyNames(class Test{});
|
|
1064
|
+
Object.getOwnPropertyNames(Jsep)
|
|
1065
|
+
.filter(prop => !stdClassProps.includes(prop) && jsep[prop] === undefined)
|
|
1066
|
+
.forEach((m) => {
|
|
1067
|
+
jsep[m] = Jsep[m];
|
|
1068
|
+
});
|
|
1069
|
+
jsep.Jsep = Jsep; // allows for const { Jsep } = require('jsep');
|
|
1070
|
+
|
|
1071
|
+
const CONDITIONAL_EXP = 'ConditionalExpression';
|
|
1072
|
+
|
|
1073
|
+
var ternary = {
|
|
1074
|
+
name: 'ternary',
|
|
1075
|
+
|
|
1076
|
+
init(jsep) {
|
|
1077
|
+
// Ternary expression: test ? consequent : alternate
|
|
1078
|
+
jsep.hooks.add('after-expression', function gobbleTernary(env) {
|
|
1079
|
+
if (env.node && this.code === jsep.QUMARK_CODE) {
|
|
1080
|
+
this.index++;
|
|
1081
|
+
const test = env.node;
|
|
1082
|
+
const consequent = this.gobbleExpression();
|
|
1083
|
+
|
|
1084
|
+
if (!consequent) {
|
|
1085
|
+
this.throwError('Expected expression');
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
this.gobbleSpaces();
|
|
1089
|
+
|
|
1090
|
+
if (this.code === jsep.COLON_CODE) {
|
|
1091
|
+
this.index++;
|
|
1092
|
+
const alternate = this.gobbleExpression();
|
|
1093
|
+
|
|
1094
|
+
if (!alternate) {
|
|
1095
|
+
this.throwError('Expected expression');
|
|
1096
|
+
}
|
|
1097
|
+
env.node = {
|
|
1098
|
+
type: CONDITIONAL_EXP,
|
|
1099
|
+
test,
|
|
1100
|
+
consequent,
|
|
1101
|
+
alternate,
|
|
1102
|
+
};
|
|
1103
|
+
|
|
1104
|
+
// check for operators of higher priority than ternary (i.e. assignment)
|
|
1105
|
+
// jsep sets || at 1, and assignment at 0.9, and conditional should be between them
|
|
1106
|
+
if (test.operator && jsep.binary_ops[test.operator] <= 0.9) {
|
|
1107
|
+
let newTest = test;
|
|
1108
|
+
while (newTest.right.operator && jsep.binary_ops[newTest.right.operator] <= 0.9) {
|
|
1109
|
+
newTest = newTest.right;
|
|
1110
|
+
}
|
|
1111
|
+
env.node.test = newTest.right;
|
|
1112
|
+
newTest.right = env.node;
|
|
1113
|
+
env.node = test;
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
else {
|
|
1117
|
+
this.throwError('Expected :');
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
});
|
|
1121
|
+
},
|
|
1122
|
+
};
|
|
1123
|
+
|
|
1124
|
+
// Add default plugins:
|
|
1125
|
+
|
|
1126
|
+
jsep.plugins.register(ternary);
|
|
1127
|
+
|
|
1128
|
+
module.exports = jsep;
|
|
1129
|
+
//# sourceMappingURL=jsep.cjs.js.map
|