@cdklabs/cdk-ssm-documents 0.0.70 → 0.0.72

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.
Files changed (1106) hide show
  1. package/.jsii +34 -34
  2. package/lib/construct/synth-utils.js +1 -1
  3. package/lib/document/automation-document.js +1 -1
  4. package/lib/document/command-document.js +1 -1
  5. package/lib/document/document-builder.js +2 -2
  6. package/lib/document/ssm-document.js +1 -1
  7. package/lib/domain/aws-service.js +1 -1
  8. package/lib/domain/choice.js +1 -1
  9. package/lib/domain/data-type.js +1 -1
  10. package/lib/domain/enum/install-action.js +2 -2
  11. package/lib/domain/enum/install-uninstall-repair.js +2 -2
  12. package/lib/domain/enum/installation-type.js +2 -2
  13. package/lib/domain/enum/package-name.js +2 -2
  14. package/lib/domain/input.js +1 -1
  15. package/lib/domain/operation.js +1 -1
  16. package/lib/domain/platform.js +1 -1
  17. package/lib/domain/precondition.js +1 -1
  18. package/lib/incident-response/incident-response.js +3 -3
  19. package/lib/interface/approve-hook.js +2 -2
  20. package/lib/interface/auth-method.js +3 -3
  21. package/lib/interface/aws-invoker.js +2 -2
  22. package/lib/interface/downloadable-content.js +8 -8
  23. package/lib/interface/environment.js +3 -3
  24. package/lib/interface/execute-automation-hook/api-execute-automation-hook.js +1 -1
  25. package/lib/interface/observer.js +1 -1
  26. package/lib/interface/on-failure.js +6 -6
  27. package/lib/interface/pause-hook.js +2 -2
  28. package/lib/interface/run-command-hook/api-run-command-hook.js +1 -1
  29. package/lib/interface/run-document-location.js +2 -2
  30. package/lib/interface/sleep-hook.js +2 -2
  31. package/lib/interface/step-ref.js +1 -1
  32. package/lib/interface/variables/boolean-variable.js +2 -2
  33. package/lib/interface/variables/map-list-variable.js +2 -2
  34. package/lib/interface/variables/number-variable.js +2 -2
  35. package/lib/interface/variables/secure-string-variable.js +4 -4
  36. package/lib/interface/variables/string-list-variable.js +2 -2
  37. package/lib/interface/variables/string-map-variable.js +2 -2
  38. package/lib/interface/variables/string-variable.js +4 -4
  39. package/lib/interface/variables/variable.js +2 -2
  40. package/lib/interface/webhook.js +1 -1
  41. package/lib/parent-steps/automation/approve-step.js +1 -1
  42. package/lib/parent-steps/automation/assert-aws-resource-step.js +1 -1
  43. package/lib/parent-steps/automation/aws-api-step.js +1 -1
  44. package/lib/parent-steps/automation/branch-step.js +1 -1
  45. package/lib/parent-steps/automation/change-instance-state-step.js +3 -3
  46. package/lib/parent-steps/automation/copy-image-step.js +1 -1
  47. package/lib/parent-steps/automation/create-image-step.js +1 -1
  48. package/lib/parent-steps/automation/create-stack-step.js +3 -3
  49. package/lib/parent-steps/automation/create-tags-step.js +3 -3
  50. package/lib/parent-steps/automation/delete-image-step.js +1 -1
  51. package/lib/parent-steps/automation/delete-stack-step.js +1 -1
  52. package/lib/parent-steps/automation/execute-automation-step.js +1 -1
  53. package/lib/parent-steps/automation/execute-script-step.js +5 -5
  54. package/lib/parent-steps/automation/execute-state-machine-step.js +1 -1
  55. package/lib/parent-steps/automation/invoke-lambda-function-step.js +1 -1
  56. package/lib/parent-steps/automation/invoke-webhook-step.js +1 -1
  57. package/lib/parent-steps/automation/pause-step.js +1 -1
  58. package/lib/parent-steps/automation/run-command-step.js +3 -3
  59. package/lib/parent-steps/automation/run-instance-step.js +1 -1
  60. package/lib/parent-steps/automation/sleep-step.js +1 -1
  61. package/lib/parent-steps/automation/update-variable.js +1 -1
  62. package/lib/parent-steps/automation/wait-for-resource-step.js +1 -1
  63. package/lib/parent-steps/automation-step.js +1 -1
  64. package/lib/parent-steps/command/applications-step.js +1 -1
  65. package/lib/parent-steps/command/configure-docker-step.js +1 -1
  66. package/lib/parent-steps/command/configure-package-step.js +1 -1
  67. package/lib/parent-steps/command/domain-join-step.js +1 -1
  68. package/lib/parent-steps/command/download-content-step.js +1 -1
  69. package/lib/parent-steps/command/ps-module-step.js +1 -1
  70. package/lib/parent-steps/command/run-docker-action-step.js +1 -1
  71. package/lib/parent-steps/command/run-document-step.js +1 -1
  72. package/lib/parent-steps/command/run-powershell-script-step.js +1 -1
  73. package/lib/parent-steps/command/run-shell-script-step.js +1 -1
  74. package/lib/parent-steps/command/software-inventory-step.js +1 -1
  75. package/lib/parent-steps/command/update-agent-step.js +1 -1
  76. package/lib/parent-steps/command/update-ssm-agent-step.js +1 -1
  77. package/lib/parent-steps/command-step.js +1 -1
  78. package/lib/parent-steps/step.js +1 -1
  79. package/lib/patterns/automation/composite-step.js +2 -2
  80. package/lib/patterns/automation/reboot-instance-and-wait.js +1 -1
  81. package/lib/patterns/automation/string-step.js +1 -1
  82. package/lib/patterns/document/string-document.js +1 -1
  83. package/lib/patterns/document/timed-document.js +1 -1
  84. package/lib/samples/hello-world.js +1 -1
  85. package/lib/simulation/automation/approve-simulation.js +1 -1
  86. package/lib/simulation/automation/assert-aws-resource-simulation.js +4 -5
  87. package/lib/simulation/automation/automation-simulation-base.js +1 -1
  88. package/lib/simulation/automation/aws-api-simulation.js +1 -1
  89. package/lib/simulation/automation/branch-simulation.js +1 -1
  90. package/lib/simulation/automation/change-instance-state-simulation.js +1 -1
  91. package/lib/simulation/automation/copy-image-simulation.js +1 -1
  92. package/lib/simulation/automation/create-image-simulation.js +1 -1
  93. package/lib/simulation/automation/create-stack-simulation.js +1 -1
  94. package/lib/simulation/automation/create-tags-simulation.js +1 -1
  95. package/lib/simulation/automation/delete-image-simulation.js +1 -1
  96. package/lib/simulation/automation/delete-stack-simulation.js +1 -1
  97. package/lib/simulation/automation/execute-script-simulation.js +1 -1
  98. package/lib/simulation/automation/execute-state-machine-simulation.js +1 -1
  99. package/lib/simulation/automation/invoke-lambda-function-simulation.js +1 -1
  100. package/lib/simulation/automation/invoke-webhook-simulation.js +1 -1
  101. package/lib/simulation/automation/pause-simulation.js +1 -1
  102. package/lib/simulation/automation/run-command-simulation.js +1 -1
  103. package/lib/simulation/automation/run-instance-simulation.js +1 -1
  104. package/lib/simulation/automation/sleep-simulation.js +1 -1
  105. package/lib/simulation/automation/update-variable-simulation.js +1 -1
  106. package/lib/simulation/automation/wait-for-resource-simulation.js +1 -1
  107. package/lib/simulation/automation-step-simulation.js +4 -5
  108. package/lib/simulation/command/command-simulation-base.js +1 -1
  109. package/lib/simulation/command/ps-module-simulation.js +1 -1
  110. package/lib/simulation/command/run-powershell-script-simulation.js +1 -1
  111. package/lib/simulation/command/run-shell-script-simulation.js +1 -1
  112. package/lib/simulation/command-step-simulation.js +1 -1
  113. package/lib/simulation/document/automation-simulation.js +1 -1
  114. package/lib/simulation/document/command-simulation.js +1 -1
  115. package/lib/simulation/simulation.js +1 -1
  116. package/node_modules/@aws-sdk/checksums/package.json +3 -3
  117. package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/index.js +1 -1
  118. package/node_modules/@aws-sdk/client-cloudformation/dist-types/runtimeConfig.browser.d.ts +2 -0
  119. package/node_modules/@aws-sdk/client-cloudformation/dist-types/runtimeConfig.d.ts +2 -0
  120. package/node_modules/@aws-sdk/client-cloudformation/dist-types/runtimeConfig.native.d.ts +2 -0
  121. package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/runtimeConfig.browser.d.ts +2 -0
  122. package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/runtimeConfig.d.ts +2 -0
  123. package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/runtimeConfig.native.d.ts +2 -0
  124. package/node_modules/@aws-sdk/client-cloudformation/package.json +6 -6
  125. package/node_modules/@aws-sdk/client-cloudwatch/dist-cjs/index.js +2 -2
  126. package/node_modules/@aws-sdk/client-cloudwatch/dist-es/schemas/schemas_0.js +1 -1
  127. package/node_modules/@aws-sdk/client-cloudwatch/dist-types/commands/DescribeAlarmsCommand.d.ts +1 -1
  128. package/node_modules/@aws-sdk/client-cloudwatch/dist-types/commands/PutLogAlarmCommand.d.ts +1 -1
  129. package/node_modules/@aws-sdk/client-cloudwatch/dist-types/models/models_0.d.ts +1 -1
  130. package/node_modules/@aws-sdk/client-cloudwatch/dist-types/runtimeConfig.browser.d.ts +2 -0
  131. package/node_modules/@aws-sdk/client-cloudwatch/dist-types/runtimeConfig.d.ts +2 -0
  132. package/node_modules/@aws-sdk/client-cloudwatch/dist-types/runtimeConfig.native.d.ts +2 -0
  133. package/node_modules/@aws-sdk/client-cloudwatch/dist-types/ts3.4/models/models_0.d.ts +1 -1
  134. package/node_modules/@aws-sdk/client-cloudwatch/dist-types/ts3.4/runtimeConfig.browser.d.ts +2 -0
  135. package/node_modules/@aws-sdk/client-cloudwatch/dist-types/ts3.4/runtimeConfig.d.ts +2 -0
  136. package/node_modules/@aws-sdk/client-cloudwatch/dist-types/ts3.4/runtimeConfig.native.d.ts +2 -0
  137. package/node_modules/@aws-sdk/client-cloudwatch/package.json +8 -8
  138. package/node_modules/@aws-sdk/client-ec2/dist-cjs/index.js +1 -1
  139. package/node_modules/@aws-sdk/client-ec2/dist-types/runtimeConfig.browser.d.ts +2 -0
  140. package/node_modules/@aws-sdk/client-ec2/dist-types/runtimeConfig.d.ts +2 -0
  141. package/node_modules/@aws-sdk/client-ec2/dist-types/runtimeConfig.native.d.ts +2 -0
  142. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/runtimeConfig.browser.d.ts +2 -0
  143. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/runtimeConfig.d.ts +2 -0
  144. package/node_modules/@aws-sdk/client-ec2/dist-types/ts3.4/runtimeConfig.native.d.ts +2 -0
  145. package/node_modules/@aws-sdk/client-ec2/package.json +8 -8
  146. package/node_modules/@aws-sdk/client-iam/dist-cjs/index.js +1 -1
  147. package/node_modules/@aws-sdk/client-iam/dist-types/runtimeConfig.browser.d.ts +2 -0
  148. package/node_modules/@aws-sdk/client-iam/dist-types/runtimeConfig.d.ts +2 -0
  149. package/node_modules/@aws-sdk/client-iam/dist-types/runtimeConfig.native.d.ts +2 -0
  150. package/node_modules/@aws-sdk/client-iam/dist-types/ts3.4/runtimeConfig.browser.d.ts +2 -0
  151. package/node_modules/@aws-sdk/client-iam/dist-types/ts3.4/runtimeConfig.d.ts +2 -0
  152. package/node_modules/@aws-sdk/client-iam/dist-types/ts3.4/runtimeConfig.native.d.ts +2 -0
  153. package/node_modules/@aws-sdk/client-iam/package.json +7 -7
  154. package/node_modules/@aws-sdk/client-lambda/dist-cjs/index.js +1 -1
  155. package/node_modules/@aws-sdk/client-lambda/dist-types/runtimeConfig.browser.d.ts +2 -0
  156. package/node_modules/@aws-sdk/client-lambda/dist-types/runtimeConfig.d.ts +2 -0
  157. package/node_modules/@aws-sdk/client-lambda/dist-types/runtimeConfig.native.d.ts +2 -0
  158. package/node_modules/@aws-sdk/client-lambda/dist-types/ts3.4/runtimeConfig.browser.d.ts +2 -0
  159. package/node_modules/@aws-sdk/client-lambda/dist-types/ts3.4/runtimeConfig.d.ts +2 -0
  160. package/node_modules/@aws-sdk/client-lambda/dist-types/ts3.4/runtimeConfig.native.d.ts +2 -0
  161. package/node_modules/@aws-sdk/client-lambda/package.json +7 -7
  162. package/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +1 -1
  163. package/node_modules/@aws-sdk/client-s3/dist-types/runtimeConfig.browser.d.ts +2 -0
  164. package/node_modules/@aws-sdk/client-s3/dist-types/runtimeConfig.d.ts +2 -0
  165. package/node_modules/@aws-sdk/client-s3/dist-types/runtimeConfig.native.d.ts +2 -0
  166. package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/runtimeConfig.browser.d.ts +2 -0
  167. package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/runtimeConfig.d.ts +2 -0
  168. package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/runtimeConfig.native.d.ts +2 -0
  169. package/node_modules/@aws-sdk/client-s3/package.json +11 -11
  170. package/node_modules/@aws-sdk/client-sns/dist-cjs/index.js +1 -1
  171. package/node_modules/@aws-sdk/client-sns/dist-types/runtimeConfig.browser.d.ts +2 -0
  172. package/node_modules/@aws-sdk/client-sns/dist-types/runtimeConfig.d.ts +2 -0
  173. package/node_modules/@aws-sdk/client-sns/dist-types/runtimeConfig.native.d.ts +2 -0
  174. package/node_modules/@aws-sdk/client-sns/dist-types/ts3.4/runtimeConfig.browser.d.ts +2 -0
  175. package/node_modules/@aws-sdk/client-sns/dist-types/ts3.4/runtimeConfig.d.ts +2 -0
  176. package/node_modules/@aws-sdk/client-sns/dist-types/ts3.4/runtimeConfig.native.d.ts +2 -0
  177. package/node_modules/@aws-sdk/client-sns/package.json +6 -6
  178. package/node_modules/@aws-sdk/client-sqs/dist-cjs/index.js +1 -1
  179. package/node_modules/@aws-sdk/client-sqs/dist-types/runtimeConfig.browser.d.ts +2 -0
  180. package/node_modules/@aws-sdk/client-sqs/dist-types/runtimeConfig.d.ts +2 -0
  181. package/node_modules/@aws-sdk/client-sqs/dist-types/runtimeConfig.native.d.ts +2 -0
  182. package/node_modules/@aws-sdk/client-sqs/dist-types/ts3.4/runtimeConfig.browser.d.ts +2 -0
  183. package/node_modules/@aws-sdk/client-sqs/dist-types/ts3.4/runtimeConfig.d.ts +2 -0
  184. package/node_modules/@aws-sdk/client-sqs/dist-types/ts3.4/runtimeConfig.native.d.ts +2 -0
  185. package/node_modules/@aws-sdk/client-sqs/package.json +8 -8
  186. package/node_modules/@aws-sdk/client-ssm/dist-cjs/index.js +8 -7
  187. package/node_modules/@aws-sdk/client-ssm/dist-es/schemas/schemas_0.js +7 -6
  188. package/node_modules/@aws-sdk/client-ssm/dist-types/commands/DescribeAutomationExecutionsCommand.d.ts +1 -0
  189. package/node_modules/@aws-sdk/client-ssm/dist-types/commands/DescribeAutomationStepExecutionsCommand.d.ts +1 -0
  190. package/node_modules/@aws-sdk/client-ssm/dist-types/commands/GetAutomationExecutionCommand.d.ts +2 -0
  191. package/node_modules/@aws-sdk/client-ssm/dist-types/models/models_0.d.ts +16 -1
  192. package/node_modules/@aws-sdk/client-ssm/dist-types/runtimeConfig.browser.d.ts +2 -0
  193. package/node_modules/@aws-sdk/client-ssm/dist-types/runtimeConfig.d.ts +2 -0
  194. package/node_modules/@aws-sdk/client-ssm/dist-types/runtimeConfig.native.d.ts +2 -0
  195. package/node_modules/@aws-sdk/client-ssm/dist-types/ts3.4/models/models_0.d.ts +3 -0
  196. package/node_modules/@aws-sdk/client-ssm/dist-types/ts3.4/runtimeConfig.browser.d.ts +2 -0
  197. package/node_modules/@aws-sdk/client-ssm/dist-types/ts3.4/runtimeConfig.d.ts +2 -0
  198. package/node_modules/@aws-sdk/client-ssm/dist-types/ts3.4/runtimeConfig.native.d.ts +2 -0
  199. package/node_modules/@aws-sdk/client-ssm/package.json +6 -6
  200. package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +66 -28
  201. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +133 -15
  202. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js +7 -2
  203. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js +28 -14
  204. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.browser.js +1 -0
  205. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.js +3 -0
  206. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/clock-skew-node-config.js +8 -0
  207. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/index.js +1 -1
  208. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js +3 -3
  209. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.browser.js +9 -0
  210. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js +5 -1
  211. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js +1 -0
  212. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js +12 -6
  213. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js +2 -1
  214. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/isClockSkewed.js +1 -1
  215. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js +10 -1
  216. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js +10 -0
  217. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/detectBufferParsing.js +18 -0
  218. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/experimental/BufferJsonShapeDeserializer.js +180 -0
  219. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/experimental/ByteJsonShapeSerializer.js +483 -0
  220. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js +22 -3
  221. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/needsReviver.js +41 -0
  222. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js +33 -13
  223. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/writeKey.js +3 -0
  224. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js +4 -0
  225. package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.d.ts +2 -1
  226. package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.browser.d.ts +6 -0
  227. package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.d.ts +7 -0
  228. package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/clock-skew-node-config.d.ts +13 -0
  229. package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/index.d.ts +1 -1
  230. package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.d.ts +22 -6
  231. package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/index.browser.d.ts +11 -0
  232. package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/index.d.ts +7 -1
  233. package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/utils/getDateHeader.d.ts +4 -0
  234. package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.d.ts +22 -6
  235. package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/utils/index.d.ts +2 -1
  236. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/detectBufferParsing.d.ts +1 -0
  237. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/experimental/BufferJsonShapeDeserializer.d.ts +29 -0
  238. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/experimental/ByteJsonShapeSerializer.d.ts +57 -0
  239. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/needsReviver.d.ts +11 -0
  240. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/parseJsonBody.d.ts +7 -2
  241. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/writeKey.d.ts +4 -0
  242. package/node_modules/@aws-sdk/core/dist-types/ts3.4/api-extractor-type-index.d.ts +7 -4
  243. package/node_modules/@aws-sdk/core/dist-types/ts3.4/index.d.ts +21 -61
  244. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/AccountIdEndpointModeConfigResolver.d.ts +27 -13
  245. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/AccountIdEndpointModeConstants.d.ts +16 -4
  246. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/NodeAccountIdEndpointModeConfigOptions.d.ts +14 -5
  247. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/account-id-endpoint/index.d.ts +5 -16
  248. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/emitWarningIfUnsupportedVersion.d.ts +11 -4
  249. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.browser.d.ts +47 -107
  250. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.d.ts +39 -112
  251. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/index.native.d.ts +48 -107
  252. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/longPollMiddleware.d.ts +14 -13
  253. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-host-header/hostHeaderMiddleware.d.ts +35 -25
  254. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-logger/loggerMiddleware.d.ts +4 -14
  255. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/configuration.d.ts +6 -2
  256. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.browser.d.ts +5 -2
  257. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.d.ts +5 -2
  258. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.browser.d.ts +6 -2
  259. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.d.ts +10 -2
  260. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.native.d.ts +6 -2
  261. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/check-features.d.ts +20 -16
  262. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/configurations.d.ts +44 -21
  263. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/constants.d.ts +7 -7
  264. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/encode-features.d.ts +5 -2
  265. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/middleware-user-agent/user-agent-middleware.d.ts +18 -18
  266. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/awsRegionConfig.d.ts +11 -8
  267. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/extensions.d.ts +16 -14
  268. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.browser.d.ts +4 -1
  269. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.d.ts +14 -7
  270. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/region-config-resolver/stsRegionDefaultResolver.native.d.ts +4 -1
  271. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/setCredentialFeature.d.ts +7 -6
  272. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/setFeature.d.ts +12 -6
  273. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/setTokenFeature.d.ts +7 -6
  274. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/aws.d.ts +2 -2
  275. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/isVirtualHostableS3Bucket.d.ts +5 -4
  276. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/parseArn.d.ts +7 -2
  277. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/partition.d.ts +38 -28
  278. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/aws/partitions.d.ts +638 -647
  279. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/lib/isIpAddress.d.ts +1 -1
  280. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/resolveDefaultAwsRegionalEndpointsConfig.d.ts +56 -29
  281. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/resolveEndpoint.d.ts +1 -1
  282. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/EndpointError.d.ts +1 -1
  283. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/EndpointRuleObject.d.ts +1 -6
  284. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/ErrorRuleObject.d.ts +1 -1
  285. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/RuleSetObject.d.ts +1 -1
  286. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/TreeRuleObject.d.ts +1 -1
  287. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-endpoints/types/shared.d.ts +1 -12
  288. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/configurations.d.ts +7 -4
  289. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/createUserAgentStringParsingProvider.d.ts +14 -7
  290. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.browser.d.ts +2 -7
  291. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.d.ts +27 -18
  292. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-browser/defaultUserAgent.native.d.ts +18 -13
  293. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/crt-availability.d.ts +8 -3
  294. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/defaultUserAgent.d.ts +28 -17
  295. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/getRuntimeUserAgentPair.d.ts +6 -2
  296. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/is-crt-available.d.ts +5 -2
  297. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/client/util-user-agent-node/nodeAppIdConfigOptions.d.ts +13 -4
  298. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.d.ts +10 -9
  299. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.d.ts +44 -37
  300. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.d.ts +5 -2
  301. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.browser.d.ts +6 -0
  302. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.d.ts +7 -0
  303. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/clock-skew-node-config.d.ts +13 -0
  304. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/index.d.ts +7 -23
  305. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.d.ts +38 -13
  306. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.d.ts +133 -56
  307. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/index.browser.d.ts +11 -0
  308. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/index.d.ts +9 -24
  309. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getArrayForCommaSeparatedString.d.ts +8 -1
  310. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getBearerTokenEnvKey.d.ts +6 -1
  311. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getDateHeader.d.ts +8 -1
  312. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.d.ts +8 -1
  313. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.d.ts +26 -4
  314. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/index.d.ts +4 -3
  315. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/utils/isClockSkewed.d.ts +9 -1
  316. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/ConfigurableSerdeContext.d.ts +8 -5
  317. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/ProtocolLib.d.ts +74 -40
  318. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/UnionSerde.d.ts +24 -9
  319. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.d.ts +25 -36
  320. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/coercing-serializers.d.ts +18 -3
  321. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/common.d.ts +2 -5
  322. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +22 -27
  323. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_0Protocol.d.ts +22 -21
  324. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_1Protocol.d.ts +22 -21
  325. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +29 -49
  326. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsRestJsonProtocol.d.ts +36 -49
  327. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonCodec.d.ts +19 -13
  328. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonShapeDeserializer.d.ts +13 -13
  329. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonShapeSerializer.d.ts +28 -18
  330. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/awsExpectUnion.d.ts +7 -1
  331. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/detectBufferParsing.d.ts +1 -0
  332. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/BufferJsonShapeDeserializer.d.ts +29 -0
  333. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/ByteJsonShapeSerializer.d.ts +57 -0
  334. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReplacer.d.ts +21 -7
  335. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReviver.d.ts +15 -7
  336. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/needsReviver.d.ts +11 -0
  337. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +22 -9
  338. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/AwsEc2QueryProtocol.d.ts +27 -18
  339. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/AwsQueryProtocol.d.ts +49 -57
  340. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/QuerySerializerSettings.d.ts +13 -7
  341. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/QueryShapeSerializer.d.ts +16 -21
  342. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/writeKey.d.ts +4 -0
  343. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/AwsRestXmlProtocol.d.ts +31 -47
  344. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/XmlCodec.d.ts +14 -17
  345. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/XmlShapeDeserializer.d.ts +20 -15
  346. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/XmlShapeSerializer.d.ts +21 -21
  347. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/parseXmlBody.d.ts +13 -4
  348. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/simpleFormatXml.d.ts +6 -1
  349. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/index.d.ts +3 -3
  350. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/util-arn-parser/arn.d.ts +32 -14
  351. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/util-format-url/format-url.d.ts +2 -4
  352. package/node_modules/@aws-sdk/core/package.json +11 -6
  353. package/node_modules/@aws-sdk/credential-provider-env/package.json +3 -3
  354. package/node_modules/@aws-sdk/credential-provider-http/package.json +5 -5
  355. package/node_modules/@aws-sdk/credential-provider-ini/package.json +11 -11
  356. package/node_modules/@aws-sdk/credential-provider-login/package.json +4 -4
  357. package/node_modules/@aws-sdk/credential-provider-node/package.json +9 -9
  358. package/node_modules/@aws-sdk/credential-provider-process/package.json +3 -3
  359. package/node_modules/@aws-sdk/credential-provider-sso/package.json +5 -5
  360. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +4 -4
  361. package/node_modules/@aws-sdk/middleware-sdk-ec2/package.json +4 -4
  362. package/node_modules/@aws-sdk/middleware-sdk-s3/package.json +4 -4
  363. package/node_modules/@aws-sdk/middleware-sdk-sqs/package.json +2 -2
  364. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  365. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  366. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  367. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  368. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  369. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.browser.d.ts +2 -0
  370. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.d.ts +2 -0
  371. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/runtimeConfig.native.d.ts +2 -0
  372. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.browser.d.ts +2 -0
  373. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.d.ts +2 -0
  374. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/runtimeConfig.native.d.ts +2 -0
  375. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.browser.d.ts +2 -0
  376. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.d.ts +2 -0
  377. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/runtimeConfig.native.d.ts +2 -0
  378. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.browser.d.ts +2 -0
  379. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.d.ts +2 -0
  380. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/runtimeConfig.native.d.ts +2 -0
  381. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.browser.d.ts +2 -0
  382. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.d.ts +2 -0
  383. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/runtimeConfig.native.d.ts +2 -0
  384. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.browser.d.ts +2 -0
  385. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.d.ts +2 -0
  386. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/runtimeConfig.native.d.ts +2 -0
  387. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.browser.d.ts +2 -0
  388. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.d.ts +2 -0
  389. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/runtimeConfig.native.d.ts +2 -0
  390. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.browser.d.ts +2 -0
  391. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.d.ts +2 -0
  392. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/runtimeConfig.native.d.ts +2 -0
  393. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.browser.d.ts +2 -0
  394. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.d.ts +2 -0
  395. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/runtimeConfig.native.d.ts +2 -0
  396. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.browser.d.ts +2 -0
  397. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.d.ts +2 -0
  398. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/runtimeConfig.native.d.ts +2 -0
  399. package/node_modules/@aws-sdk/nested-clients/package.json +6 -6
  400. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +2 -2
  401. package/node_modules/@aws-sdk/token-providers/package.json +4 -4
  402. package/node_modules/@aws-sdk/xml-builder/dist-cjs/index.js +14 -4
  403. package/node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js +14 -4
  404. package/node_modules/@aws-sdk/xml-builder/package.json +1 -1
  405. package/node_modules/@jsep-plugin/assignment/LICENSE +20 -0
  406. package/node_modules/@jsep-plugin/assignment/README.md +37 -0
  407. package/node_modules/@jsep-plugin/assignment/dist/cjs/index.cjs.js +95 -0
  408. package/node_modules/@jsep-plugin/assignment/dist/cjs/index.cjs.js.map +1 -0
  409. package/node_modules/@jsep-plugin/assignment/dist/cjs/index.cjs.min.js +2 -0
  410. package/node_modules/@jsep-plugin/assignment/dist/cjs/index.cjs.min.js.map +1 -0
  411. package/node_modules/@jsep-plugin/assignment/dist/cjs/package.json +3 -0
  412. package/node_modules/@jsep-plugin/assignment/dist/iife/index.iife.js +98 -0
  413. package/node_modules/@jsep-plugin/assignment/dist/iife/index.iife.js.map +1 -0
  414. package/node_modules/@jsep-plugin/assignment/dist/iife/index.iife.min.js +2 -0
  415. package/node_modules/@jsep-plugin/assignment/dist/iife/index.iife.min.js.map +1 -0
  416. package/node_modules/@jsep-plugin/assignment/dist/index.js +92 -0
  417. package/node_modules/@jsep-plugin/assignment/dist/index.min.js +2 -0
  418. package/node_modules/@jsep-plugin/assignment/dist/index.min.js.map +1 -0
  419. package/node_modules/@jsep-plugin/assignment/package.json +39 -0
  420. package/node_modules/@jsep-plugin/assignment/types/tsd.d.ts +39 -0
  421. package/node_modules/@jsep-plugin/regex/LICENSE +20 -0
  422. package/node_modules/@jsep-plugin/regex/README.md +36 -0
  423. package/node_modules/@jsep-plugin/regex/dist/cjs/index.cjs.js +66 -0
  424. package/node_modules/@jsep-plugin/regex/dist/cjs/index.cjs.js.map +1 -0
  425. package/node_modules/@jsep-plugin/regex/dist/cjs/index.cjs.min.js +2 -0
  426. package/node_modules/@jsep-plugin/regex/dist/cjs/index.cjs.min.js.map +1 -0
  427. package/node_modules/@jsep-plugin/regex/dist/cjs/package.json +3 -0
  428. package/node_modules/@jsep-plugin/regex/dist/iife/index.iife.js +69 -0
  429. package/node_modules/@jsep-plugin/regex/dist/iife/index.iife.js.map +1 -0
  430. package/node_modules/@jsep-plugin/regex/dist/iife/index.iife.min.js +2 -0
  431. package/node_modules/@jsep-plugin/regex/dist/iife/index.iife.min.js.map +1 -0
  432. package/node_modules/@jsep-plugin/regex/dist/index.js +63 -0
  433. package/node_modules/@jsep-plugin/regex/dist/index.min.js +2 -0
  434. package/node_modules/@jsep-plugin/regex/dist/index.min.js.map +1 -0
  435. package/node_modules/@jsep-plugin/regex/package.json +39 -0
  436. package/node_modules/@jsep-plugin/regex/types/tsd.d.ts +7 -0
  437. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +1 -1
  438. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +34 -11
  439. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +34 -11
  440. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +1 -0
  441. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +1 -0
  442. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +1 -0
  443. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +2 -2
  444. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +2 -2
  445. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +2 -2
  446. package/node_modules/@smithy/core/dist-es/submodules/cbor/cbor-decode.js +1 -1
  447. package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +34 -11
  448. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +1 -0
  449. package/node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/constants.js +1 -0
  450. package/node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js +2 -2
  451. package/node_modules/@smithy/core/dist-types/submodules/event-streams/EventStreamSerde.d.ts +10 -2
  452. package/node_modules/@smithy/core/dist-types/submodules/retry/service-error-classification/constants.d.ts +1 -0
  453. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/event-streams/EventStreamSerde.d.ts +10 -2
  454. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/retry/service-error-classification/constants.d.ts +1 -0
  455. package/node_modules/@smithy/core/package.json +1 -1
  456. package/node_modules/@smithy/credential-provider-imds/package.json +2 -2
  457. package/node_modules/@smithy/fetch-http-handler/package.json +2 -2
  458. package/node_modules/@smithy/middleware-compression/package.json +2 -2
  459. package/node_modules/@smithy/node-http-handler/package.json +2 -2
  460. package/node_modules/@smithy/signature-v4/package.json +2 -2
  461. package/node_modules/jsep/LICENSE +20 -0
  462. package/node_modules/jsep/README.md +208 -0
  463. package/node_modules/jsep/dist/cjs/jsep.cjs.js +1129 -0
  464. package/node_modules/jsep/dist/cjs/jsep.cjs.js.map +1 -0
  465. package/node_modules/jsep/dist/cjs/jsep.cjs.min.js +2 -0
  466. package/node_modules/jsep/dist/cjs/jsep.cjs.min.js.map +1 -0
  467. package/node_modules/jsep/dist/cjs/package.json +3 -0
  468. package/node_modules/jsep/dist/iife/jsep.iife.js +1132 -0
  469. package/node_modules/jsep/dist/iife/jsep.iife.js.map +1 -0
  470. package/node_modules/jsep/dist/iife/jsep.iife.min.js +2 -0
  471. package/node_modules/jsep/dist/iife/jsep.iife.min.js.map +1 -0
  472. package/node_modules/jsep/dist/jsep.js +1126 -0
  473. package/node_modules/jsep/dist/jsep.min.js +2 -0
  474. package/node_modules/jsep/dist/jsep.min.js.map +1 -0
  475. package/node_modules/jsep/package.json +153 -0
  476. package/node_modules/jsep/typings/tsd.d.ts +180 -0
  477. package/node_modules/jsonpath-plus/.claude/settings.local.json +9 -0
  478. package/node_modules/jsonpath-plus/CHANGES.md +453 -0
  479. package/node_modules/jsonpath-plus/LICENSE +22 -0
  480. package/node_modules/jsonpath-plus/README.md +412 -0
  481. package/node_modules/jsonpath-plus/SECURITY.md +38 -0
  482. package/node_modules/jsonpath-plus/bin/jsonpath-cli.js +36 -0
  483. package/node_modules/jsonpath-plus/dist/index-browser-esm.js +2164 -0
  484. package/node_modules/jsonpath-plus/dist/index-browser-esm.min.js +2 -0
  485. package/node_modules/jsonpath-plus/dist/index-browser-esm.min.js.map +1 -0
  486. package/node_modules/jsonpath-plus/dist/index-browser-umd.cjs +2172 -0
  487. package/node_modules/jsonpath-plus/dist/index-browser-umd.min.cjs +2 -0
  488. package/node_modules/jsonpath-plus/dist/index-browser-umd.min.cjs.map +1 -0
  489. package/node_modules/jsonpath-plus/dist/index-node-cjs.cjs +2076 -0
  490. package/node_modules/jsonpath-plus/dist/index-node-esm.js +2074 -0
  491. package/node_modules/jsonpath-plus/package.json +141 -0
  492. package/node_modules/jsonpath-plus/pnpm-workspace.yaml +2 -0
  493. package/node_modules/jsonpath-plus/src/Safe-Script.js +208 -0
  494. package/node_modules/jsonpath-plus/src/jsonpath-browser.js +102 -0
  495. package/node_modules/jsonpath-plus/src/jsonpath-node.js +8 -0
  496. package/node_modules/jsonpath-plus/src/jsonpath.d.ts +226 -0
  497. package/node_modules/jsonpath-plus/src/jsonpath.js +784 -0
  498. package/package.json +12 -12
  499. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/experimental/SinglePassJsonShapeSerializer.js +0 -135
  500. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/experimental/SinglePassJsonShapeSerializer.d.ts +0 -27
  501. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/experimental/SinglePassJsonShapeSerializer.d.ts +0 -17
  502. package/node_modules/escodegen/LICENSE.BSD +0 -21
  503. package/node_modules/escodegen/README.md +0 -84
  504. package/node_modules/escodegen/bin/escodegen.js +0 -77
  505. package/node_modules/escodegen/bin/esgenerate.js +0 -64
  506. package/node_modules/escodegen/escodegen.js +0 -2667
  507. package/node_modules/escodegen/package.json +0 -63
  508. package/node_modules/esprima/LICENSE.BSD +0 -21
  509. package/node_modules/esprima/README.md +0 -46
  510. package/node_modules/esprima/bin/esparse.js +0 -139
  511. package/node_modules/esprima/bin/esvalidate.js +0 -236
  512. package/node_modules/esprima/dist/esprima.js +0 -6709
  513. package/node_modules/esprima/package.json +0 -112
  514. package/node_modules/estraverse/.jshintrc +0 -16
  515. package/node_modules/estraverse/LICENSE.BSD +0 -19
  516. package/node_modules/estraverse/README.md +0 -153
  517. package/node_modules/estraverse/estraverse.js +0 -805
  518. package/node_modules/estraverse/gulpfile.js +0 -70
  519. package/node_modules/estraverse/package.json +0 -40
  520. package/node_modules/esutils/LICENSE.BSD +0 -19
  521. package/node_modules/esutils/README.md +0 -174
  522. package/node_modules/esutils/lib/ast.js +0 -144
  523. package/node_modules/esutils/lib/code.js +0 -135
  524. package/node_modules/esutils/lib/keyword.js +0 -165
  525. package/node_modules/esutils/lib/utils.js +0 -33
  526. package/node_modules/esutils/package.json +0 -44
  527. package/node_modules/jsonpath/.jscsrc +0 -60
  528. package/node_modules/jsonpath/.jshintrc +0 -9
  529. package/node_modules/jsonpath/.travis.yml +0 -3
  530. package/node_modules/jsonpath/Dockerfile +0 -1
  531. package/node_modules/jsonpath/Gruntfile.js +0 -83
  532. package/node_modules/jsonpath/LICENSE +0 -7
  533. package/node_modules/jsonpath/README.md +0 -216
  534. package/node_modules/jsonpath/bin/generate_parser.js +0 -8
  535. package/node_modules/jsonpath/fig.yml +0 -5
  536. package/node_modules/jsonpath/generated/parser.js +0 -721
  537. package/node_modules/jsonpath/include/action.js +0 -4
  538. package/node_modules/jsonpath/include/module.js +0 -34
  539. package/node_modules/jsonpath/index.js +0 -1
  540. package/node_modules/jsonpath/jsonpath.js +0 -7093
  541. package/node_modules/jsonpath/jsonpath.min.js +0 -4
  542. package/node_modules/jsonpath/lib/aesprim.js +0 -18
  543. package/node_modules/jsonpath/lib/dict.js +0 -6
  544. package/node_modules/jsonpath/lib/grammar.js +0 -106
  545. package/node_modules/jsonpath/lib/handlers.js +0 -409
  546. package/node_modules/jsonpath/lib/index.js +0 -304
  547. package/node_modules/jsonpath/lib/parser.js +0 -21
  548. package/node_modules/jsonpath/lib/slice.js +0 -41
  549. package/node_modules/jsonpath/node_modules/esprima/LICENSE.BSD +0 -19
  550. package/node_modules/jsonpath/node_modules/esprima/README.md +0 -24
  551. package/node_modules/jsonpath/node_modules/esprima/bin/esparse.js +0 -127
  552. package/node_modules/jsonpath/node_modules/esprima/bin/esvalidate.js +0 -199
  553. package/node_modules/jsonpath/node_modules/esprima/esprima.js +0 -3772
  554. package/node_modules/jsonpath/node_modules/esprima/package.json +0 -83
  555. package/node_modules/jsonpath/node_modules/esprima/test/compat.js +0 -241
  556. package/node_modules/jsonpath/node_modules/esprima/test/reflect.js +0 -422
  557. package/node_modules/jsonpath/node_modules/esprima/test/run.js +0 -67
  558. package/node_modules/jsonpath/node_modules/esprima/test/runner.js +0 -495
  559. package/node_modules/jsonpath/node_modules/esprima/test/test.js +0 -25593
  560. package/node_modules/jsonpath/package.json +0 -45
  561. package/node_modules/jsonpath/test/data/store.json +0 -31
  562. package/node_modules/jsonpath/test/lessons.js +0 -38
  563. package/node_modules/jsonpath/test/parse.js +0 -164
  564. package/node_modules/jsonpath/test/query.js +0 -359
  565. package/node_modules/jsonpath/test/security.js +0 -238
  566. package/node_modules/jsonpath/test/slice.js +0 -57
  567. package/node_modules/jsonpath/test/stringify.js +0 -54
  568. package/node_modules/jsonpath/test/sugar.js +0 -72
  569. package/node_modules/source-map/LICENSE +0 -28
  570. package/node_modules/source-map/README.md +0 -742
  571. package/node_modules/source-map/dist/source-map.debug.js +0 -3234
  572. package/node_modules/source-map/dist/source-map.js +0 -3233
  573. package/node_modules/source-map/dist/source-map.min.js +0 -2
  574. package/node_modules/source-map/dist/source-map.min.js.map +0 -1
  575. package/node_modules/source-map/lib/array-set.js +0 -121
  576. package/node_modules/source-map/lib/base64-vlq.js +0 -140
  577. package/node_modules/source-map/lib/base64.js +0 -67
  578. package/node_modules/source-map/lib/binary-search.js +0 -111
  579. package/node_modules/source-map/lib/mapping-list.js +0 -79
  580. package/node_modules/source-map/lib/quick-sort.js +0 -114
  581. package/node_modules/source-map/lib/source-map-consumer.js +0 -1145
  582. package/node_modules/source-map/lib/source-map-generator.js +0 -425
  583. package/node_modules/source-map/lib/source-node.js +0 -413
  584. package/node_modules/source-map/lib/util.js +0 -488
  585. package/node_modules/source-map/package.json +0 -73
  586. package/node_modules/source-map/source-map.d.ts +0 -98
  587. package/node_modules/source-map/source-map.js +0 -8
  588. package/node_modules/static-eval/.travis.yml +0 -18
  589. package/node_modules/static-eval/CHANGELOG.md +0 -21
  590. package/node_modules/static-eval/LICENSE +0 -20
  591. package/node_modules/static-eval/example/eval.js +0 -7
  592. package/node_modules/static-eval/example/vars.js +0 -11
  593. package/node_modules/static-eval/index.js +0 -209
  594. package/node_modules/static-eval/package.json +0 -54
  595. package/node_modules/static-eval/readme.markdown +0 -87
  596. package/node_modules/static-eval/security.md +0 -15
  597. package/node_modules/static-eval/test/eval.js +0 -177
  598. package/node_modules/static-eval/test/prop.js +0 -16
  599. package/node_modules/static-eval/test/template-strings.js +0 -33
  600. package/node_modules/underscore/LICENSE +0 -22
  601. package/node_modules/underscore/README.md +0 -34
  602. package/node_modules/underscore/amd/_baseCreate.js +0 -21
  603. package/node_modules/underscore/amd/_baseIteratee.js +0 -15
  604. package/node_modules/underscore/amd/_cb.js +0 -12
  605. package/node_modules/underscore/amd/_chainResult.js +0 -10
  606. package/node_modules/underscore/amd/_collectNonEnumProps.js +0 -42
  607. package/node_modules/underscore/amd/_createAssigner.js +0 -24
  608. package/node_modules/underscore/amd/_createEscaper.js +0 -21
  609. package/node_modules/underscore/amd/_createIndexFinder.js +0 -30
  610. package/node_modules/underscore/amd/_createPredicateIndexFinder.js +0 -18
  611. package/node_modules/underscore/amd/_createReduce.js +0 -30
  612. package/node_modules/underscore/amd/_createSizePropertyCheck.js +0 -13
  613. package/node_modules/underscore/amd/_deepGet.js +0 -15
  614. package/node_modules/underscore/amd/_escapeMap.js +0 -15
  615. package/node_modules/underscore/amd/_executeBound.js +0 -16
  616. package/node_modules/underscore/amd/_flatten.js +0 -32
  617. package/node_modules/underscore/amd/_getByteLength.js +0 -8
  618. package/node_modules/underscore/amd/_getLength.js +0 -8
  619. package/node_modules/underscore/amd/_group.js +0 -18
  620. package/node_modules/underscore/amd/_has.js +0 -10
  621. package/node_modules/underscore/amd/_hasObjectTag.js +0 -7
  622. package/node_modules/underscore/amd/_isArrayLike.js +0 -11
  623. package/node_modules/underscore/amd/_isBufferLike.js +0 -9
  624. package/node_modules/underscore/amd/_keyInObj.js +0 -11
  625. package/node_modules/underscore/amd/_methodFingerprint.js +0 -44
  626. package/node_modules/underscore/amd/_optimizeCb.js +0 -27
  627. package/node_modules/underscore/amd/_set.js +0 -21
  628. package/node_modules/underscore/amd/_setup.js +0 -70
  629. package/node_modules/underscore/amd/_shallowProperty.js +0 -12
  630. package/node_modules/underscore/amd/_stringTagBug.js +0 -16
  631. package/node_modules/underscore/amd/_tagTester.js +0 -13
  632. package/node_modules/underscore/amd/_toBufferView.js +0 -15
  633. package/node_modules/underscore/amd/_toPath.js +0 -11
  634. package/node_modules/underscore/amd/_unescapeMap.js +0 -8
  635. package/node_modules/underscore/amd/after.js +0 -14
  636. package/node_modules/underscore/amd/allKeys.js +0 -15
  637. package/node_modules/underscore/amd/before.js +0 -18
  638. package/node_modules/underscore/amd/bind.js +0 -15
  639. package/node_modules/underscore/amd/bindAll.js +0 -19
  640. package/node_modules/underscore/amd/chain.js +0 -12
  641. package/node_modules/underscore/amd/chunk.js +0 -17
  642. package/node_modules/underscore/amd/clone.js +0 -11
  643. package/node_modules/underscore/amd/compact.js +0 -10
  644. package/node_modules/underscore/amd/compose.js +0 -18
  645. package/node_modules/underscore/amd/constant.js +0 -12
  646. package/node_modules/underscore/amd/contains.js +0 -12
  647. package/node_modules/underscore/amd/countBy.js +0 -12
  648. package/node_modules/underscore/amd/create.js +0 -14
  649. package/node_modules/underscore/amd/debounce.js +0 -43
  650. package/node_modules/underscore/amd/defaults.js +0 -8
  651. package/node_modules/underscore/amd/defer.js +0 -9
  652. package/node_modules/underscore/amd/delay.js +0 -13
  653. package/node_modules/underscore/amd/difference.js +0 -14
  654. package/node_modules/underscore/amd/each.js +0 -25
  655. package/node_modules/underscore/amd/escape.js +0 -8
  656. package/node_modules/underscore/amd/every.js +0 -17
  657. package/node_modules/underscore/amd/extend.js +0 -8
  658. package/node_modules/underscore/amd/extendOwn.js +0 -10
  659. package/node_modules/underscore/amd/filter.js +0 -15
  660. package/node_modules/underscore/amd/find.js +0 -12
  661. package/node_modules/underscore/amd/findIndex.js +0 -8
  662. package/node_modules/underscore/amd/findKey.js +0 -15
  663. package/node_modules/underscore/amd/findLastIndex.js +0 -8
  664. package/node_modules/underscore/amd/findWhere.js +0 -11
  665. package/node_modules/underscore/amd/first.js +0 -13
  666. package/node_modules/underscore/amd/flatten.js +0 -11
  667. package/node_modules/underscore/amd/functions.js +0 -14
  668. package/node_modules/underscore/amd/get.js +0 -14
  669. package/node_modules/underscore/amd/groupBy.js +0 -11
  670. package/node_modules/underscore/amd/has.js +0 -19
  671. package/node_modules/underscore/amd/identity.js +0 -10
  672. package/node_modules/underscore/amd/index-default.js +0 -12
  673. package/node_modules/underscore/amd/index.js +0 -154
  674. package/node_modules/underscore/amd/indexBy.js +0 -11
  675. package/node_modules/underscore/amd/indexOf.js +0 -11
  676. package/node_modules/underscore/amd/initial.js +0 -12
  677. package/node_modules/underscore/amd/intersection.js +0 -22
  678. package/node_modules/underscore/amd/invert.js +0 -15
  679. package/node_modules/underscore/amd/invoke.js +0 -28
  680. package/node_modules/underscore/amd/isArguments.js +0 -19
  681. package/node_modules/underscore/amd/isArray.js +0 -9
  682. package/node_modules/underscore/amd/isArrayBuffer.js +0 -7
  683. package/node_modules/underscore/amd/isBoolean.js +0 -10
  684. package/node_modules/underscore/amd/isDataView.js +0 -15
  685. package/node_modules/underscore/amd/isDate.js +0 -7
  686. package/node_modules/underscore/amd/isElement.js +0 -10
  687. package/node_modules/underscore/amd/isEmpty.js +0 -18
  688. package/node_modules/underscore/amd/isEqual.js +0 -133
  689. package/node_modules/underscore/amd/isError.js +0 -7
  690. package/node_modules/underscore/amd/isFinite.js +0 -10
  691. package/node_modules/underscore/amd/isFunction.js +0 -18
  692. package/node_modules/underscore/amd/isMap.js +0 -7
  693. package/node_modules/underscore/amd/isMatch.js +0 -17
  694. package/node_modules/underscore/amd/isNaN.js +0 -10
  695. package/node_modules/underscore/amd/isNull.js +0 -10
  696. package/node_modules/underscore/amd/isNumber.js +0 -7
  697. package/node_modules/underscore/amd/isObject.js +0 -11
  698. package/node_modules/underscore/amd/isRegExp.js +0 -7
  699. package/node_modules/underscore/amd/isSet.js +0 -7
  700. package/node_modules/underscore/amd/isString.js +0 -7
  701. package/node_modules/underscore/amd/isSymbol.js +0 -7
  702. package/node_modules/underscore/amd/isTypedArray.js +0 -16
  703. package/node_modules/underscore/amd/isUndefined.js +0 -10
  704. package/node_modules/underscore/amd/isWeakMap.js +0 -7
  705. package/node_modules/underscore/amd/isWeakSet.js +0 -7
  706. package/node_modules/underscore/amd/iteratee.js +0 -13
  707. package/node_modules/underscore/amd/keys.js +0 -17
  708. package/node_modules/underscore/amd/last.js +0 -13
  709. package/node_modules/underscore/amd/lastIndexOf.js +0 -9
  710. package/node_modules/underscore/amd/map.js +0 -18
  711. package/node_modules/underscore/amd/mapObject.js +0 -19
  712. package/node_modules/underscore/amd/matcher.js +0 -14
  713. package/node_modules/underscore/amd/max.js +0 -30
  714. package/node_modules/underscore/amd/memoize.js +0 -17
  715. package/node_modules/underscore/amd/min.js +0 -30
  716. package/node_modules/underscore/amd/mixin.js +0 -18
  717. package/node_modules/underscore/amd/negate.js +0 -12
  718. package/node_modules/underscore/amd/noop.js +0 -8
  719. package/node_modules/underscore/amd/now.js +0 -10
  720. package/node_modules/underscore/amd/object.js +0 -20
  721. package/node_modules/underscore/amd/omit.js +0 -20
  722. package/node_modules/underscore/amd/once.js +0 -9
  723. package/node_modules/underscore/amd/pairs.js +0 -17
  724. package/node_modules/underscore/amd/partial.js +0 -25
  725. package/node_modules/underscore/amd/partition.js +0 -11
  726. package/node_modules/underscore/amd/pick.js +0 -25
  727. package/node_modules/underscore/amd/pluck.js +0 -10
  728. package/node_modules/underscore/amd/property.js +0 -14
  729. package/node_modules/underscore/amd/propertyOf.js +0 -13
  730. package/node_modules/underscore/amd/random.js +0 -14
  731. package/node_modules/underscore/amd/range.js +0 -27
  732. package/node_modules/underscore/amd/reduce.js +0 -9
  733. package/node_modules/underscore/amd/reduceRight.js +0 -8
  734. package/node_modules/underscore/amd/reject.js +0 -10
  735. package/node_modules/underscore/amd/rest.js +0 -12
  736. package/node_modules/underscore/amd/restArguments.js +0 -33
  737. package/node_modules/underscore/amd/result.js +0 -25
  738. package/node_modules/underscore/amd/sample.js +0 -27
  739. package/node_modules/underscore/amd/set.js +0 -15
  740. package/node_modules/underscore/amd/shuffle.js +0 -10
  741. package/node_modules/underscore/amd/size.js +0 -11
  742. package/node_modules/underscore/amd/some.js +0 -17
  743. package/node_modules/underscore/amd/sortBy.js +0 -26
  744. package/node_modules/underscore/amd/sortedIndex.js +0 -18
  745. package/node_modules/underscore/amd/tap.js +0 -13
  746. package/node_modules/underscore/amd/template.js +0 -103
  747. package/node_modules/underscore/amd/templateSettings.js +0 -13
  748. package/node_modules/underscore/amd/throttle.js +0 -51
  749. package/node_modules/underscore/amd/times.js +0 -13
  750. package/node_modules/underscore/amd/toArray.js +0 -18
  751. package/node_modules/underscore/amd/toPath.js +0 -12
  752. package/node_modules/underscore/amd/underscore-array-methods.js +0 -30
  753. package/node_modules/underscore/amd/underscore.js +0 -29
  754. package/node_modules/underscore/amd/unescape.js +0 -8
  755. package/node_modules/underscore/amd/union.js +0 -11
  756. package/node_modules/underscore/amd/uniq.js +0 -37
  757. package/node_modules/underscore/amd/uniqueId.js +0 -13
  758. package/node_modules/underscore/amd/unzip.js +0 -17
  759. package/node_modules/underscore/amd/values.js +0 -16
  760. package/node_modules/underscore/amd/where.js +0 -11
  761. package/node_modules/underscore/amd/without.js +0 -10
  762. package/node_modules/underscore/amd/wrap.js +0 -12
  763. package/node_modules/underscore/amd/zip.js +0 -9
  764. package/node_modules/underscore/cjs/_baseCreate.js +0 -20
  765. package/node_modules/underscore/cjs/_baseIteratee.js +0 -19
  766. package/node_modules/underscore/cjs/_cb.js +0 -12
  767. package/node_modules/underscore/cjs/_chainResult.js +0 -8
  768. package/node_modules/underscore/cjs/_collectNonEnumProps.js +0 -42
  769. package/node_modules/underscore/cjs/_createAssigner.js +0 -20
  770. package/node_modules/underscore/cjs/_createEscaper.js +0 -19
  771. package/node_modules/underscore/cjs/_createIndexFinder.js +0 -30
  772. package/node_modules/underscore/cjs/_createPredicateIndexFinder.js +0 -17
  773. package/node_modules/underscore/cjs/_createReduce.js +0 -30
  774. package/node_modules/underscore/cjs/_createSizePropertyCheck.js +0 -11
  775. package/node_modules/underscore/cjs/_deepGet.js +0 -11
  776. package/node_modules/underscore/cjs/_escapeMap.js +0 -11
  777. package/node_modules/underscore/cjs/_executeBound.js +0 -15
  778. package/node_modules/underscore/cjs/_flatten.js +0 -33
  779. package/node_modules/underscore/cjs/_getByteLength.js +0 -6
  780. package/node_modules/underscore/cjs/_getLength.js +0 -6
  781. package/node_modules/underscore/cjs/_group.js +0 -17
  782. package/node_modules/underscore/cjs/_has.js +0 -8
  783. package/node_modules/underscore/cjs/_hasObjectTag.js +0 -5
  784. package/node_modules/underscore/cjs/_isArrayLike.js +0 -10
  785. package/node_modules/underscore/cjs/_isBufferLike.js +0 -8
  786. package/node_modules/underscore/cjs/_keyInObj.js +0 -7
  787. package/node_modules/underscore/cjs/_methodFingerprint.js +0 -44
  788. package/node_modules/underscore/cjs/_optimizeCb.js +0 -23
  789. package/node_modules/underscore/cjs/_set.js +0 -21
  790. package/node_modules/underscore/cjs/_setup.js +0 -66
  791. package/node_modules/underscore/cjs/_shallowProperty.js +0 -8
  792. package/node_modules/underscore/cjs/_stringTagBug.js +0 -15
  793. package/node_modules/underscore/cjs/_tagTester.js +0 -11
  794. package/node_modules/underscore/cjs/_toBufferView.js +0 -13
  795. package/node_modules/underscore/cjs/_toPath.js +0 -10
  796. package/node_modules/underscore/cjs/_unescapeMap.js +0 -7
  797. package/node_modules/underscore/cjs/after.js +0 -10
  798. package/node_modules/underscore/cjs/allKeys.js +0 -15
  799. package/node_modules/underscore/cjs/before.js +0 -14
  800. package/node_modules/underscore/cjs/bind.js +0 -15
  801. package/node_modules/underscore/cjs/bindAll.js +0 -19
  802. package/node_modules/underscore/cjs/chain.js +0 -10
  803. package/node_modules/underscore/cjs/chunk.js +0 -15
  804. package/node_modules/underscore/cjs/clone.js +0 -11
  805. package/node_modules/underscore/cjs/compact.js +0 -8
  806. package/node_modules/underscore/cjs/compose.js +0 -14
  807. package/node_modules/underscore/cjs/constant.js +0 -8
  808. package/node_modules/underscore/cjs/contains.js +0 -12
  809. package/node_modules/underscore/cjs/countBy.js +0 -11
  810. package/node_modules/underscore/cjs/create.js +0 -13
  811. package/node_modules/underscore/cjs/debounce.js +0 -42
  812. package/node_modules/underscore/cjs/defaults.js +0 -7
  813. package/node_modules/underscore/cjs/defer.js +0 -9
  814. package/node_modules/underscore/cjs/delay.js +0 -11
  815. package/node_modules/underscore/cjs/difference.js +0 -15
  816. package/node_modules/underscore/cjs/each.js +0 -25
  817. package/node_modules/underscore/cjs/escape.js +0 -7
  818. package/node_modules/underscore/cjs/every.js +0 -17
  819. package/node_modules/underscore/cjs/extend.js +0 -7
  820. package/node_modules/underscore/cjs/extendOwn.js +0 -9
  821. package/node_modules/underscore/cjs/filter.js +0 -14
  822. package/node_modules/underscore/cjs/find.js +0 -12
  823. package/node_modules/underscore/cjs/findIndex.js +0 -6
  824. package/node_modules/underscore/cjs/findKey.js +0 -14
  825. package/node_modules/underscore/cjs/findLastIndex.js +0 -6
  826. package/node_modules/underscore/cjs/findWhere.js +0 -10
  827. package/node_modules/underscore/cjs/first.js +0 -11
  828. package/node_modules/underscore/cjs/flatten.js +0 -9
  829. package/node_modules/underscore/cjs/functions.js +0 -12
  830. package/node_modules/underscore/cjs/get.js +0 -14
  831. package/node_modules/underscore/cjs/groupBy.js +0 -10
  832. package/node_modules/underscore/cjs/has.js +0 -18
  833. package/node_modules/underscore/cjs/identity.js +0 -6
  834. package/node_modules/underscore/cjs/index-default.js +0 -11
  835. package/node_modules/underscore/cjs/index.js +0 -278
  836. package/node_modules/underscore/cjs/indexBy.js +0 -9
  837. package/node_modules/underscore/cjs/indexOf.js +0 -11
  838. package/node_modules/underscore/cjs/initial.js +0 -10
  839. package/node_modules/underscore/cjs/intersection.js +0 -21
  840. package/node_modules/underscore/cjs/invert.js +0 -13
  841. package/node_modules/underscore/cjs/invoke.js +0 -30
  842. package/node_modules/underscore/cjs/isArguments.js +0 -18
  843. package/node_modules/underscore/cjs/isArray.js +0 -8
  844. package/node_modules/underscore/cjs/isArrayBuffer.js +0 -5
  845. package/node_modules/underscore/cjs/isBoolean.js +0 -8
  846. package/node_modules/underscore/cjs/isDataView.js +0 -16
  847. package/node_modules/underscore/cjs/isDate.js +0 -5
  848. package/node_modules/underscore/cjs/isElement.js +0 -6
  849. package/node_modules/underscore/cjs/isEmpty.js +0 -20
  850. package/node_modules/underscore/cjs/isEqual.js +0 -140
  851. package/node_modules/underscore/cjs/isError.js +0 -5
  852. package/node_modules/underscore/cjs/isFinite.js +0 -9
  853. package/node_modules/underscore/cjs/isFunction.js +0 -17
  854. package/node_modules/underscore/cjs/isMap.js +0 -7
  855. package/node_modules/underscore/cjs/isMatch.js +0 -15
  856. package/node_modules/underscore/cjs/isNaN.js +0 -9
  857. package/node_modules/underscore/cjs/isNull.js +0 -6
  858. package/node_modules/underscore/cjs/isNumber.js +0 -5
  859. package/node_modules/underscore/cjs/isObject.js +0 -7
  860. package/node_modules/underscore/cjs/isRegExp.js +0 -5
  861. package/node_modules/underscore/cjs/isSet.js +0 -7
  862. package/node_modules/underscore/cjs/isString.js +0 -5
  863. package/node_modules/underscore/cjs/isSymbol.js +0 -5
  864. package/node_modules/underscore/cjs/isTypedArray.js +0 -17
  865. package/node_modules/underscore/cjs/isUndefined.js +0 -6
  866. package/node_modules/underscore/cjs/isWeakMap.js +0 -7
  867. package/node_modules/underscore/cjs/isWeakSet.js +0 -5
  868. package/node_modules/underscore/cjs/iteratee.js +0 -12
  869. package/node_modules/underscore/cjs/keys.js +0 -18
  870. package/node_modules/underscore/cjs/last.js +0 -11
  871. package/node_modules/underscore/cjs/lastIndexOf.js +0 -8
  872. package/node_modules/underscore/cjs/map.js +0 -18
  873. package/node_modules/underscore/cjs/mapObject.js +0 -18
  874. package/node_modules/underscore/cjs/matcher.js +0 -13
  875. package/node_modules/underscore/cjs/max.js +0 -31
  876. package/node_modules/underscore/cjs/memoize.js +0 -15
  877. package/node_modules/underscore/cjs/min.js +0 -31
  878. package/node_modules/underscore/cjs/mixin.js +0 -20
  879. package/node_modules/underscore/cjs/negate.js +0 -8
  880. package/node_modules/underscore/cjs/noop.js +0 -4
  881. package/node_modules/underscore/cjs/now.js +0 -6
  882. package/node_modules/underscore/cjs/object.js +0 -18
  883. package/node_modules/underscore/cjs/omit.js +0 -24
  884. package/node_modules/underscore/cjs/once.js +0 -8
  885. package/node_modules/underscore/cjs/pairs.js +0 -15
  886. package/node_modules/underscore/cjs/partial.js +0 -25
  887. package/node_modules/underscore/cjs/partition.js +0 -9
  888. package/node_modules/underscore/cjs/pick.js +0 -28
  889. package/node_modules/underscore/cjs/pluck.js +0 -9
  890. package/node_modules/underscore/cjs/property.js +0 -13
  891. package/node_modules/underscore/cjs/propertyOf.js +0 -12
  892. package/node_modules/underscore/cjs/random.js +0 -10
  893. package/node_modules/underscore/cjs/range.js +0 -23
  894. package/node_modules/underscore/cjs/reduce.js +0 -7
  895. package/node_modules/underscore/cjs/reduceRight.js +0 -6
  896. package/node_modules/underscore/cjs/reject.js +0 -10
  897. package/node_modules/underscore/cjs/rest.js +0 -10
  898. package/node_modules/underscore/cjs/restArguments.js +0 -29
  899. package/node_modules/underscore/cjs/result.js +0 -24
  900. package/node_modules/underscore/cjs/sample.js +0 -29
  901. package/node_modules/underscore/cjs/set.js +0 -15
  902. package/node_modules/underscore/cjs/shuffle.js +0 -8
  903. package/node_modules/underscore/cjs/size.js +0 -10
  904. package/node_modules/underscore/cjs/some.js +0 -17
  905. package/node_modules/underscore/cjs/sortBy.js +0 -26
  906. package/node_modules/underscore/cjs/sortedIndex.js +0 -17
  907. package/node_modules/underscore/cjs/tap.js +0 -9
  908. package/node_modules/underscore/cjs/template.js +0 -103
  909. package/node_modules/underscore/cjs/templateSettings.js +0 -11
  910. package/node_modules/underscore/cjs/throttle.js +0 -49
  911. package/node_modules/underscore/cjs/times.js +0 -11
  912. package/node_modules/underscore/cjs/toArray.js +0 -22
  913. package/node_modules/underscore/cjs/toPath.js +0 -11
  914. package/node_modules/underscore/cjs/underscore-array-methods.js +0 -31
  915. package/node_modules/underscore/cjs/underscore.js +0 -27
  916. package/node_modules/underscore/cjs/unescape.js +0 -7
  917. package/node_modules/underscore/cjs/union.js +0 -11
  918. package/node_modules/underscore/cjs/uniq.js +0 -38
  919. package/node_modules/underscore/cjs/uniqueId.js +0 -9
  920. package/node_modules/underscore/cjs/unzip.js +0 -17
  921. package/node_modules/underscore/cjs/values.js +0 -14
  922. package/node_modules/underscore/cjs/where.js +0 -10
  923. package/node_modules/underscore/cjs/without.js +0 -9
  924. package/node_modules/underscore/cjs/wrap.js +0 -10
  925. package/node_modules/underscore/cjs/zip.js +0 -8
  926. package/node_modules/underscore/modules/.eslintrc +0 -21
  927. package/node_modules/underscore/modules/_baseCreate.js +0 -18
  928. package/node_modules/underscore/modules/_baseIteratee.js +0 -17
  929. package/node_modules/underscore/modules/_cb.js +0 -10
  930. package/node_modules/underscore/modules/_chainResult.js +0 -6
  931. package/node_modules/underscore/modules/_collectNonEnumProps.js +0 -40
  932. package/node_modules/underscore/modules/_createAssigner.js +0 -18
  933. package/node_modules/underscore/modules/_createEscaper.js +0 -17
  934. package/node_modules/underscore/modules/_createIndexFinder.js +0 -28
  935. package/node_modules/underscore/modules/_createPredicateIndexFinder.js +0 -15
  936. package/node_modules/underscore/modules/_createReduce.js +0 -28
  937. package/node_modules/underscore/modules/_createSizePropertyCheck.js +0 -9
  938. package/node_modules/underscore/modules/_deepGet.js +0 -9
  939. package/node_modules/underscore/modules/_escapeMap.js +0 -9
  940. package/node_modules/underscore/modules/_executeBound.js +0 -13
  941. package/node_modules/underscore/modules/_flatten.js +0 -31
  942. package/node_modules/underscore/modules/_getByteLength.js +0 -4
  943. package/node_modules/underscore/modules/_getLength.js +0 -4
  944. package/node_modules/underscore/modules/_group.js +0 -15
  945. package/node_modules/underscore/modules/_has.js +0 -6
  946. package/node_modules/underscore/modules/_hasObjectTag.js +0 -3
  947. package/node_modules/underscore/modules/_isArrayLike.js +0 -8
  948. package/node_modules/underscore/modules/_isBufferLike.js +0 -6
  949. package/node_modules/underscore/modules/_keyInObj.js +0 -5
  950. package/node_modules/underscore/modules/_methodFingerprint.js +0 -37
  951. package/node_modules/underscore/modules/_optimizeCb.js +0 -21
  952. package/node_modules/underscore/modules/_setup.js +0 -43
  953. package/node_modules/underscore/modules/_shallowProperty.js +0 -6
  954. package/node_modules/underscore/modules/_stringTagBug.js +0 -10
  955. package/node_modules/underscore/modules/_tagTester.js +0 -9
  956. package/node_modules/underscore/modules/_toBufferView.js +0 -11
  957. package/node_modules/underscore/modules/_toPath.js +0 -8
  958. package/node_modules/underscore/modules/_unescapeMap.js +0 -5
  959. package/node_modules/underscore/modules/after.js +0 -8
  960. package/node_modules/underscore/modules/allKeys.js +0 -13
  961. package/node_modules/underscore/modules/before.js +0 -12
  962. package/node_modules/underscore/modules/bind.js +0 -13
  963. package/node_modules/underscore/modules/bindAll.js +0 -17
  964. package/node_modules/underscore/modules/chain.js +0 -8
  965. package/node_modules/underscore/modules/chunk.js +0 -13
  966. package/node_modules/underscore/modules/clone.js +0 -9
  967. package/node_modules/underscore/modules/compact.js +0 -6
  968. package/node_modules/underscore/modules/compose.js +0 -12
  969. package/node_modules/underscore/modules/constant.js +0 -6
  970. package/node_modules/underscore/modules/contains.js +0 -10
  971. package/node_modules/underscore/modules/countBy.js +0 -9
  972. package/node_modules/underscore/modules/create.js +0 -11
  973. package/node_modules/underscore/modules/debounce.js +0 -40
  974. package/node_modules/underscore/modules/defaults.js +0 -5
  975. package/node_modules/underscore/modules/defer.js +0 -7
  976. package/node_modules/underscore/modules/delay.js +0 -9
  977. package/node_modules/underscore/modules/difference.js +0 -13
  978. package/node_modules/underscore/modules/each.js +0 -23
  979. package/node_modules/underscore/modules/escape.js +0 -5
  980. package/node_modules/underscore/modules/every.js +0 -15
  981. package/node_modules/underscore/modules/extend.js +0 -5
  982. package/node_modules/underscore/modules/extendOwn.js +0 -7
  983. package/node_modules/underscore/modules/filter.js +0 -12
  984. package/node_modules/underscore/modules/find.js +0 -10
  985. package/node_modules/underscore/modules/findIndex.js +0 -4
  986. package/node_modules/underscore/modules/findKey.js +0 -12
  987. package/node_modules/underscore/modules/findLastIndex.js +0 -4
  988. package/node_modules/underscore/modules/findWhere.js +0 -8
  989. package/node_modules/underscore/modules/first.js +0 -9
  990. package/node_modules/underscore/modules/flatten.js +0 -7
  991. package/node_modules/underscore/modules/functions.js +0 -10
  992. package/node_modules/underscore/modules/get.js +0 -12
  993. package/node_modules/underscore/modules/groupBy.js +0 -8
  994. package/node_modules/underscore/modules/has.js +0 -16
  995. package/node_modules/underscore/modules/identity.js +0 -4
  996. package/node_modules/underscore/modules/index-all.js +0 -18
  997. package/node_modules/underscore/modules/index-default.js +0 -27
  998. package/node_modules/underscore/modules/index.js +0 -200
  999. package/node_modules/underscore/modules/indexBy.js +0 -7
  1000. package/node_modules/underscore/modules/indexOf.js +0 -9
  1001. package/node_modules/underscore/modules/initial.js +0 -8
  1002. package/node_modules/underscore/modules/intersection.js +0 -19
  1003. package/node_modules/underscore/modules/invert.js +0 -11
  1004. package/node_modules/underscore/modules/invoke.js +0 -28
  1005. package/node_modules/underscore/modules/isArguments.js +0 -16
  1006. package/node_modules/underscore/modules/isArray.js +0 -6
  1007. package/node_modules/underscore/modules/isArrayBuffer.js +0 -3
  1008. package/node_modules/underscore/modules/isBoolean.js +0 -6
  1009. package/node_modules/underscore/modules/isDataView.js +0 -14
  1010. package/node_modules/underscore/modules/isDate.js +0 -3
  1011. package/node_modules/underscore/modules/isElement.js +0 -4
  1012. package/node_modules/underscore/modules/isEmpty.js +0 -18
  1013. package/node_modules/underscore/modules/isEqual.js +0 -138
  1014. package/node_modules/underscore/modules/isError.js +0 -3
  1015. package/node_modules/underscore/modules/isFinite.js +0 -7
  1016. package/node_modules/underscore/modules/isFunction.js +0 -15
  1017. package/node_modules/underscore/modules/isMap.js +0 -5
  1018. package/node_modules/underscore/modules/isMatch.js +0 -13
  1019. package/node_modules/underscore/modules/isNaN.js +0 -7
  1020. package/node_modules/underscore/modules/isNull.js +0 -4
  1021. package/node_modules/underscore/modules/isNumber.js +0 -3
  1022. package/node_modules/underscore/modules/isObject.js +0 -5
  1023. package/node_modules/underscore/modules/isRegExp.js +0 -3
  1024. package/node_modules/underscore/modules/isSet.js +0 -5
  1025. package/node_modules/underscore/modules/isString.js +0 -3
  1026. package/node_modules/underscore/modules/isSymbol.js +0 -3
  1027. package/node_modules/underscore/modules/isTypedArray.js +0 -15
  1028. package/node_modules/underscore/modules/isUndefined.js +0 -4
  1029. package/node_modules/underscore/modules/isWeakMap.js +0 -5
  1030. package/node_modules/underscore/modules/isWeakSet.js +0 -3
  1031. package/node_modules/underscore/modules/iteratee.js +0 -10
  1032. package/node_modules/underscore/modules/keys.js +0 -16
  1033. package/node_modules/underscore/modules/last.js +0 -9
  1034. package/node_modules/underscore/modules/lastIndexOf.js +0 -6
  1035. package/node_modules/underscore/modules/map.js +0 -16
  1036. package/node_modules/underscore/modules/mapObject.js +0 -16
  1037. package/node_modules/underscore/modules/matcher.js +0 -11
  1038. package/node_modules/underscore/modules/max.js +0 -29
  1039. package/node_modules/underscore/modules/memoize.js +0 -13
  1040. package/node_modules/underscore/modules/min.js +0 -29
  1041. package/node_modules/underscore/modules/mixin.js +0 -18
  1042. package/node_modules/underscore/modules/negate.js +0 -6
  1043. package/node_modules/underscore/modules/noop.js +0 -2
  1044. package/node_modules/underscore/modules/now.js +0 -4
  1045. package/node_modules/underscore/modules/object.js +0 -16
  1046. package/node_modules/underscore/modules/omit.js +0 -22
  1047. package/node_modules/underscore/modules/once.js +0 -6
  1048. package/node_modules/underscore/modules/package.json +0 -1
  1049. package/node_modules/underscore/modules/pairs.js +0 -13
  1050. package/node_modules/underscore/modules/partial.js +0 -24
  1051. package/node_modules/underscore/modules/partition.js +0 -7
  1052. package/node_modules/underscore/modules/pick.js +0 -26
  1053. package/node_modules/underscore/modules/pluck.js +0 -7
  1054. package/node_modules/underscore/modules/property.js +0 -11
  1055. package/node_modules/underscore/modules/propertyOf.js +0 -10
  1056. package/node_modules/underscore/modules/random.js +0 -8
  1057. package/node_modules/underscore/modules/range.js +0 -21
  1058. package/node_modules/underscore/modules/reduce.js +0 -5
  1059. package/node_modules/underscore/modules/reduceRight.js +0 -4
  1060. package/node_modules/underscore/modules/reject.js +0 -8
  1061. package/node_modules/underscore/modules/rest.js +0 -8
  1062. package/node_modules/underscore/modules/restArguments.js +0 -27
  1063. package/node_modules/underscore/modules/result.js +0 -22
  1064. package/node_modules/underscore/modules/sample.js +0 -27
  1065. package/node_modules/underscore/modules/shuffle.js +0 -6
  1066. package/node_modules/underscore/modules/size.js +0 -8
  1067. package/node_modules/underscore/modules/some.js +0 -15
  1068. package/node_modules/underscore/modules/sortBy.js +0 -24
  1069. package/node_modules/underscore/modules/sortedIndex.js +0 -15
  1070. package/node_modules/underscore/modules/tap.js +0 -7
  1071. package/node_modules/underscore/modules/template.js +0 -101
  1072. package/node_modules/underscore/modules/templateSettings.js +0 -9
  1073. package/node_modules/underscore/modules/throttle.js +0 -47
  1074. package/node_modules/underscore/modules/times.js +0 -9
  1075. package/node_modules/underscore/modules/toArray.js +0 -20
  1076. package/node_modules/underscore/modules/toPath.js +0 -9
  1077. package/node_modules/underscore/modules/underscore-array-methods.js +0 -31
  1078. package/node_modules/underscore/modules/underscore.js +0 -25
  1079. package/node_modules/underscore/modules/unescape.js +0 -5
  1080. package/node_modules/underscore/modules/union.js +0 -9
  1081. package/node_modules/underscore/modules/uniq.js +0 -36
  1082. package/node_modules/underscore/modules/uniqueId.js +0 -7
  1083. package/node_modules/underscore/modules/unzip.js +0 -15
  1084. package/node_modules/underscore/modules/values.js +0 -12
  1085. package/node_modules/underscore/modules/where.js +0 -8
  1086. package/node_modules/underscore/modules/without.js +0 -7
  1087. package/node_modules/underscore/modules/wrap.js +0 -8
  1088. package/node_modules/underscore/modules/zip.js +0 -6
  1089. package/node_modules/underscore/package.json +0 -124
  1090. package/node_modules/underscore/underscore-esm-min.js +0 -5
  1091. package/node_modules/underscore/underscore-esm-min.js.map +0 -1
  1092. package/node_modules/underscore/underscore-esm.js +0 -2034
  1093. package/node_modules/underscore/underscore-esm.js.map +0 -1
  1094. package/node_modules/underscore/underscore-min.js +0 -6
  1095. package/node_modules/underscore/underscore-min.js.map +0 -1
  1096. package/node_modules/underscore/underscore-node-f.cjs +0 -2158
  1097. package/node_modules/underscore/underscore-node-f.cjs.map +0 -1
  1098. package/node_modules/underscore/underscore-node.cjs +0 -11
  1099. package/node_modules/underscore/underscore-node.cjs.map +0 -1
  1100. package/node_modules/underscore/underscore-node.mjs +0 -7
  1101. package/node_modules/underscore/underscore-node.mjs.map +0 -1
  1102. package/node_modules/underscore/underscore-umd-min.js +0 -6
  1103. package/node_modules/underscore/underscore-umd-min.js.map +0 -1
  1104. package/node_modules/underscore/underscore-umd.js +0 -2042
  1105. package/node_modules/underscore/underscore-umd.js.map +0 -1
  1106. package/node_modules/underscore/underscore.js +0 -2042
@@ -0,0 +1,2074 @@
1
+ import vm from 'vm';
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
+ } else {
32
+ (Array.isArray(name) ? name : [name]).forEach(function (name) {
33
+ this[name] = this[name] || [];
34
+ if (callback) {
35
+ this[name][first ? 'unshift' : 'push'](callback);
36
+ }
37
+ }, this);
38
+ }
39
+ }
40
+
41
+ /**
42
+ * Runs a hook invoking all registered callbacks with the given environment variables.
43
+ *
44
+ * Callbacks will be invoked synchronously and in the order in which they were registered.
45
+ *
46
+ * @param {string} name The name of the hook.
47
+ * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
48
+ * @public
49
+ */
50
+ run(name, env) {
51
+ this[name] = this[name] || [];
52
+ this[name].forEach(function (callback) {
53
+ callback.call(env && env.context ? env.context : env, env);
54
+ });
55
+ }
56
+ }
57
+
58
+ /**
59
+ * @implements {IPlugins}
60
+ */
61
+ class Plugins {
62
+ constructor(jsep) {
63
+ this.jsep = jsep;
64
+ this.registered = {};
65
+ }
66
+
67
+ /**
68
+ * @callback PluginSetup
69
+ * @this {Jsep} jsep
70
+ * @returns: void
71
+ */
72
+ /**
73
+ * Adds the given plugin(s) to the registry
74
+ *
75
+ * @param {object} plugins
76
+ * @param {string} plugins.name The name of the plugin
77
+ * @param {PluginSetup} plugins.init The init function
78
+ * @public
79
+ */
80
+ register(...plugins) {
81
+ plugins.forEach(plugin => {
82
+ if (typeof plugin !== 'object' || !plugin.name || !plugin.init) {
83
+ throw new Error('Invalid JSEP plugin format');
84
+ }
85
+ if (this.registered[plugin.name]) {
86
+ // already registered. Ignore.
87
+ return;
88
+ }
89
+ plugin.init(this.jsep);
90
+ this.registered[plugin.name] = plugin;
91
+ });
92
+ }
93
+ }
94
+
95
+ // JavaScript Expression Parser (JSEP) 1.4.0
96
+
97
+ class Jsep {
98
+ /**
99
+ * @returns {string}
100
+ */
101
+ static get version() {
102
+ // To be filled in by the template
103
+ return '1.4.0';
104
+ }
105
+
106
+ /**
107
+ * @returns {string}
108
+ */
109
+ static toString() {
110
+ return 'JavaScript Expression Parser (JSEP) v' + Jsep.version;
111
+ }
112
+ // ==================== CONFIG ================================
113
+ /**
114
+ * @method addUnaryOp
115
+ * @param {string} op_name The name of the unary op to add
116
+ * @returns {Jsep}
117
+ */
118
+ static addUnaryOp(op_name) {
119
+ Jsep.max_unop_len = Math.max(op_name.length, Jsep.max_unop_len);
120
+ Jsep.unary_ops[op_name] = 1;
121
+ return Jsep;
122
+ }
123
+
124
+ /**
125
+ * @method jsep.addBinaryOp
126
+ * @param {string} op_name The name of the binary op to add
127
+ * @param {number} precedence The precedence of the binary op (can be a float). Higher number = higher precedence
128
+ * @param {boolean} [isRightAssociative=false] whether operator is right-associative
129
+ * @returns {Jsep}
130
+ */
131
+ static addBinaryOp(op_name, precedence, isRightAssociative) {
132
+ Jsep.max_binop_len = Math.max(op_name.length, Jsep.max_binop_len);
133
+ Jsep.binary_ops[op_name] = precedence;
134
+ if (isRightAssociative) {
135
+ Jsep.right_associative.add(op_name);
136
+ } else {
137
+ Jsep.right_associative.delete(op_name);
138
+ }
139
+ return Jsep;
140
+ }
141
+
142
+ /**
143
+ * @method addIdentifierChar
144
+ * @param {string} char The additional character to treat as a valid part of an identifier
145
+ * @returns {Jsep}
146
+ */
147
+ static addIdentifierChar(char) {
148
+ Jsep.additional_identifier_chars.add(char);
149
+ return Jsep;
150
+ }
151
+
152
+ /**
153
+ * @method addLiteral
154
+ * @param {string} literal_name The name of the literal to add
155
+ * @param {*} literal_value The value of the literal
156
+ * @returns {Jsep}
157
+ */
158
+ static addLiteral(literal_name, literal_value) {
159
+ Jsep.literals[literal_name] = literal_value;
160
+ return Jsep;
161
+ }
162
+
163
+ /**
164
+ * @method removeUnaryOp
165
+ * @param {string} op_name The name of the unary op to remove
166
+ * @returns {Jsep}
167
+ */
168
+ static removeUnaryOp(op_name) {
169
+ delete Jsep.unary_ops[op_name];
170
+ if (op_name.length === Jsep.max_unop_len) {
171
+ Jsep.max_unop_len = Jsep.getMaxKeyLen(Jsep.unary_ops);
172
+ }
173
+ return Jsep;
174
+ }
175
+
176
+ /**
177
+ * @method removeAllUnaryOps
178
+ * @returns {Jsep}
179
+ */
180
+ static removeAllUnaryOps() {
181
+ Jsep.unary_ops = {};
182
+ Jsep.max_unop_len = 0;
183
+ return Jsep;
184
+ }
185
+
186
+ /**
187
+ * @method removeIdentifierChar
188
+ * @param {string} char The additional character to stop treating as a valid part of an identifier
189
+ * @returns {Jsep}
190
+ */
191
+ static removeIdentifierChar(char) {
192
+ Jsep.additional_identifier_chars.delete(char);
193
+ return Jsep;
194
+ }
195
+
196
+ /**
197
+ * @method removeBinaryOp
198
+ * @param {string} op_name The name of the binary op to remove
199
+ * @returns {Jsep}
200
+ */
201
+ static removeBinaryOp(op_name) {
202
+ delete Jsep.binary_ops[op_name];
203
+ if (op_name.length === Jsep.max_binop_len) {
204
+ Jsep.max_binop_len = Jsep.getMaxKeyLen(Jsep.binary_ops);
205
+ }
206
+ Jsep.right_associative.delete(op_name);
207
+ return Jsep;
208
+ }
209
+
210
+ /**
211
+ * @method removeAllBinaryOps
212
+ * @returns {Jsep}
213
+ */
214
+ static removeAllBinaryOps() {
215
+ Jsep.binary_ops = {};
216
+ Jsep.max_binop_len = 0;
217
+ return Jsep;
218
+ }
219
+
220
+ /**
221
+ * @method removeLiteral
222
+ * @param {string} literal_name The name of the literal to remove
223
+ * @returns {Jsep}
224
+ */
225
+ static removeLiteral(literal_name) {
226
+ delete Jsep.literals[literal_name];
227
+ return Jsep;
228
+ }
229
+
230
+ /**
231
+ * @method removeAllLiterals
232
+ * @returns {Jsep}
233
+ */
234
+ static removeAllLiterals() {
235
+ Jsep.literals = {};
236
+ return Jsep;
237
+ }
238
+ // ==================== END CONFIG ============================
239
+
240
+ /**
241
+ * @returns {string}
242
+ */
243
+ get char() {
244
+ return this.expr.charAt(this.index);
245
+ }
246
+
247
+ /**
248
+ * @returns {number}
249
+ */
250
+ get code() {
251
+ return this.expr.charCodeAt(this.index);
252
+ }
253
+ /**
254
+ * @param {string} expr a string with the passed in express
255
+ * @returns Jsep
256
+ */
257
+ constructor(expr) {
258
+ // `index` stores the character number we are currently at
259
+ // All of the gobbles below will modify `index` as we move along
260
+ this.expr = expr;
261
+ this.index = 0;
262
+ }
263
+
264
+ /**
265
+ * static top-level parser
266
+ * @returns {jsep.Expression}
267
+ */
268
+ static parse(expr) {
269
+ return new Jsep(expr).parse();
270
+ }
271
+
272
+ /**
273
+ * Get the longest key length of any object
274
+ * @param {object} obj
275
+ * @returns {number}
276
+ */
277
+ static getMaxKeyLen(obj) {
278
+ return Math.max(0, ...Object.keys(obj).map(k => k.length));
279
+ }
280
+
281
+ /**
282
+ * `ch` is a character code in the next three functions
283
+ * @param {number} ch
284
+ * @returns {boolean}
285
+ */
286
+ static isDecimalDigit(ch) {
287
+ return ch >= 48 && ch <= 57; // 0...9
288
+ }
289
+
290
+ /**
291
+ * Returns the precedence of a binary operator or `0` if it isn't a binary operator. Can be float.
292
+ * @param {string} op_val
293
+ * @returns {number}
294
+ */
295
+ static binaryPrecedence(op_val) {
296
+ return Jsep.binary_ops[op_val] || 0;
297
+ }
298
+
299
+ /**
300
+ * Looks for start of identifier
301
+ * @param {number} ch
302
+ * @returns {boolean}
303
+ */
304
+ static isIdentifierStart(ch) {
305
+ return ch >= 65 && ch <= 90 ||
306
+ // A...Z
307
+ ch >= 97 && ch <= 122 ||
308
+ // a...z
309
+ ch >= 128 && !Jsep.binary_ops[String.fromCharCode(ch)] ||
310
+ // any non-ASCII that is not an operator
311
+ Jsep.additional_identifier_chars.has(String.fromCharCode(ch)); // additional characters
312
+ }
313
+
314
+ /**
315
+ * @param {number} ch
316
+ * @returns {boolean}
317
+ */
318
+ static isIdentifierPart(ch) {
319
+ return Jsep.isIdentifierStart(ch) || Jsep.isDecimalDigit(ch);
320
+ }
321
+
322
+ /**
323
+ * throw error at index of the expression
324
+ * @param {string} message
325
+ * @throws
326
+ */
327
+ throwError(message) {
328
+ const error = new Error(message + ' at character ' + this.index);
329
+ error.index = this.index;
330
+ error.description = message;
331
+ throw error;
332
+ }
333
+
334
+ /**
335
+ * Run a given hook
336
+ * @param {string} name
337
+ * @param {jsep.Expression|false} [node]
338
+ * @returns {?jsep.Expression}
339
+ */
340
+ runHook(name, node) {
341
+ if (Jsep.hooks[name]) {
342
+ const env = {
343
+ context: this,
344
+ node
345
+ };
346
+ Jsep.hooks.run(name, env);
347
+ return env.node;
348
+ }
349
+ return node;
350
+ }
351
+
352
+ /**
353
+ * Runs a given hook until one returns a node
354
+ * @param {string} name
355
+ * @returns {?jsep.Expression}
356
+ */
357
+ searchHook(name) {
358
+ if (Jsep.hooks[name]) {
359
+ const env = {
360
+ context: this
361
+ };
362
+ Jsep.hooks[name].find(function (callback) {
363
+ callback.call(env.context, env);
364
+ return env.node;
365
+ });
366
+ return env.node;
367
+ }
368
+ }
369
+
370
+ /**
371
+ * Push `index` up to the next non-space character
372
+ */
373
+ gobbleSpaces() {
374
+ let ch = this.code;
375
+ // Whitespace
376
+ while (ch === Jsep.SPACE_CODE || ch === Jsep.TAB_CODE || ch === Jsep.LF_CODE || ch === Jsep.CR_CODE) {
377
+ ch = this.expr.charCodeAt(++this.index);
378
+ }
379
+ this.runHook('gobble-spaces');
380
+ }
381
+
382
+ /**
383
+ * Top-level method to parse all expressions and returns compound or single node
384
+ * @returns {jsep.Expression}
385
+ */
386
+ parse() {
387
+ this.runHook('before-all');
388
+ const nodes = this.gobbleExpressions();
389
+
390
+ // If there's only one expression just try returning the expression
391
+ const node = nodes.length === 1 ? nodes[0] : {
392
+ type: Jsep.COMPOUND,
393
+ body: nodes
394
+ };
395
+ return this.runHook('after-all', node);
396
+ }
397
+
398
+ /**
399
+ * top-level parser (but can be reused within as well)
400
+ * @param {number} [untilICode]
401
+ * @returns {jsep.Expression[]}
402
+ */
403
+ gobbleExpressions(untilICode) {
404
+ let nodes = [],
405
+ ch_i,
406
+ node;
407
+ while (this.index < this.expr.length) {
408
+ ch_i = this.code;
409
+
410
+ // Expressions can be separated by semicolons, commas, or just inferred without any
411
+ // separators
412
+ if (ch_i === Jsep.SEMCOL_CODE || ch_i === Jsep.COMMA_CODE) {
413
+ this.index++; // ignore separators
414
+ } else {
415
+ // Try to gobble each expression individually
416
+ if (node = this.gobbleExpression()) {
417
+ nodes.push(node);
418
+ // If we weren't able to find a binary expression and are out of room, then
419
+ // the expression passed in probably has too much
420
+ } else if (this.index < this.expr.length) {
421
+ if (ch_i === untilICode) {
422
+ break;
423
+ }
424
+ this.throwError('Unexpected "' + this.char + '"');
425
+ }
426
+ }
427
+ }
428
+ return nodes;
429
+ }
430
+
431
+ /**
432
+ * The main parsing function.
433
+ * @returns {?jsep.Expression}
434
+ */
435
+ gobbleExpression() {
436
+ const node = this.searchHook('gobble-expression') || this.gobbleBinaryExpression();
437
+ this.gobbleSpaces();
438
+ return this.runHook('after-expression', node);
439
+ }
440
+
441
+ /**
442
+ * Search for the operation portion of the string (e.g. `+`, `===`)
443
+ * Start by taking the longest possible binary operations (3 characters: `===`, `!==`, `>>>`)
444
+ * and move down from 3 to 2 to 1 character until a matching binary operation is found
445
+ * then, return that binary operation
446
+ * @returns {string|boolean}
447
+ */
448
+ gobbleBinaryOp() {
449
+ this.gobbleSpaces();
450
+ let to_check = this.expr.substr(this.index, Jsep.max_binop_len);
451
+ let tc_len = to_check.length;
452
+ while (tc_len > 0) {
453
+ // Don't accept a binary op when it is an identifier.
454
+ // Binary ops that start with a identifier-valid character must be followed
455
+ // by a non identifier-part valid character
456
+ if (Jsep.binary_ops.hasOwnProperty(to_check) && (!Jsep.isIdentifierStart(this.code) || this.index + to_check.length < this.expr.length && !Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + to_check.length)))) {
457
+ this.index += tc_len;
458
+ return to_check;
459
+ }
460
+ to_check = to_check.substr(0, --tc_len);
461
+ }
462
+ return false;
463
+ }
464
+
465
+ /**
466
+ * This function is responsible for gobbling an individual expression,
467
+ * e.g. `1`, `1+2`, `a+(b*2)-Math.sqrt(2)`
468
+ * @returns {?jsep.BinaryExpression}
469
+ */
470
+ gobbleBinaryExpression() {
471
+ let node, biop, prec, stack, biop_info, left, right, i, cur_biop;
472
+
473
+ // First, try to get the leftmost thing
474
+ // Then, check to see if there's a binary operator operating on that leftmost thing
475
+ // Don't gobbleBinaryOp without a left-hand-side
476
+ left = this.gobbleToken();
477
+ if (!left) {
478
+ return left;
479
+ }
480
+ biop = this.gobbleBinaryOp();
481
+
482
+ // If there wasn't a binary operator, just return the leftmost node
483
+ if (!biop) {
484
+ return left;
485
+ }
486
+
487
+ // Otherwise, we need to start a stack to properly place the binary operations in their
488
+ // precedence structure
489
+ biop_info = {
490
+ value: biop,
491
+ prec: Jsep.binaryPrecedence(biop),
492
+ right_a: Jsep.right_associative.has(biop)
493
+ };
494
+ right = this.gobbleToken();
495
+ if (!right) {
496
+ this.throwError("Expected expression after " + biop);
497
+ }
498
+ stack = [left, biop_info, right];
499
+
500
+ // Properly deal with precedence using [recursive descent](http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm)
501
+ while (biop = this.gobbleBinaryOp()) {
502
+ prec = Jsep.binaryPrecedence(biop);
503
+ if (prec === 0) {
504
+ this.index -= biop.length;
505
+ break;
506
+ }
507
+ biop_info = {
508
+ value: biop,
509
+ prec,
510
+ right_a: Jsep.right_associative.has(biop)
511
+ };
512
+ cur_biop = biop;
513
+
514
+ // Reduce: make a binary expression from the three topmost entries.
515
+ const comparePrev = prev => biop_info.right_a && prev.right_a ? prec > prev.prec : prec <= prev.prec;
516
+ while (stack.length > 2 && comparePrev(stack[stack.length - 2])) {
517
+ right = stack.pop();
518
+ biop = stack.pop().value;
519
+ left = stack.pop();
520
+ node = {
521
+ type: Jsep.BINARY_EXP,
522
+ operator: biop,
523
+ left,
524
+ right
525
+ };
526
+ stack.push(node);
527
+ }
528
+ node = this.gobbleToken();
529
+ if (!node) {
530
+ this.throwError("Expected expression after " + cur_biop);
531
+ }
532
+ stack.push(biop_info, node);
533
+ }
534
+ i = stack.length - 1;
535
+ node = stack[i];
536
+ while (i > 1) {
537
+ node = {
538
+ type: Jsep.BINARY_EXP,
539
+ operator: stack[i - 1].value,
540
+ left: stack[i - 2],
541
+ right: node
542
+ };
543
+ i -= 2;
544
+ }
545
+ return node;
546
+ }
547
+
548
+ /**
549
+ * An individual part of a binary expression:
550
+ * e.g. `foo.bar(baz)`, `1`, `"abc"`, `(a % 2)` (because it's in parenthesis)
551
+ * @returns {boolean|jsep.Expression}
552
+ */
553
+ gobbleToken() {
554
+ let ch, to_check, tc_len, node;
555
+ this.gobbleSpaces();
556
+ node = this.searchHook('gobble-token');
557
+ if (node) {
558
+ return this.runHook('after-token', node);
559
+ }
560
+ ch = this.code;
561
+ if (Jsep.isDecimalDigit(ch) || ch === Jsep.PERIOD_CODE) {
562
+ // Char code 46 is a dot `.` which can start off a numeric literal
563
+ return this.gobbleNumericLiteral();
564
+ }
565
+ if (ch === Jsep.SQUOTE_CODE || ch === Jsep.DQUOTE_CODE) {
566
+ // Single or double quotes
567
+ node = this.gobbleStringLiteral();
568
+ } else if (ch === Jsep.OBRACK_CODE) {
569
+ node = this.gobbleArray();
570
+ } else {
571
+ to_check = this.expr.substr(this.index, Jsep.max_unop_len);
572
+ tc_len = to_check.length;
573
+ while (tc_len > 0) {
574
+ // Don't accept an unary op when it is an identifier.
575
+ // Unary ops that start with a identifier-valid character must be followed
576
+ // by a non identifier-part valid character
577
+ if (Jsep.unary_ops.hasOwnProperty(to_check) && (!Jsep.isIdentifierStart(this.code) || this.index + to_check.length < this.expr.length && !Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + to_check.length)))) {
578
+ this.index += tc_len;
579
+ const argument = this.gobbleToken();
580
+ if (!argument) {
581
+ this.throwError('missing unaryOp argument');
582
+ }
583
+ return this.runHook('after-token', {
584
+ type: Jsep.UNARY_EXP,
585
+ operator: to_check,
586
+ argument,
587
+ prefix: true
588
+ });
589
+ }
590
+ to_check = to_check.substr(0, --tc_len);
591
+ }
592
+ if (Jsep.isIdentifierStart(ch)) {
593
+ node = this.gobbleIdentifier();
594
+ if (Jsep.literals.hasOwnProperty(node.name)) {
595
+ node = {
596
+ type: Jsep.LITERAL,
597
+ value: Jsep.literals[node.name],
598
+ raw: node.name
599
+ };
600
+ } else if (node.name === Jsep.this_str) {
601
+ node = {
602
+ type: Jsep.THIS_EXP
603
+ };
604
+ }
605
+ } else if (ch === Jsep.OPAREN_CODE) {
606
+ // open parenthesis
607
+ node = this.gobbleGroup();
608
+ }
609
+ }
610
+ if (!node) {
611
+ return this.runHook('after-token', false);
612
+ }
613
+ node = this.gobbleTokenProperty(node);
614
+ return this.runHook('after-token', node);
615
+ }
616
+
617
+ /**
618
+ * Gobble properties of of identifiers/strings/arrays/groups.
619
+ * e.g. `foo`, `bar.baz`, `foo['bar'].baz`
620
+ * It also gobbles function calls:
621
+ * e.g. `Math.acos(obj.angle)`
622
+ * @param {jsep.Expression} node
623
+ * @returns {jsep.Expression}
624
+ */
625
+ gobbleTokenProperty(node) {
626
+ this.gobbleSpaces();
627
+ let ch = this.code;
628
+ while (ch === Jsep.PERIOD_CODE || ch === Jsep.OBRACK_CODE || ch === Jsep.OPAREN_CODE || ch === Jsep.QUMARK_CODE) {
629
+ let optional;
630
+ if (ch === Jsep.QUMARK_CODE) {
631
+ if (this.expr.charCodeAt(this.index + 1) !== Jsep.PERIOD_CODE) {
632
+ break;
633
+ }
634
+ optional = true;
635
+ this.index += 2;
636
+ this.gobbleSpaces();
637
+ ch = this.code;
638
+ }
639
+ this.index++;
640
+ if (ch === Jsep.OBRACK_CODE) {
641
+ node = {
642
+ type: Jsep.MEMBER_EXP,
643
+ computed: true,
644
+ object: node,
645
+ property: this.gobbleExpression()
646
+ };
647
+ if (!node.property) {
648
+ this.throwError('Unexpected "' + this.char + '"');
649
+ }
650
+ this.gobbleSpaces();
651
+ ch = this.code;
652
+ if (ch !== Jsep.CBRACK_CODE) {
653
+ this.throwError('Unclosed [');
654
+ }
655
+ this.index++;
656
+ } else if (ch === Jsep.OPAREN_CODE) {
657
+ // A function call is being made; gobble all the arguments
658
+ node = {
659
+ type: Jsep.CALL_EXP,
660
+ 'arguments': this.gobbleArguments(Jsep.CPAREN_CODE),
661
+ callee: node
662
+ };
663
+ } else if (ch === Jsep.PERIOD_CODE || optional) {
664
+ if (optional) {
665
+ this.index--;
666
+ }
667
+ this.gobbleSpaces();
668
+ node = {
669
+ type: Jsep.MEMBER_EXP,
670
+ computed: false,
671
+ object: node,
672
+ property: this.gobbleIdentifier()
673
+ };
674
+ }
675
+ if (optional) {
676
+ node.optional = true;
677
+ } // else leave undefined for compatibility with esprima
678
+
679
+ this.gobbleSpaces();
680
+ ch = this.code;
681
+ }
682
+ return node;
683
+ }
684
+
685
+ /**
686
+ * Parse simple numeric literals: `12`, `3.4`, `.5`. Do this by using a string to
687
+ * keep track of everything in the numeric literal and then calling `parseFloat` on that string
688
+ * @returns {jsep.Literal}
689
+ */
690
+ gobbleNumericLiteral() {
691
+ let number = '',
692
+ ch,
693
+ chCode;
694
+ while (Jsep.isDecimalDigit(this.code)) {
695
+ number += this.expr.charAt(this.index++);
696
+ }
697
+ if (this.code === Jsep.PERIOD_CODE) {
698
+ // can start with a decimal marker
699
+ number += this.expr.charAt(this.index++);
700
+ while (Jsep.isDecimalDigit(this.code)) {
701
+ number += this.expr.charAt(this.index++);
702
+ }
703
+ }
704
+ ch = this.char;
705
+ if (ch === 'e' || ch === 'E') {
706
+ // exponent marker
707
+ number += this.expr.charAt(this.index++);
708
+ ch = this.char;
709
+ if (ch === '+' || ch === '-') {
710
+ // exponent sign
711
+ number += this.expr.charAt(this.index++);
712
+ }
713
+ while (Jsep.isDecimalDigit(this.code)) {
714
+ // exponent itself
715
+ number += this.expr.charAt(this.index++);
716
+ }
717
+ if (!Jsep.isDecimalDigit(this.expr.charCodeAt(this.index - 1))) {
718
+ this.throwError('Expected exponent (' + number + this.char + ')');
719
+ }
720
+ }
721
+ chCode = this.code;
722
+
723
+ // Check to make sure this isn't a variable name that start with a number (123abc)
724
+ if (Jsep.isIdentifierStart(chCode)) {
725
+ this.throwError('Variable names cannot start with a number (' + number + this.char + ')');
726
+ } else if (chCode === Jsep.PERIOD_CODE || number.length === 1 && number.charCodeAt(0) === Jsep.PERIOD_CODE) {
727
+ this.throwError('Unexpected period');
728
+ }
729
+ return {
730
+ type: Jsep.LITERAL,
731
+ value: parseFloat(number),
732
+ raw: number
733
+ };
734
+ }
735
+
736
+ /**
737
+ * Parses a string literal, staring with single or double quotes with basic support for escape codes
738
+ * e.g. `"hello world"`, `'this is\nJSEP'`
739
+ * @returns {jsep.Literal}
740
+ */
741
+ gobbleStringLiteral() {
742
+ let str = '';
743
+ const startIndex = this.index;
744
+ const quote = this.expr.charAt(this.index++);
745
+ let closed = false;
746
+ while (this.index < this.expr.length) {
747
+ let ch = this.expr.charAt(this.index++);
748
+ if (ch === quote) {
749
+ closed = true;
750
+ break;
751
+ } else if (ch === '\\') {
752
+ // Check for all of the common escape codes
753
+ ch = this.expr.charAt(this.index++);
754
+ switch (ch) {
755
+ case 'n':
756
+ str += '\n';
757
+ break;
758
+ case 'r':
759
+ str += '\r';
760
+ break;
761
+ case 't':
762
+ str += '\t';
763
+ break;
764
+ case 'b':
765
+ str += '\b';
766
+ break;
767
+ case 'f':
768
+ str += '\f';
769
+ break;
770
+ case 'v':
771
+ str += '\x0B';
772
+ break;
773
+ default:
774
+ str += ch;
775
+ }
776
+ } else {
777
+ str += ch;
778
+ }
779
+ }
780
+ if (!closed) {
781
+ this.throwError('Unclosed quote after "' + str + '"');
782
+ }
783
+ return {
784
+ type: Jsep.LITERAL,
785
+ value: str,
786
+ raw: this.expr.substring(startIndex, this.index)
787
+ };
788
+ }
789
+
790
+ /**
791
+ * Gobbles only identifiers
792
+ * e.g.: `foo`, `_value`, `$x1`
793
+ * Also, this function checks if that identifier is a literal:
794
+ * (e.g. `true`, `false`, `null`) or `this`
795
+ * @returns {jsep.Identifier}
796
+ */
797
+ gobbleIdentifier() {
798
+ let ch = this.code,
799
+ start = this.index;
800
+ if (Jsep.isIdentifierStart(ch)) {
801
+ this.index++;
802
+ } else {
803
+ this.throwError('Unexpected ' + this.char);
804
+ }
805
+ while (this.index < this.expr.length) {
806
+ ch = this.code;
807
+ if (Jsep.isIdentifierPart(ch)) {
808
+ this.index++;
809
+ } else {
810
+ break;
811
+ }
812
+ }
813
+ return {
814
+ type: Jsep.IDENTIFIER,
815
+ name: this.expr.slice(start, this.index)
816
+ };
817
+ }
818
+
819
+ /**
820
+ * Gobbles a list of arguments within the context of a function call
821
+ * or array literal. This function also assumes that the opening character
822
+ * `(` or `[` has already been gobbled, and gobbles expressions and commas
823
+ * until the terminator character `)` or `]` is encountered.
824
+ * e.g. `foo(bar, baz)`, `my_func()`, or `[bar, baz]`
825
+ * @param {number} termination
826
+ * @returns {jsep.Expression[]}
827
+ */
828
+ gobbleArguments(termination) {
829
+ const args = [];
830
+ let closed = false;
831
+ let separator_count = 0;
832
+ while (this.index < this.expr.length) {
833
+ this.gobbleSpaces();
834
+ let ch_i = this.code;
835
+ if (ch_i === termination) {
836
+ // done parsing
837
+ closed = true;
838
+ this.index++;
839
+ if (termination === Jsep.CPAREN_CODE && separator_count && separator_count >= args.length) {
840
+ this.throwError('Unexpected token ' + String.fromCharCode(termination));
841
+ }
842
+ break;
843
+ } else if (ch_i === Jsep.COMMA_CODE) {
844
+ // between expressions
845
+ this.index++;
846
+ separator_count++;
847
+ if (separator_count !== args.length) {
848
+ // missing argument
849
+ if (termination === Jsep.CPAREN_CODE) {
850
+ this.throwError('Unexpected token ,');
851
+ } else if (termination === Jsep.CBRACK_CODE) {
852
+ for (let arg = args.length; arg < separator_count; arg++) {
853
+ args.push(null);
854
+ }
855
+ }
856
+ }
857
+ } else if (args.length !== separator_count && separator_count !== 0) {
858
+ // NOTE: `&& separator_count !== 0` allows for either all commas, or all spaces as arguments
859
+ this.throwError('Expected comma');
860
+ } else {
861
+ const node = this.gobbleExpression();
862
+ if (!node || node.type === Jsep.COMPOUND) {
863
+ this.throwError('Expected comma');
864
+ }
865
+ args.push(node);
866
+ }
867
+ }
868
+ if (!closed) {
869
+ this.throwError('Expected ' + String.fromCharCode(termination));
870
+ }
871
+ return args;
872
+ }
873
+
874
+ /**
875
+ * Responsible for parsing a group of things within parentheses `()`
876
+ * that have no identifier in front (so not a function call)
877
+ * This function assumes that it needs to gobble the opening parenthesis
878
+ * and then tries to gobble everything within that parenthesis, assuming
879
+ * that the next thing it should see is the close parenthesis. If not,
880
+ * then the expression probably doesn't have a `)`
881
+ * @returns {boolean|jsep.Expression}
882
+ */
883
+ gobbleGroup() {
884
+ this.index++;
885
+ let nodes = this.gobbleExpressions(Jsep.CPAREN_CODE);
886
+ if (this.code === Jsep.CPAREN_CODE) {
887
+ this.index++;
888
+ if (nodes.length === 1) {
889
+ return nodes[0];
890
+ } else if (!nodes.length) {
891
+ return false;
892
+ } else {
893
+ return {
894
+ type: Jsep.SEQUENCE_EXP,
895
+ expressions: nodes
896
+ };
897
+ }
898
+ } else {
899
+ this.throwError('Unclosed (');
900
+ }
901
+ }
902
+
903
+ /**
904
+ * Responsible for parsing Array literals `[1, 2, 3]`
905
+ * This function assumes that it needs to gobble the opening bracket
906
+ * and then tries to gobble the expressions as arguments.
907
+ * @returns {jsep.ArrayExpression}
908
+ */
909
+ gobbleArray() {
910
+ this.index++;
911
+ return {
912
+ type: Jsep.ARRAY_EXP,
913
+ elements: this.gobbleArguments(Jsep.CBRACK_CODE)
914
+ };
915
+ }
916
+ }
917
+
918
+ // Static fields:
919
+ const hooks = new Hooks();
920
+ Object.assign(Jsep, {
921
+ hooks,
922
+ plugins: new Plugins(Jsep),
923
+ // Node Types
924
+ // ----------
925
+ // This is the full set of types that any JSEP node can be.
926
+ // Store them here to save space when minified
927
+ COMPOUND: 'Compound',
928
+ SEQUENCE_EXP: 'SequenceExpression',
929
+ IDENTIFIER: 'Identifier',
930
+ MEMBER_EXP: 'MemberExpression',
931
+ LITERAL: 'Literal',
932
+ THIS_EXP: 'ThisExpression',
933
+ CALL_EXP: 'CallExpression',
934
+ UNARY_EXP: 'UnaryExpression',
935
+ BINARY_EXP: 'BinaryExpression',
936
+ ARRAY_EXP: 'ArrayExpression',
937
+ TAB_CODE: 9,
938
+ LF_CODE: 10,
939
+ CR_CODE: 13,
940
+ SPACE_CODE: 32,
941
+ PERIOD_CODE: 46,
942
+ // '.'
943
+ COMMA_CODE: 44,
944
+ // ','
945
+ SQUOTE_CODE: 39,
946
+ // single quote
947
+ DQUOTE_CODE: 34,
948
+ // double quotes
949
+ OPAREN_CODE: 40,
950
+ // (
951
+ CPAREN_CODE: 41,
952
+ // )
953
+ OBRACK_CODE: 91,
954
+ // [
955
+ CBRACK_CODE: 93,
956
+ // ]
957
+ QUMARK_CODE: 63,
958
+ // ?
959
+ SEMCOL_CODE: 59,
960
+ // ;
961
+ COLON_CODE: 58,
962
+ // :
963
+
964
+ // Operations
965
+ // ----------
966
+ // Use a quickly-accessible map to store all of the unary operators
967
+ // Values are set to `1` (it really doesn't matter)
968
+ unary_ops: {
969
+ '-': 1,
970
+ '!': 1,
971
+ '~': 1,
972
+ '+': 1
973
+ },
974
+ // Also use a map for the binary operations but set their values to their
975
+ // binary precedence for quick reference (higher number = higher precedence)
976
+ // see [Order of operations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence)
977
+ binary_ops: {
978
+ '||': 1,
979
+ '??': 1,
980
+ '&&': 2,
981
+ '|': 3,
982
+ '^': 4,
983
+ '&': 5,
984
+ '==': 6,
985
+ '!=': 6,
986
+ '===': 6,
987
+ '!==': 6,
988
+ '<': 7,
989
+ '>': 7,
990
+ '<=': 7,
991
+ '>=': 7,
992
+ '<<': 8,
993
+ '>>': 8,
994
+ '>>>': 8,
995
+ '+': 9,
996
+ '-': 9,
997
+ '*': 10,
998
+ '/': 10,
999
+ '%': 10,
1000
+ '**': 11
1001
+ },
1002
+ // sets specific binary_ops as right-associative
1003
+ right_associative: new Set(['**']),
1004
+ // Additional valid identifier chars, apart from a-z, A-Z and 0-9 (except on the starting char)
1005
+ additional_identifier_chars: new Set(['$', '_']),
1006
+ // Literals
1007
+ // ----------
1008
+ // Store the values to return for the various literals we may encounter
1009
+ literals: {
1010
+ 'true': true,
1011
+ 'false': false,
1012
+ 'null': null
1013
+ },
1014
+ // Except for `this`, which is special. This could be changed to something like `'self'` as well
1015
+ this_str: 'this'
1016
+ });
1017
+ Jsep.max_unop_len = Jsep.getMaxKeyLen(Jsep.unary_ops);
1018
+ Jsep.max_binop_len = Jsep.getMaxKeyLen(Jsep.binary_ops);
1019
+
1020
+ // Backward Compatibility:
1021
+ const jsep = expr => new Jsep(expr).parse();
1022
+ const stdClassProps = Object.getOwnPropertyNames(class Test {});
1023
+ Object.getOwnPropertyNames(Jsep).filter(prop => !stdClassProps.includes(prop) && jsep[prop] === undefined).forEach(m => {
1024
+ jsep[m] = Jsep[m];
1025
+ });
1026
+ jsep.Jsep = Jsep; // allows for const { Jsep } = require('jsep');
1027
+
1028
+ const CONDITIONAL_EXP = 'ConditionalExpression';
1029
+ var ternary = {
1030
+ name: 'ternary',
1031
+ init(jsep) {
1032
+ // Ternary expression: test ? consequent : alternate
1033
+ jsep.hooks.add('after-expression', function gobbleTernary(env) {
1034
+ if (env.node && this.code === jsep.QUMARK_CODE) {
1035
+ this.index++;
1036
+ const test = env.node;
1037
+ const consequent = this.gobbleExpression();
1038
+ if (!consequent) {
1039
+ this.throwError('Expected expression');
1040
+ }
1041
+ this.gobbleSpaces();
1042
+ if (this.code === jsep.COLON_CODE) {
1043
+ this.index++;
1044
+ const alternate = this.gobbleExpression();
1045
+ if (!alternate) {
1046
+ this.throwError('Expected expression');
1047
+ }
1048
+ env.node = {
1049
+ type: CONDITIONAL_EXP,
1050
+ test,
1051
+ consequent,
1052
+ alternate
1053
+ };
1054
+
1055
+ // check for operators of higher priority than ternary (i.e. assignment)
1056
+ // jsep sets || at 1, and assignment at 0.9, and conditional should be between them
1057
+ if (test.operator && jsep.binary_ops[test.operator] <= 0.9) {
1058
+ let newTest = test;
1059
+ while (newTest.right.operator && jsep.binary_ops[newTest.right.operator] <= 0.9) {
1060
+ newTest = newTest.right;
1061
+ }
1062
+ env.node.test = newTest.right;
1063
+ newTest.right = env.node;
1064
+ env.node = test;
1065
+ }
1066
+ } else {
1067
+ this.throwError('Expected :');
1068
+ }
1069
+ }
1070
+ });
1071
+ }
1072
+ };
1073
+
1074
+ // Add default plugins:
1075
+
1076
+ jsep.plugins.register(ternary);
1077
+
1078
+ const FSLASH_CODE = 47; // '/'
1079
+ const BSLASH_CODE = 92; // '\\'
1080
+
1081
+ var index = {
1082
+ name: 'regex',
1083
+ init(jsep) {
1084
+ // Regex literal: /abc123/ig
1085
+ jsep.hooks.add('gobble-token', function gobbleRegexLiteral(env) {
1086
+ if (this.code === FSLASH_CODE) {
1087
+ const patternIndex = ++this.index;
1088
+ let inCharSet = false;
1089
+ while (this.index < this.expr.length) {
1090
+ if (this.code === FSLASH_CODE && !inCharSet) {
1091
+ const pattern = this.expr.slice(patternIndex, this.index);
1092
+ let flags = '';
1093
+ while (++this.index < this.expr.length) {
1094
+ const code = this.code;
1095
+ if (code >= 97 && code <= 122 // a...z
1096
+ || code >= 65 && code <= 90 // A...Z
1097
+ || code >= 48 && code <= 57) {
1098
+ // 0-9
1099
+ flags += this.char;
1100
+ } else {
1101
+ break;
1102
+ }
1103
+ }
1104
+ let value;
1105
+ try {
1106
+ value = new RegExp(pattern, flags);
1107
+ } catch (e) {
1108
+ this.throwError(e.message);
1109
+ }
1110
+ env.node = {
1111
+ type: jsep.LITERAL,
1112
+ value,
1113
+ raw: this.expr.slice(patternIndex - 1, this.index)
1114
+ };
1115
+
1116
+ // allow . [] and () after regex: /regex/.test(a)
1117
+ env.node = this.gobbleTokenProperty(env.node);
1118
+ return env.node;
1119
+ }
1120
+ if (this.code === jsep.OBRACK_CODE) {
1121
+ inCharSet = true;
1122
+ } else if (inCharSet && this.code === jsep.CBRACK_CODE) {
1123
+ inCharSet = false;
1124
+ }
1125
+ this.index += this.code === BSLASH_CODE ? 2 : 1;
1126
+ }
1127
+ this.throwError('Unclosed Regex');
1128
+ }
1129
+ });
1130
+ }
1131
+ };
1132
+
1133
+ const PLUS_CODE = 43; // +
1134
+ const MINUS_CODE = 45; // -
1135
+
1136
+ const plugin = {
1137
+ name: 'assignment',
1138
+ assignmentOperators: new Set(['=', '*=', '**=', '/=', '%=', '+=', '-=', '<<=', '>>=', '>>>=', '&=', '^=', '|=', '||=', '&&=', '??=']),
1139
+ updateOperators: [PLUS_CODE, MINUS_CODE],
1140
+ assignmentPrecedence: 0.9,
1141
+ init(jsep) {
1142
+ const updateNodeTypes = [jsep.IDENTIFIER, jsep.MEMBER_EXP];
1143
+ plugin.assignmentOperators.forEach(op => jsep.addBinaryOp(op, plugin.assignmentPrecedence, true));
1144
+ jsep.hooks.add('gobble-token', function gobbleUpdatePrefix(env) {
1145
+ const code = this.code;
1146
+ if (plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) {
1147
+ this.index += 2;
1148
+ env.node = {
1149
+ type: 'UpdateExpression',
1150
+ operator: code === PLUS_CODE ? '++' : '--',
1151
+ argument: this.gobbleTokenProperty(this.gobbleIdentifier()),
1152
+ prefix: true
1153
+ };
1154
+ if (!env.node.argument || !updateNodeTypes.includes(env.node.argument.type)) {
1155
+ this.throwError(`Unexpected ${env.node.operator}`);
1156
+ }
1157
+ }
1158
+ });
1159
+ jsep.hooks.add('after-token', function gobbleUpdatePostfix(env) {
1160
+ if (env.node) {
1161
+ const code = this.code;
1162
+ if (plugin.updateOperators.some(c => c === code && c === this.expr.charCodeAt(this.index + 1))) {
1163
+ if (!updateNodeTypes.includes(env.node.type)) {
1164
+ this.throwError(`Unexpected ${env.node.operator}`);
1165
+ }
1166
+ this.index += 2;
1167
+ env.node = {
1168
+ type: 'UpdateExpression',
1169
+ operator: code === PLUS_CODE ? '++' : '--',
1170
+ argument: env.node,
1171
+ prefix: false
1172
+ };
1173
+ }
1174
+ }
1175
+ });
1176
+ jsep.hooks.add('after-expression', function gobbleAssignment(env) {
1177
+ if (env.node) {
1178
+ // Note: Binaries can be chained in a single expression to respect
1179
+ // operator precedence (i.e. a = b = 1 + 2 + 3)
1180
+ // Update all binary assignment nodes in the tree
1181
+ updateBinariesToAssignments(env.node);
1182
+ }
1183
+ });
1184
+ function updateBinariesToAssignments(node) {
1185
+ if (plugin.assignmentOperators.has(node.operator)) {
1186
+ node.type = 'AssignmentExpression';
1187
+ updateBinariesToAssignments(node.left);
1188
+ updateBinariesToAssignments(node.right);
1189
+ } else if (!node.operator) {
1190
+ Object.values(node).forEach(val => {
1191
+ if (val && typeof val === 'object') {
1192
+ updateBinariesToAssignments(val);
1193
+ }
1194
+ });
1195
+ }
1196
+ }
1197
+ }
1198
+ };
1199
+
1200
+ /* eslint-disable no-bitwise -- Convenient */
1201
+
1202
+ // register plugins
1203
+ jsep.plugins.register(index, plugin);
1204
+ jsep.addUnaryOp('typeof');
1205
+ jsep.addUnaryOp('void');
1206
+ jsep.addLiteral('null', null);
1207
+ jsep.addLiteral('undefined', undefined);
1208
+ const BLOCKED_PROTO_PROPERTIES = new Set(['constructor', '__proto__', '__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__']);
1209
+ const SafeEval = {
1210
+ /**
1211
+ * @param {jsep.Expression} ast
1212
+ * @param {Record<string, any>} subs
1213
+ */
1214
+ evalAst(ast, subs) {
1215
+ switch (ast.type) {
1216
+ case 'BinaryExpression':
1217
+ case 'LogicalExpression':
1218
+ return SafeEval.evalBinaryExpression(ast, subs);
1219
+ case 'Compound':
1220
+ return SafeEval.evalCompound(ast, subs);
1221
+ case 'ConditionalExpression':
1222
+ return SafeEval.evalConditionalExpression(ast, subs);
1223
+ case 'Identifier':
1224
+ return SafeEval.evalIdentifier(ast, subs);
1225
+ case 'Literal':
1226
+ return SafeEval.evalLiteral(ast, subs);
1227
+ case 'MemberExpression':
1228
+ return SafeEval.evalMemberExpression(ast, subs);
1229
+ case 'UnaryExpression':
1230
+ return SafeEval.evalUnaryExpression(ast, subs);
1231
+ case 'ArrayExpression':
1232
+ return SafeEval.evalArrayExpression(ast, subs);
1233
+ case 'CallExpression':
1234
+ return SafeEval.evalCallExpression(ast, subs);
1235
+ case 'AssignmentExpression':
1236
+ return SafeEval.evalAssignmentExpression(ast, subs);
1237
+ default:
1238
+ throw SyntaxError('Unexpected expression', ast);
1239
+ }
1240
+ },
1241
+ evalBinaryExpression(ast, subs) {
1242
+ const result = {
1243
+ '||': (a, b) => a || b(),
1244
+ '&&': (a, b) => a && b(),
1245
+ '|': (a, b) => a | b(),
1246
+ '^': (a, b) => a ^ b(),
1247
+ '&': (a, b) => a & b(),
1248
+ // eslint-disable-next-line eqeqeq -- API
1249
+ '==': (a, b) => a == b(),
1250
+ // eslint-disable-next-line eqeqeq -- API
1251
+ '!=': (a, b) => a != b(),
1252
+ '===': (a, b) => a === b(),
1253
+ '!==': (a, b) => a !== b(),
1254
+ '<': (a, b) => a < b(),
1255
+ '>': (a, b) => a > b(),
1256
+ '<=': (a, b) => a <= b(),
1257
+ '>=': (a, b) => a >= b(),
1258
+ '<<': (a, b) => a << b(),
1259
+ '>>': (a, b) => a >> b(),
1260
+ '>>>': (a, b) => a >>> b(),
1261
+ '+': (a, b) => a + b(),
1262
+ '-': (a, b) => a - b(),
1263
+ '*': (a, b) => a * b(),
1264
+ '/': (a, b) => a / b(),
1265
+ '%': (a, b) => a % b()
1266
+ }[ast.operator](SafeEval.evalAst(ast.left, subs), () => SafeEval.evalAst(ast.right, subs));
1267
+ return result;
1268
+ },
1269
+ evalCompound(ast, subs) {
1270
+ let last;
1271
+ for (let i = 0; i < ast.body.length; i++) {
1272
+ if (ast.body[i].type === 'Identifier' && ['var', 'let', 'const'].includes(ast.body[i].name) && ast.body[i + 1] && ast.body[i + 1].type === 'AssignmentExpression') {
1273
+ // var x=2; is detected as
1274
+ // [{Identifier var}, {AssignmentExpression x=2}]
1275
+ // eslint-disable-next-line @stylistic/max-len -- Long
1276
+ // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient
1277
+ i += 1;
1278
+ }
1279
+ const expr = ast.body[i];
1280
+ last = SafeEval.evalAst(expr, subs);
1281
+ }
1282
+ return last;
1283
+ },
1284
+ evalConditionalExpression(ast, subs) {
1285
+ if (SafeEval.evalAst(ast.test, subs)) {
1286
+ return SafeEval.evalAst(ast.consequent, subs);
1287
+ }
1288
+ return SafeEval.evalAst(ast.alternate, subs);
1289
+ },
1290
+ evalIdentifier(ast, subs) {
1291
+ if (Object.hasOwn(subs, ast.name)) {
1292
+ return subs[ast.name];
1293
+ }
1294
+ throw ReferenceError(`${ast.name} is not defined`);
1295
+ },
1296
+ evalLiteral(ast) {
1297
+ return ast.value;
1298
+ },
1299
+ evalMemberExpression(ast, subs) {
1300
+ const prop = String(
1301
+ // NOTE: `String(value)` throws error when
1302
+ // value has overwritten the toString method to return non-string
1303
+ // i.e. `value = {toString: () => []}`
1304
+ ast.computed ? SafeEval.evalAst(ast.property) // `object[property]`
1305
+ : ast.property.name // `object.property` property is Identifier
1306
+ );
1307
+ const obj = SafeEval.evalAst(ast.object, subs);
1308
+ if (obj === undefined || obj === null) {
1309
+ throw TypeError(`Cannot read properties of ${obj} (reading '${prop}')`);
1310
+ }
1311
+ if (!Object.hasOwn(obj, prop) && BLOCKED_PROTO_PROPERTIES.has(prop)) {
1312
+ throw TypeError(`Cannot read properties of ${obj} (reading '${prop}')`);
1313
+ }
1314
+ const result = obj[prop];
1315
+ if (typeof result === 'function') {
1316
+ return result.bind(obj); // arrow functions aren't affected by bind.
1317
+ }
1318
+ return result;
1319
+ },
1320
+ evalUnaryExpression(ast, subs) {
1321
+ const result = {
1322
+ '-': a => -SafeEval.evalAst(a, subs),
1323
+ '!': a => !SafeEval.evalAst(a, subs),
1324
+ '~': a => ~SafeEval.evalAst(a, subs),
1325
+ // eslint-disable-next-line no-implicit-coercion -- API
1326
+ '+': a => +SafeEval.evalAst(a, subs),
1327
+ typeof: a => typeof SafeEval.evalAst(a, subs),
1328
+ // eslint-disable-next-line no-void, sonarjs/void-use -- feature
1329
+ void: a => void SafeEval.evalAst(a, subs)
1330
+ }[ast.operator](ast.argument);
1331
+ return result;
1332
+ },
1333
+ evalArrayExpression(ast, subs) {
1334
+ return ast.elements.map(el => SafeEval.evalAst(el, subs));
1335
+ },
1336
+ evalCallExpression(ast, subs) {
1337
+ const args = ast.arguments.map(arg => SafeEval.evalAst(arg, subs));
1338
+ const func = SafeEval.evalAst(ast.callee, subs);
1339
+ /* c8 ignore start */
1340
+ if (func === Function) {
1341
+ // unreachable since BLOCKED_PROTO_PROPERTIES includes 'constructor'
1342
+ throw new Error('Function constructor is disabled');
1343
+ }
1344
+ /* c8 ignore end */
1345
+ return func(...args);
1346
+ },
1347
+ evalAssignmentExpression(ast, subs) {
1348
+ if (ast.left.type !== 'Identifier') {
1349
+ throw SyntaxError('Invalid left-hand side in assignment');
1350
+ }
1351
+ const id = ast.left.name;
1352
+ const value = SafeEval.evalAst(ast.right, subs);
1353
+ subs[id] = value;
1354
+ return subs[id];
1355
+ }
1356
+ };
1357
+
1358
+ /**
1359
+ * A replacement for NodeJS' VM.Script which is also {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP | Content Security Policy} friendly.
1360
+ */
1361
+ class SafeScript {
1362
+ /**
1363
+ * @param {string} expr Expression to evaluate
1364
+ */
1365
+ constructor(expr) {
1366
+ this.code = expr;
1367
+ this.ast = jsep(this.code);
1368
+ }
1369
+
1370
+ /**
1371
+ * @param {object} context Object whose items will be added
1372
+ * to evaluation
1373
+ * @returns {EvaluatedResult} Result of evaluated code
1374
+ */
1375
+ runInNewContext(context) {
1376
+ // `Object.create(null)` creates a prototypeless object
1377
+ const keyMap = Object.assign(Object.create(null), context);
1378
+ return SafeEval.evalAst(this.ast, keyMap);
1379
+ }
1380
+ }
1381
+
1382
+ /* eslint-disable camelcase -- Convenient for escaping */
1383
+
1384
+
1385
+ /**
1386
+ * @typedef {null|boolean|number|string|object|GenericArray} JSONObject
1387
+ */
1388
+
1389
+ /**
1390
+ * @typedef {any} AnyItem
1391
+ */
1392
+
1393
+ /**
1394
+ * @typedef {any} AnyResult
1395
+ */
1396
+
1397
+ /**
1398
+ * Copies array and then pushes item into it.
1399
+ * @param {GenericArray} arr Array to copy and into which to push
1400
+ * @param {AnyItem} item Array item to add (to end)
1401
+ * @returns {GenericArray} Copy of the original array
1402
+ */
1403
+ function push(arr, item) {
1404
+ arr = arr.slice();
1405
+ arr.push(item);
1406
+ return arr;
1407
+ }
1408
+ /**
1409
+ * Copies array and then unshifts item into it.
1410
+ * @param {AnyItem} item Array item to add (to beginning)
1411
+ * @param {GenericArray} arr Array to copy and into which to unshift
1412
+ * @returns {GenericArray} Copy of the original array
1413
+ */
1414
+ function unshift(item, arr) {
1415
+ arr = arr.slice();
1416
+ arr.unshift(item);
1417
+ return arr;
1418
+ }
1419
+
1420
+ /**
1421
+ * Caught when JSONPath is used without `new` but rethrown if with `new`
1422
+ * @extends Error
1423
+ */
1424
+ class NewError extends Error {
1425
+ /**
1426
+ * @param {AnyResult} value The evaluated scalar value
1427
+ */
1428
+ constructor(value) {
1429
+ super('JSONPath should not be called with "new" (it prevents return ' + 'of (unwrapped) scalar values)');
1430
+ this.avoidNew = true;
1431
+ this.value = value;
1432
+ this.name = 'NewError';
1433
+ }
1434
+ }
1435
+
1436
+ /**
1437
+ * @typedef {object} ReturnObject
1438
+ * @property {string} path
1439
+ * @property {JSONObject} value
1440
+ * @property {object|GenericArray} parent
1441
+ * @property {string} parentProperty
1442
+ */
1443
+
1444
+ /**
1445
+ * @callback JSONPathCallback
1446
+ * @param {string|object} preferredOutput
1447
+ * @param {"value"|"property"} type
1448
+ * @param {ReturnObject} fullRetObj
1449
+ * @returns {void}
1450
+ */
1451
+
1452
+ /**
1453
+ * @callback OtherTypeCallback
1454
+ * @param {JSONObject} val
1455
+ * @param {string} path
1456
+ * @param {object|GenericArray} parent
1457
+ * @param {string} parentPropName
1458
+ * @returns {boolean}
1459
+ */
1460
+
1461
+ /**
1462
+ * @typedef {any} ContextItem
1463
+ */
1464
+
1465
+ /**
1466
+ * @typedef {any} EvaluatedResult
1467
+ */
1468
+
1469
+ /**
1470
+ * @callback EvalCallback
1471
+ * @param {string} code
1472
+ * @param {ContextItem} context
1473
+ * @returns {EvaluatedResult}
1474
+ */
1475
+
1476
+ /**
1477
+ * @typedef {typeof SafeScript} EvalClass
1478
+ */
1479
+
1480
+ /**
1481
+ * @typedef {object} JSONPathOptions
1482
+ * @property {JSON} json
1483
+ * @property {string|string[]} path
1484
+ * @property {"value"|"path"|"pointer"|"parent"|"parentProperty"|
1485
+ * "all"} [resultType="value"]
1486
+ * @property {boolean} [flatten=false]
1487
+ * @property {boolean} [wrap=true]
1488
+ * @property {object} [sandbox={}]
1489
+ * @property {EvalCallback|EvalClass|'safe'|'native'|
1490
+ * boolean} [eval = 'safe']
1491
+ * @property {object|GenericArray|null} [parent=null]
1492
+ * @property {string|null} [parentProperty=null]
1493
+ * @property {JSONPathCallback} [callback]
1494
+ * @property {OtherTypeCallback} [otherTypeCallback] Defaults to
1495
+ * function which throws on encountering `@other`
1496
+ * @property {boolean} [autostart=true]
1497
+ */
1498
+
1499
+ /**
1500
+ * @param {string|JSONPathOptions} opts If a string, will be treated as `expr`
1501
+ * @param {string} [expr] JSON path to evaluate
1502
+ * @param {JSON} [obj] JSON object to evaluate against
1503
+ * @param {JSONPathCallback} [callback] Passed 3 arguments: 1) desired payload
1504
+ * per `resultType`, 2) `"value"|"property"`, 3) Full returned object with
1505
+ * all payloads
1506
+ * @param {OtherTypeCallback} [otherTypeCallback] If `@other()` is at the end
1507
+ * of one's query, this will be invoked with the value of the item, its
1508
+ * path, its parent, and its parent's property name, and it should return
1509
+ * a boolean indicating whether the supplied value belongs to the "other"
1510
+ * type or not (or it may handle transformations and return `false`).
1511
+ * @returns {JSONPath}
1512
+ * @class
1513
+ */
1514
+ function JSONPath(opts, expr, obj, callback, otherTypeCallback) {
1515
+ // eslint-disable-next-line no-restricted-syntax -- Allow for pseudo-class
1516
+ if (!(this instanceof JSONPath)) {
1517
+ try {
1518
+ return new JSONPath(opts, expr, obj, callback, otherTypeCallback);
1519
+ } catch (e) {
1520
+ if (!e.avoidNew) {
1521
+ throw e;
1522
+ }
1523
+ return e.value;
1524
+ }
1525
+ }
1526
+ if (typeof opts === 'string') {
1527
+ otherTypeCallback = callback;
1528
+ callback = obj;
1529
+ obj = expr;
1530
+ expr = opts;
1531
+ opts = null;
1532
+ }
1533
+ const optObj = opts && typeof opts === 'object';
1534
+ opts = opts || {};
1535
+ this.json = opts.json || obj;
1536
+ this.path = opts.path || expr;
1537
+ this.resultType = opts.resultType || 'value';
1538
+ this.flatten = opts.flatten || false;
1539
+ this.wrap = Object.hasOwn(opts, 'wrap') ? opts.wrap : true;
1540
+ this.sandbox = opts.sandbox || {};
1541
+ this.eval = opts.eval === undefined ? 'safe' : opts.eval;
1542
+ this.ignoreEvalErrors = typeof opts.ignoreEvalErrors === 'undefined' ? false : opts.ignoreEvalErrors;
1543
+ this.parent = opts.parent || null;
1544
+ this.parentProperty = opts.parentProperty || null;
1545
+ this.callback = opts.callback || callback || null;
1546
+ this.otherTypeCallback = opts.otherTypeCallback || otherTypeCallback || function () {
1547
+ throw new TypeError('You must supply an otherTypeCallback callback option ' + 'with the @other() operator.');
1548
+ };
1549
+ if (opts.autostart !== false) {
1550
+ const args = {
1551
+ path: optObj ? opts.path : expr
1552
+ };
1553
+ if (!optObj) {
1554
+ args.json = obj;
1555
+ } else if ('json' in opts) {
1556
+ args.json = opts.json;
1557
+ }
1558
+ const ret = this.evaluate(args);
1559
+ if (!ret || typeof ret !== 'object') {
1560
+ throw new NewError(ret);
1561
+ }
1562
+ return ret;
1563
+ }
1564
+ }
1565
+
1566
+ // PUBLIC METHODS
1567
+ JSONPath.prototype.evaluate = function (expr, json, callback, otherTypeCallback) {
1568
+ let currParent = this.parent,
1569
+ currParentProperty = this.parentProperty;
1570
+ let {
1571
+ flatten,
1572
+ wrap
1573
+ } = this;
1574
+ this.currResultType = this.resultType;
1575
+ this.currEval = this.eval;
1576
+ this.currSandbox = this.sandbox;
1577
+ callback = callback || this.callback;
1578
+ this.currOtherTypeCallback = otherTypeCallback || this.otherTypeCallback;
1579
+ json = json || this.json;
1580
+ expr = expr || this.path;
1581
+ if (expr && typeof expr === 'object' && !Array.isArray(expr)) {
1582
+ if (!expr.path && expr.path !== '') {
1583
+ throw new TypeError('You must supply a "path" property when providing an object ' + 'argument to JSONPath.evaluate().');
1584
+ }
1585
+ if (!Object.hasOwn(expr, 'json')) {
1586
+ throw new TypeError('You must supply a "json" property when providing an object ' + 'argument to JSONPath.evaluate().');
1587
+ }
1588
+ ({
1589
+ json
1590
+ } = expr);
1591
+ flatten = Object.hasOwn(expr, 'flatten') ? expr.flatten : flatten;
1592
+ this.currResultType = Object.hasOwn(expr, 'resultType') ? expr.resultType : this.currResultType;
1593
+ this.currSandbox = Object.hasOwn(expr, 'sandbox') ? expr.sandbox : this.currSandbox;
1594
+ wrap = Object.hasOwn(expr, 'wrap') ? expr.wrap : wrap;
1595
+ this.currEval = Object.hasOwn(expr, 'eval') ? expr.eval : this.currEval;
1596
+ callback = Object.hasOwn(expr, 'callback') ? expr.callback : callback;
1597
+ this.currOtherTypeCallback = Object.hasOwn(expr, 'otherTypeCallback') ? expr.otherTypeCallback : this.currOtherTypeCallback;
1598
+ currParent = Object.hasOwn(expr, 'parent') ? expr.parent : currParent;
1599
+ currParentProperty = Object.hasOwn(expr, 'parentProperty') ? expr.parentProperty : currParentProperty;
1600
+ expr = expr.path;
1601
+ }
1602
+ currParent = currParent || null;
1603
+ currParentProperty = currParentProperty || null;
1604
+ if (Array.isArray(expr)) {
1605
+ expr = JSONPath.toPathString(expr);
1606
+ }
1607
+ if (!expr && expr !== '' || !json) {
1608
+ return undefined;
1609
+ }
1610
+ const exprList = JSONPath.toPathArray(expr);
1611
+ if (exprList[0] === '$' && exprList.length > 1) {
1612
+ exprList.shift();
1613
+ }
1614
+ this._hasParentSelector = null;
1615
+ const result = this._trace(exprList, json, ['$'], currParent, currParentProperty, callback).filter(function (ea) {
1616
+ return ea && !ea.isParentSelector;
1617
+ });
1618
+ if (!result.length) {
1619
+ return wrap ? [] : undefined;
1620
+ }
1621
+ if (!wrap && result.length === 1 && !result[0].hasArrExpr) {
1622
+ return this._getPreferredOutput(result[0]);
1623
+ }
1624
+ return result.reduce((rslt, ea) => {
1625
+ const valOrPath = this._getPreferredOutput(ea);
1626
+ if (flatten && Array.isArray(valOrPath)) {
1627
+ rslt = rslt.concat(valOrPath);
1628
+ } else {
1629
+ rslt.push(valOrPath);
1630
+ }
1631
+ return rslt;
1632
+ }, []);
1633
+ };
1634
+
1635
+ // PRIVATE METHODS
1636
+
1637
+ JSONPath.prototype._getPreferredOutput = function (ea) {
1638
+ const resultType = this.currResultType;
1639
+ switch (resultType) {
1640
+ case 'all':
1641
+ {
1642
+ const path = Array.isArray(ea.path) ? ea.path : JSONPath.toPathArray(ea.path);
1643
+ ea.pointer = JSONPath.toPointer(path);
1644
+ ea.path = typeof ea.path === 'string' ? ea.path : JSONPath.toPathString(ea.path);
1645
+ return ea;
1646
+ }
1647
+ case 'value':
1648
+ case 'parent':
1649
+ case 'parentProperty':
1650
+ return ea[resultType];
1651
+ case 'path':
1652
+ return JSONPath.toPathString(ea[resultType]);
1653
+ case 'pointer':
1654
+ return JSONPath.toPointer(ea.path);
1655
+ default:
1656
+ throw new TypeError('Unknown result type');
1657
+ }
1658
+ };
1659
+ JSONPath.prototype._handleCallback = function (fullRetObj, callback, type) {
1660
+ if (callback) {
1661
+ const preferredOutput = this._getPreferredOutput(fullRetObj);
1662
+ fullRetObj.path = typeof fullRetObj.path === 'string' ? fullRetObj.path : JSONPath.toPathString(fullRetObj.path);
1663
+ // eslint-disable-next-line n/callback-return -- No need to return
1664
+ callback(preferredOutput, type, fullRetObj);
1665
+ }
1666
+ };
1667
+
1668
+ /**
1669
+ *
1670
+ * @param {string} expr
1671
+ * @param {JSONObject} val
1672
+ * @param {string} path
1673
+ * @param {object|GenericArray} parent
1674
+ * @param {string} parentPropName
1675
+ * @param {JSONPathCallback} callback
1676
+ * @param {boolean} hasArrExpr
1677
+ * @param {boolean} literalPriority
1678
+ * @returns {ReturnObject|ReturnObject[]}
1679
+ */
1680
+ JSONPath.prototype._trace = function (expr, val, path, parent, parentPropName, callback, hasArrExpr, literalPriority) {
1681
+ // No expr to follow? return path and value as the result of
1682
+ // this trace branch
1683
+ let retObj;
1684
+ if (!expr.length) {
1685
+ retObj = {
1686
+ path,
1687
+ value: val,
1688
+ parent,
1689
+ parentProperty: parentPropName,
1690
+ hasArrExpr
1691
+ };
1692
+ this._handleCallback(retObj, callback, 'value');
1693
+ return retObj;
1694
+ }
1695
+ const loc = expr[0],
1696
+ x = expr.slice(1);
1697
+
1698
+ // We need to gather the return value of recursive trace calls in order to
1699
+ // do the parent sel computation.
1700
+ const ret = [];
1701
+ /**
1702
+ *
1703
+ * @param {ReturnObject|ReturnObject[]} elems
1704
+ * @returns {void}
1705
+ */
1706
+ function addRet(elems) {
1707
+ if (Array.isArray(elems)) {
1708
+ // This was causing excessive stack size in Node (with or
1709
+ // without Babel) against our performance test:
1710
+ // `ret.push(...elems);`
1711
+ elems.forEach(t => {
1712
+ ret.push(t);
1713
+ });
1714
+ } else {
1715
+ ret.push(elems);
1716
+ }
1717
+ }
1718
+ if ((typeof loc !== 'string' || literalPriority) && val && Object.hasOwn(val, loc)) {
1719
+ // simple case--directly follow property
1720
+ addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback, hasArrExpr));
1721
+ // eslint-disable-next-line unicorn/prefer-switch -- Part of larger `if`
1722
+ } else if (loc === '*') {
1723
+ // all child properties
1724
+ this._walk(val, m => {
1725
+ addRet(this._trace(x, val[m], push(path, m), val, m, callback, true, true));
1726
+ });
1727
+ } else if (loc === '..') {
1728
+ // all descendent parent properties
1729
+ // Check remaining expression with val's immediate children
1730
+ addRet(this._trace(x, val, path, parent, parentPropName, callback, hasArrExpr));
1731
+ this._walk(val, m => {
1732
+ // We don't join m and x here because we only want parents,
1733
+ // not scalar values
1734
+ if (typeof val[m] === 'object') {
1735
+ // Keep going with recursive descent on val's
1736
+ // object children
1737
+ addRet(this._trace(expr.slice(), val[m], push(path, m), val, m, callback, true));
1738
+ }
1739
+ });
1740
+ // The parent sel computation is handled in the frame above using the
1741
+ // ancestor object of val
1742
+ } else if (loc === '^') {
1743
+ // This is not a final endpoint, so we do not invoke the callback here
1744
+ this._hasParentSelector = true;
1745
+ return {
1746
+ path: path.slice(0, -1),
1747
+ expr: x,
1748
+ isParentSelector: true
1749
+ };
1750
+ } else if (loc === '~') {
1751
+ // property name
1752
+ retObj = {
1753
+ path: push(path, loc),
1754
+ value: parentPropName,
1755
+ parent,
1756
+ parentProperty: null
1757
+ };
1758
+ this._handleCallback(retObj, callback, 'property');
1759
+ return retObj;
1760
+ } else if (loc === '$') {
1761
+ // root only
1762
+ addRet(this._trace(x, val, path, null, null, callback, hasArrExpr));
1763
+ } else if (/^(-?\d*):(-?\d*):?(\d*)$/u.test(loc)) {
1764
+ // [start:end:step] Python slice syntax
1765
+ addRet(this._slice(loc, x, val, path, parent, parentPropName, callback));
1766
+ } else if (loc.indexOf('?(') === 0) {
1767
+ // [?(expr)] (filtering)
1768
+ if (this.currEval === false) {
1769
+ throw new Error('Eval [?(expr)] prevented in JSONPath expression.');
1770
+ }
1771
+ const safeLoc = loc.replace(/^\?\((.*?)\)$/u, '$1');
1772
+ // check for a nested filter expression
1773
+ const nested = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(safeLoc);
1774
+ if (nested) {
1775
+ // find if there are matches in the nested expression
1776
+ // add them to the result set if there is at least one match
1777
+ this._walk(val, m => {
1778
+ const npath = [nested[2]];
1779
+ const nvalue = nested[1] ? val[m][nested[1]] : val[m];
1780
+ const filterResults = this._trace(npath, nvalue, path, parent, parentPropName, callback, true);
1781
+ if (filterResults.length > 0) {
1782
+ addRet(this._trace(x, val[m], push(path, m), val, m, callback, true));
1783
+ }
1784
+ });
1785
+ } else {
1786
+ this._walk(val, m => {
1787
+ if (this._eval(safeLoc, val[m], m, path, parent, parentPropName)) {
1788
+ addRet(this._trace(x, val[m], push(path, m), val, m, callback, true));
1789
+ }
1790
+ });
1791
+ }
1792
+ } else if (loc[0] === '(') {
1793
+ // [(expr)] (dynamic property/index)
1794
+ if (this.currEval === false) {
1795
+ throw new Error('Eval [(expr)] prevented in JSONPath expression.');
1796
+ }
1797
+ // As this will resolve to a property name (but we don't know it
1798
+ // yet), property and parent information is relative to the
1799
+ // parent of the property to which this expression will resolve
1800
+ addRet(this._trace(unshift(this._eval(loc, val, path.at(-1), path.slice(0, -1), parent, parentPropName), x), val, path, parent, parentPropName, callback, hasArrExpr));
1801
+ } else if (loc[0] === '@') {
1802
+ // value type: @boolean(), etc.
1803
+ let addType = false;
1804
+ const valueType = loc.slice(1, -2);
1805
+ switch (valueType) {
1806
+ case 'scalar':
1807
+ if (!val || !['object', 'function'].includes(typeof val)) {
1808
+ addType = true;
1809
+ }
1810
+ break;
1811
+ case 'boolean':
1812
+ case 'string':
1813
+ case 'undefined':
1814
+ case 'function':
1815
+ if (typeof val === valueType) {
1816
+ addType = true;
1817
+ }
1818
+ break;
1819
+ case 'integer':
1820
+ if (Number.isFinite(val) && !(val % 1)) {
1821
+ addType = true;
1822
+ }
1823
+ break;
1824
+ case 'number':
1825
+ if (Number.isFinite(val)) {
1826
+ addType = true;
1827
+ }
1828
+ break;
1829
+ case 'nonFinite':
1830
+ if (typeof val === 'number' && !Number.isFinite(val)) {
1831
+ addType = true;
1832
+ }
1833
+ break;
1834
+ case 'object':
1835
+ if (val && typeof val === valueType) {
1836
+ addType = true;
1837
+ }
1838
+ break;
1839
+ case 'array':
1840
+ if (Array.isArray(val)) {
1841
+ addType = true;
1842
+ }
1843
+ break;
1844
+ case 'other':
1845
+ addType = this.currOtherTypeCallback(val, path, parent, parentPropName);
1846
+ break;
1847
+ case 'null':
1848
+ if (val === null) {
1849
+ addType = true;
1850
+ }
1851
+ break;
1852
+ /* c8 ignore next 2 */
1853
+ default:
1854
+ throw new TypeError('Unknown value type ' + valueType);
1855
+ }
1856
+ if (addType) {
1857
+ retObj = {
1858
+ path,
1859
+ value: val,
1860
+ parent,
1861
+ parentProperty: parentPropName
1862
+ };
1863
+ this._handleCallback(retObj, callback, 'value');
1864
+ return retObj;
1865
+ }
1866
+ // `-escaped property
1867
+ } else if (loc[0] === '`' && val && Object.hasOwn(val, loc.slice(1))) {
1868
+ const locProp = loc.slice(1);
1869
+ addRet(this._trace(x, val[locProp], push(path, locProp), val, locProp, callback, hasArrExpr, true));
1870
+ } else if (loc.includes(',')) {
1871
+ // [name1,name2,...]
1872
+ const parts = loc.split(',');
1873
+ for (const part of parts) {
1874
+ addRet(this._trace(unshift(part, x), val, path, parent, parentPropName, callback, true));
1875
+ }
1876
+ // simple case--directly follow property
1877
+ } else if (!literalPriority && val && Object.hasOwn(val, loc)) {
1878
+ addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback, hasArrExpr, true));
1879
+ }
1880
+
1881
+ // We check the resulting values for parent selections. For parent
1882
+ // selections we discard the value object and continue the trace with the
1883
+ // current val object
1884
+ if (this._hasParentSelector) {
1885
+ for (let t = 0; t < ret.length; t++) {
1886
+ const rett = ret[t];
1887
+ if (rett && rett.isParentSelector) {
1888
+ const tmp = this._trace(rett.expr, val, rett.path, parent, parentPropName, callback, hasArrExpr);
1889
+ if (Array.isArray(tmp)) {
1890
+ ret[t] = tmp[0];
1891
+ const tl = tmp.length;
1892
+ for (let tt = 1; tt < tl; tt++) {
1893
+ // eslint-disable-next-line @stylistic/max-len -- Long
1894
+ // eslint-disable-next-line sonarjs/updated-loop-counter -- Convenient
1895
+ t++;
1896
+ ret.splice(t, 0, tmp[tt]);
1897
+ }
1898
+ } else {
1899
+ ret[t] = tmp;
1900
+ }
1901
+ }
1902
+ }
1903
+ }
1904
+ return ret;
1905
+ };
1906
+ JSONPath.prototype._walk = function (val, f) {
1907
+ if (Array.isArray(val)) {
1908
+ const n = val.length;
1909
+ for (let i = 0; i < n; i++) {
1910
+ f(i);
1911
+ }
1912
+ } else if (val && typeof val === 'object') {
1913
+ Object.keys(val).forEach(m => {
1914
+ f(m);
1915
+ });
1916
+ }
1917
+ };
1918
+ JSONPath.prototype._slice = function (loc, expr, val, path, parent, parentPropName, callback) {
1919
+ if (!Array.isArray(val)) {
1920
+ return undefined;
1921
+ }
1922
+ const len = val.length,
1923
+ parts = loc.split(':'),
1924
+ step = parts[2] && Number.parseInt(parts[2]) || 1;
1925
+ let start = parts[0] && Number.parseInt(parts[0]) || 0,
1926
+ end = parts[1] && Number.parseInt(parts[1]) || len;
1927
+ start = start < 0 ? Math.max(0, start + len) : Math.min(len, start);
1928
+ end = end < 0 ? Math.max(0, end + len) : Math.min(len, end);
1929
+ const ret = [];
1930
+ for (let i = start; i < end; i += step) {
1931
+ const tmp = this._trace(unshift(i, expr), val, path, parent, parentPropName, callback, true);
1932
+ // Should only be possible to be an array here since first part of
1933
+ // ``unshift(i, expr)` passed in above would not be empty, nor `~`,
1934
+ // nor begin with `@` (as could return objects)
1935
+ // This was causing excessive stack size in Node (with or
1936
+ // without Babel) against our performance test: `ret.push(...tmp);`
1937
+ tmp.forEach(t => {
1938
+ ret.push(t);
1939
+ });
1940
+ }
1941
+ return ret;
1942
+ };
1943
+ JSONPath.prototype._eval = function (code, _v, _vname, path, parent, parentPropName) {
1944
+ this.currSandbox._$_parentProperty = parentPropName;
1945
+ this.currSandbox._$_parent = parent;
1946
+ this.currSandbox._$_property = _vname;
1947
+ this.currSandbox._$_root = this.json;
1948
+ this.currSandbox._$_v = _v;
1949
+ const containsPath = code.includes('@path');
1950
+ if (containsPath) {
1951
+ this.currSandbox._$_path = JSONPath.toPathString(path.concat([_vname]));
1952
+ }
1953
+ const scriptCacheKey = this.currEval + 'Script:' + code;
1954
+ if (!JSONPath.cache[scriptCacheKey]) {
1955
+ let script = code.replaceAll('@parentProperty', '_$_parentProperty').replaceAll('@parent', '_$_parent').replaceAll('@property', '_$_property').replaceAll('@root', '_$_root').replaceAll(/@([.\s)[])/gu, '_$_v$1');
1956
+ if (containsPath) {
1957
+ script = script.replaceAll('@path', '_$_path');
1958
+ }
1959
+ if (this.currEval === 'safe' || this.currEval === true || this.currEval === undefined) {
1960
+ JSONPath.cache[scriptCacheKey] = new this.safeVm.Script(script);
1961
+ } else if (this.currEval === 'native') {
1962
+ JSONPath.cache[scriptCacheKey] = new this.vm.Script(script);
1963
+ } else if (typeof this.currEval === 'function' && this.currEval.prototype && Object.hasOwn(this.currEval.prototype, 'runInNewContext')) {
1964
+ const CurrEval = this.currEval;
1965
+ JSONPath.cache[scriptCacheKey] = new CurrEval(script);
1966
+ } else if (typeof this.currEval === 'function') {
1967
+ JSONPath.cache[scriptCacheKey] = {
1968
+ runInNewContext: context => this.currEval(script, context)
1969
+ };
1970
+ } else {
1971
+ throw new TypeError(`Unknown "eval" property "${this.currEval}"`);
1972
+ }
1973
+ }
1974
+ try {
1975
+ return JSONPath.cache[scriptCacheKey].runInNewContext(this.currSandbox);
1976
+ } catch (e) {
1977
+ if (this.ignoreEvalErrors) {
1978
+ return false;
1979
+ }
1980
+ throw new Error('jsonPath: ' + e.message + ': ' + code);
1981
+ }
1982
+ };
1983
+
1984
+ // PUBLIC CLASS PROPERTIES AND METHODS
1985
+
1986
+ // Could store the cache object itself
1987
+ JSONPath.cache = {};
1988
+
1989
+ /**
1990
+ * @param {string[]} pathArr Array to convert
1991
+ * @returns {string} The path string
1992
+ */
1993
+ JSONPath.toPathString = function (pathArr) {
1994
+ const x = pathArr,
1995
+ n = x.length;
1996
+ let p = '$';
1997
+ for (let i = 1; i < n; i++) {
1998
+ if (!/^(~|\^|@.*?\(\))$/u.test(x[i])) {
1999
+ p += /^[0-9*]+$/u.test(x[i]) ? '[' + x[i] + ']' : "['" + x[i] + "']";
2000
+ }
2001
+ }
2002
+ return p;
2003
+ };
2004
+
2005
+ /**
2006
+ * @param {string} pointer JSON Path
2007
+ * @returns {string} JSON Pointer
2008
+ */
2009
+ JSONPath.toPointer = function (pointer) {
2010
+ const x = pointer,
2011
+ n = x.length;
2012
+ let p = '';
2013
+ for (let i = 1; i < n; i++) {
2014
+ if (!/^(~|\^|@.*?\(\))$/u.test(x[i])) {
2015
+ p += '/' + x[i].toString().replaceAll('~', '~0').replaceAll('/', '~1');
2016
+ }
2017
+ }
2018
+ return p;
2019
+ };
2020
+
2021
+ /**
2022
+ * @param {string} expr Expression to convert
2023
+ * @returns {string[]}
2024
+ */
2025
+ JSONPath.toPathArray = function (expr) {
2026
+ const {
2027
+ cache
2028
+ } = JSONPath;
2029
+ if (cache[expr]) {
2030
+ return cache[expr].concat();
2031
+ }
2032
+ const subx = [];
2033
+ const normalized = expr
2034
+ // Properties
2035
+ .replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu, ';$&;')
2036
+ // Parenthetical evaluations (filtering and otherwise), directly
2037
+ // within brackets or single quotes
2038
+ .replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu, function ($0, $1) {
2039
+ return '[#' + (subx.push($1) - 1) + ']';
2040
+ })
2041
+ // Escape periods and tildes within properties
2042
+ .replaceAll(/\[['"]([^'\]]*)['"]\]/gu, function ($0, prop) {
2043
+ return "['" + prop.replaceAll('.', '%@%').replaceAll('~', '%%@@%%') + "']";
2044
+ })
2045
+ // Properties operator
2046
+ .replaceAll('~', ';~;')
2047
+ // Split by property boundaries
2048
+ .replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu, ';')
2049
+ // Reinsert periods within properties
2050
+ .replaceAll('%@%', '.')
2051
+ // Reinsert tildes within properties
2052
+ .replaceAll('%%@@%%', '~')
2053
+ // Parent
2054
+ .replaceAll(/(?:;)?(\^+)(?:;)?/gu, function ($0, ups) {
2055
+ return ';' + ups.split('').join(';') + ';';
2056
+ })
2057
+ // Descendents
2058
+ .replaceAll(/;;;|;;/gu, ';..;')
2059
+ // Remove trailing
2060
+ .replaceAll(/;$|'?\]|'$/gu, '');
2061
+ const exprList = normalized.split(';').map(function (exp) {
2062
+ const match = exp.match(/#(\d+)/u);
2063
+ return !match || !match[1] ? exp : subx[match[1]];
2064
+ });
2065
+ cache[expr] = exprList;
2066
+ return cache[expr].concat();
2067
+ };
2068
+ JSONPath.prototype.safeVm = {
2069
+ Script: SafeScript
2070
+ };
2071
+
2072
+ JSONPath.prototype.vm = vm;
2073
+
2074
+ export { JSONPath };