terraconstructs 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.envrc +5 -0
- package/.jsii +79780 -0
- package/.mise.toml +8 -0
- package/.nvmrc +1 -0
- package/.terraform-version +1 -0
- package/.terraform.d/plugin-cache/.gitignore +5 -0
- package/LICENSE +674 -0
- package/NOTICE.txt +12 -0
- package/README.md +42 -0
- package/bun.lockb +0 -0
- package/go.mod +158 -0
- package/go.sum +1206 -0
- package/lib/aws/arn.d.ts +187 -0
- package/lib/aws/arn.js +383 -0
- package/lib/aws/aws-construct.d.ts +76 -0
- package/lib/aws/aws-construct.js +38 -0
- package/lib/aws/aws-stack.d.ts +201 -0
- package/lib/aws/aws-stack.js +303 -0
- package/lib/aws/cloudwatch/actions/ec2.d.ts +35 -0
- package/lib/aws/cloudwatch/actions/ec2.js +48 -0
- package/lib/aws/cloudwatch/actions/index.d.ts +2 -0
- package/lib/aws/cloudwatch/actions/index.js +24 -0
- package/lib/aws/cloudwatch/actions/lambda.d.ts +16 -0
- package/lib/aws/cloudwatch/actions/lambda.js +48 -0
- package/lib/aws/cloudwatch/alarm-action.d.ts +23 -0
- package/lib/aws/cloudwatch/alarm-action.js +4 -0
- package/lib/aws/cloudwatch/alarm-base.d.ts +84 -0
- package/lib/aws/cloudwatch/alarm-base.js +64 -0
- package/lib/aws/cloudwatch/alarm-rule.d.ts +61 -0
- package/lib/aws/cloudwatch/alarm-rule.js +116 -0
- package/lib/aws/cloudwatch/alarm-status-widget.d.ts +77 -0
- package/lib/aws/cloudwatch/alarm-status-widget.js +62 -0
- package/lib/aws/cloudwatch/alarm.d.ts +158 -0
- package/lib/aws/cloudwatch/alarm.js +410 -0
- package/lib/aws/cloudwatch/composite-alarm.d.ts +88 -0
- package/lib/aws/cloudwatch/composite-alarm.js +98 -0
- package/lib/aws/cloudwatch/dashboard.d.ts +137 -0
- package/lib/aws/cloudwatch/dashboard.js +141 -0
- package/lib/aws/cloudwatch/data-protection-policy.d.ts +184 -0
- package/lib/aws/cloudwatch/data-protection-policy.js +246 -0
- package/lib/aws/cloudwatch/graph.d.ts +792 -0
- package/lib/aws/cloudwatch/graph.js +537 -0
- package/lib/aws/cloudwatch/index.d.ts +26 -0
- package/lib/aws/cloudwatch/index.js +49 -0
- package/lib/aws/cloudwatch/layout.d.ts +89 -0
- package/lib/aws/cloudwatch/layout.js +147 -0
- package/lib/aws/cloudwatch/log-destinations/index.d.ts +2 -0
- package/lib/aws/cloudwatch/log-destinations/index.js +20 -0
- package/lib/aws/cloudwatch/log-destinations/kinesis.d.ts +29 -0
- package/lib/aws/cloudwatch/log-destinations/kinesis.js +52 -0
- package/lib/aws/cloudwatch/log-destinations/lambda.d.ts +22 -0
- package/lib/aws/cloudwatch/log-destinations/lambda.js +46 -0
- package/lib/aws/cloudwatch/log-group.d.ts +453 -0
- package/lib/aws/cloudwatch/log-group.js +350 -0
- package/lib/aws/cloudwatch/log-query.d.ts +91 -0
- package/lib/aws/cloudwatch/log-query.js +85 -0
- package/lib/aws/cloudwatch/log-stream.d.ts +57 -0
- package/lib/aws/cloudwatch/log-stream.js +57 -0
- package/lib/aws/cloudwatch/metric-filter.d.ts +30 -0
- package/lib/aws/cloudwatch/metric-filter.js +69 -0
- package/lib/aws/cloudwatch/metric-types.d.ts +407 -0
- package/lib/aws/cloudwatch/metric-types.js +151 -0
- package/lib/aws/cloudwatch/metric.d.ts +492 -0
- package/lib/aws/cloudwatch/metric.js +493 -0
- package/lib/aws/cloudwatch/pattern.d.ts +195 -0
- package/lib/aws/cloudwatch/pattern.js +412 -0
- package/lib/aws/cloudwatch/policy.d.ts +43 -0
- package/lib/aws/cloudwatch/policy.js +50 -0
- package/lib/aws/cloudwatch/private/drop-empty-object-at-the-end-of-an-array-token.d.ts +14 -0
- package/lib/aws/cloudwatch/private/drop-empty-object-at-the-end-of-an-array-token.js +37 -0
- package/lib/aws/cloudwatch/private/env-tokens.d.ts +8 -0
- package/lib/aws/cloudwatch/private/env-tokens.js +48 -0
- package/lib/aws/cloudwatch/private/metric-util.d.ts +60 -0
- package/lib/aws/cloudwatch/private/metric-util.js +132 -0
- package/lib/aws/cloudwatch/private/object.d.ts +1 -0
- package/lib/aws/cloudwatch/private/object.js +18 -0
- package/lib/aws/cloudwatch/private/rendering.d.ts +60 -0
- package/lib/aws/cloudwatch/private/rendering.js +181 -0
- package/lib/aws/cloudwatch/private/statistic.d.ts +51 -0
- package/lib/aws/cloudwatch/private/statistic.js +176 -0
- package/lib/aws/cloudwatch/query-definition.d.ts +150 -0
- package/lib/aws/cloudwatch/query-definition.js +114 -0
- package/lib/aws/cloudwatch/stats.d.ts +150 -0
- package/lib/aws/cloudwatch/stats.js +207 -0
- package/lib/aws/cloudwatch/subscription-filter.d.ts +75 -0
- package/lib/aws/cloudwatch/subscription-filter.js +51 -0
- package/lib/aws/cloudwatch/text.d.ts +52 -0
- package/lib/aws/cloudwatch/text.js +53 -0
- package/lib/aws/cloudwatch/variable.d.ts +156 -0
- package/lib/aws/cloudwatch/variable.js +156 -0
- package/lib/aws/cloudwatch/widget.d.ts +62 -0
- package/lib/aws/cloudwatch/widget.js +45 -0
- package/lib/aws/compute/activity.d.ts +81 -0
- package/lib/aws/compute/activity.js +132 -0
- package/lib/aws/compute/architecture.d.ts +33 -0
- package/lib/aws/compute/architecture.js +42 -0
- package/lib/aws/compute/chain.d.ts +52 -0
- package/lib/aws/compute/chain.js +68 -0
- package/lib/aws/compute/condition.d.ts +202 -0
- package/lib/aws/compute/condition.js +409 -0
- package/lib/aws/compute/event-invoke-config.d.ts +74 -0
- package/lib/aws/compute/event-invoke-config.js +63 -0
- package/lib/aws/compute/event-source-filter.d.ts +64 -0
- package/lib/aws/compute/event-source-filter.js +86 -0
- package/lib/aws/compute/event-source-mapping.d.ts +310 -0
- package/lib/aws/compute/event-source-mapping.js +267 -0
- package/lib/aws/compute/event-sources/index.d.ts +4 -0
- package/lib/aws/compute/event-sources/index.js +28 -0
- package/lib/aws/compute/event-sources/s3-onfailure-destination.d.ts +13 -0
- package/lib/aws/compute/event-sources/s3-onfailure-destination.js +26 -0
- package/lib/aws/compute/event-sources/s3.d.ts +24 -0
- package/lib/aws/compute/event-sources/s3.js +25 -0
- package/lib/aws/compute/event-sources/sqs-dlq.d.ts +13 -0
- package/lib/aws/compute/event-sources/sqs-dlq.js +26 -0
- package/lib/aws/compute/event-sources/sqs.d.ts +75 -0
- package/lib/aws/compute/event-sources/sqs.js +84 -0
- package/lib/aws/compute/fields.d.ts +367 -0
- package/lib/aws/compute/fields.js +546 -0
- package/lib/aws/compute/function-alias.d.ts +148 -0
- package/lib/aws/compute/function-alias.js +176 -0
- package/lib/aws/compute/function-base.d.ts +314 -0
- package/lib/aws/compute/function-base.js +421 -0
- package/lib/aws/compute/function-destination.d.ts +42 -0
- package/lib/aws/compute/function-destination.js +18 -0
- package/lib/aws/compute/function-destinations/event-bridge.d.ts +19 -0
- package/lib/aws/compute/function-destinations/event-bridge.js +46 -0
- package/lib/aws/compute/function-destinations/function.d.ts +34 -0
- package/lib/aws/compute/function-destinations/function.js +55 -0
- package/lib/aws/compute/function-destinations/index.d.ts +3 -0
- package/lib/aws/compute/function-destinations/index.js +22 -0
- package/lib/aws/compute/function-destinations/sqs.d.ts +14 -0
- package/lib/aws/compute/function-destinations/sqs.js +27 -0
- package/lib/aws/compute/function-nodejs.d.ts +55 -0
- package/lib/aws/compute/function-nodejs.js +70 -0
- package/lib/aws/compute/function-permission.d.ts +83 -0
- package/lib/aws/compute/function-permission.js +3 -0
- package/lib/aws/compute/function-url.d.ts +210 -0
- package/lib/aws/compute/function-url.js +148 -0
- package/lib/aws/compute/function-vpc-config.generated.d.ts +36 -0
- package/lib/aws/compute/function-vpc-config.generated.js +3 -0
- package/lib/aws/compute/function.d.ts +492 -0
- package/lib/aws/compute/function.js +692 -0
- package/lib/aws/compute/index.d.ts +42 -0
- package/lib/aws/compute/index.js +64 -0
- package/lib/aws/compute/private/intrinstics.d.ts +86 -0
- package/lib/aws/compute/private/intrinstics.js +220 -0
- package/lib/aws/compute/private/json-path.d.ts +57 -0
- package/lib/aws/compute/private/json-path.js +351 -0
- package/lib/aws/compute/private/util.d.ts +1 -0
- package/lib/aws/compute/private/util.js +38 -0
- package/lib/aws/compute/state-graph.d.ts +100 -0
- package/lib/aws/compute/state-graph.js +177 -0
- package/lib/aws/compute/state-machine-fragment.d.ts +61 -0
- package/lib/aws/compute/state-machine-fragment.js +56 -0
- package/lib/aws/compute/state-machine.d.ts +323 -0
- package/lib/aws/compute/state-machine.js +392 -0
- package/lib/aws/compute/states/choice.d.ts +94 -0
- package/lib/aws/compute/states/choice.js +81 -0
- package/lib/aws/compute/states/custom-state.d.ts +55 -0
- package/lib/aws/compute/states/custom-state.js +114 -0
- package/lib/aws/compute/states/distributed-map/item-batcher.d.ts +64 -0
- package/lib/aws/compute/states/distributed-map/item-batcher.js +58 -0
- package/lib/aws/compute/states/distributed-map/item-reader.d.ts +256 -0
- package/lib/aws/compute/states/distributed-map/item-reader.js +253 -0
- package/lib/aws/compute/states/distributed-map/result-writer.d.ts +41 -0
- package/lib/aws/compute/states/distributed-map/result-writer.js +66 -0
- package/lib/aws/compute/states/distributed-map.d.ts +153 -0
- package/lib/aws/compute/states/distributed-map.js +207 -0
- package/lib/aws/compute/states/fail.d.ts +74 -0
- package/lib/aws/compute/states/fail.js +83 -0
- package/lib/aws/compute/states/map-base.d.ts +145 -0
- package/lib/aws/compute/states/map-base.js +109 -0
- package/lib/aws/compute/states/map.d.ts +76 -0
- package/lib/aws/compute/states/map.js +110 -0
- package/lib/aws/compute/states/parallel.d.ts +113 -0
- package/lib/aws/compute/states/parallel.js +100 -0
- package/lib/aws/compute/states/pass.d.ts +122 -0
- package/lib/aws/compute/states/pass.js +99 -0
- package/lib/aws/compute/states/private/state-type.d.ts +13 -0
- package/lib/aws/compute/states/private/state-type.js +19 -0
- package/lib/aws/compute/states/state.d.ts +276 -0
- package/lib/aws/compute/states/state.js +482 -0
- package/lib/aws/compute/states/succeed.d.ts +51 -0
- package/lib/aws/compute/states/succeed.js +32 -0
- package/lib/aws/compute/states/task-base.d.ts +225 -0
- package/lib/aws/compute/states/task-base.js +160 -0
- package/lib/aws/compute/states/task.d.ts +127 -0
- package/lib/aws/compute/states/task.js +92 -0
- package/lib/aws/compute/states/wait.d.ts +78 -0
- package/lib/aws/compute/states/wait.js +90 -0
- package/lib/aws/compute/step-functions-task.d.ts +78 -0
- package/lib/aws/compute/step-functions-task.js +27 -0
- package/lib/aws/compute/task-credentials.d.ts +45 -0
- package/lib/aws/compute/task-credentials.js +52 -0
- package/lib/aws/compute/task-input.d.ts +86 -0
- package/lib/aws/compute/task-input.js +107 -0
- package/lib/aws/compute/tasks/aws-sdk/call-aws-service.d.ts +73 -0
- package/lib/aws/compute/tasks/aws-sdk/call-aws-service.js +69 -0
- package/lib/aws/compute/tasks/eventbridge/put-events.d.ts +74 -0
- package/lib/aws/compute/tasks/eventbridge/put-events.js +94 -0
- package/lib/aws/compute/tasks/http/invoke.d.ts +104 -0
- package/lib/aws/compute/tasks/http/invoke.js +117 -0
- package/lib/aws/compute/tasks/index.d.ts +7 -0
- package/lib/aws/compute/tasks/index.js +42 -0
- package/lib/aws/compute/tasks/lambda/invoke.d.ts +106 -0
- package/lib/aws/compute/tasks/lambda/invoke.js +125 -0
- package/lib/aws/compute/tasks/private/task-utils.d.ts +8 -0
- package/lib/aws/compute/tasks/private/task-utils.js +36 -0
- package/lib/aws/compute/tasks/resource-arn-suffix.d.ts +3 -0
- package/lib/aws/compute/tasks/resource-arn-suffix.js +25 -0
- package/lib/aws/compute/tasks/sqs/send-message.d.ts +62 -0
- package/lib/aws/compute/tasks/sqs/send-message.js +70 -0
- package/lib/aws/compute/tasks/stepfunctions/invoke-activity.d.ts +36 -0
- package/lib/aws/compute/tasks/stepfunctions/invoke-activity.js +45 -0
- package/lib/aws/compute/tasks/stepfunctions/start-execution.d.ts +63 -0
- package/lib/aws/compute/tasks/stepfunctions/start-execution.js +123 -0
- package/lib/aws/compute/types.d.ts +214 -0
- package/lib/aws/compute/types.js +103 -0
- package/lib/aws/compute/util.d.ts +12 -0
- package/lib/aws/compute/util.js +29 -0
- package/lib/aws/edge/certificate.d.ts +144 -0
- package/lib/aws/edge/certificate.js +191 -0
- package/lib/aws/edge/distribution.d.ts +505 -0
- package/lib/aws/edge/distribution.js +444 -0
- package/lib/aws/edge/dns-alias-record-targets.d.ts +29 -0
- package/lib/aws/edge/dns-alias-record-targets.js +46 -0
- package/lib/aws/edge/dns-record.d.ts +536 -0
- package/lib/aws/edge/dns-record.js +532 -0
- package/lib/aws/edge/dns-zone.d.ts +169 -0
- package/lib/aws/edge/dns-zone.js +149 -0
- package/lib/aws/edge/function.d.ts +185 -0
- package/lib/aws/edge/function.js +141 -0
- package/lib/aws/edge/index.d.ts +8 -0
- package/lib/aws/edge/index.js +25 -0
- package/lib/aws/edge/key-value-store.d.ts +162 -0
- package/lib/aws/edge/key-value-store.js +163 -0
- package/lib/aws/edge/origin.d.ts +160 -0
- package/lib/aws/edge/origin.js +245 -0
- package/lib/aws/encryption/alias.d.ts +137 -0
- package/lib/aws/encryption/alias.js +216 -0
- package/lib/aws/encryption/index.d.ts +4 -0
- package/lib/aws/encryption/index.js +21 -0
- package/lib/aws/encryption/key-lookup.d.ts +11 -0
- package/lib/aws/encryption/key-lookup.js +4 -0
- package/lib/aws/encryption/key.d.ts +461 -0
- package/lib/aws/encryption/key.js +586 -0
- package/lib/aws/encryption/private/perms.d.ts +5 -0
- package/lib/aws/encryption/private/perms.js +30 -0
- package/lib/aws/encryption/via-service-principal.d.ts +11 -0
- package/lib/aws/encryption/via-service-principal.js +39 -0
- package/lib/aws/iam/grant.d.ts +221 -0
- package/lib/aws/iam/grant.js +239 -0
- package/lib/aws/iam/identity-base.d.ts +20 -0
- package/lib/aws/iam/identity-base.js +3 -0
- package/lib/aws/iam/index.d.ts +16 -0
- package/lib/aws/iam/index.js +34 -0
- package/lib/aws/iam/managed-policy.d.ts +227 -0
- package/lib/aws/iam/managed-policy.js +237 -0
- package/lib/aws/iam/oidc-provider.d.ts +120 -0
- package/lib/aws/iam/oidc-provider.js +82 -0
- package/lib/aws/iam/policy-document-config.generated.d.ts +78 -0
- package/lib/aws/iam/policy-document-config.generated.js +3 -0
- package/lib/aws/iam/policy-document.d.ts +150 -0
- package/lib/aws/iam/policy-document.js +172 -0
- package/lib/aws/iam/policy-statement-props.generated.d.ts +55 -0
- package/lib/aws/iam/policy-statement-props.generated.js +3 -0
- package/lib/aws/iam/policy-statement.d.ts +451 -0
- package/lib/aws/iam/policy-statement.js +947 -0
- package/lib/aws/iam/policy.d.ts +122 -0
- package/lib/aws/iam/policy.js +192 -0
- package/lib/aws/iam/principals.d.ts +668 -0
- package/lib/aws/iam/principals.js +1032 -0
- package/lib/aws/iam/private/adapter.d.ts +21 -0
- package/lib/aws/iam/private/adapter.js +51 -0
- package/lib/aws/iam/private/assume-role-policy.d.ts +8 -0
- package/lib/aws/iam/private/assume-role-policy.js +27 -0
- package/lib/aws/iam/private/comparable-principal.d.ts +6 -0
- package/lib/aws/iam/private/comparable-principal.js +20 -0
- package/lib/aws/iam/private/immutable-role.d.ts +43 -0
- package/lib/aws/iam/private/immutable-role.js +76 -0
- package/lib/aws/iam/private/imported-role.d.ts +49 -0
- package/lib/aws/iam/private/imported-role.js +103 -0
- package/lib/aws/iam/private/merge-statements.d.ts +44 -0
- package/lib/aws/iam/private/merge-statements.js +214 -0
- package/lib/aws/iam/private/postprocess-policy-document.d.ts +15 -0
- package/lib/aws/iam/private/postprocess-policy-document.js +102 -0
- package/lib/aws/iam/private/util.d.ts +37 -0
- package/lib/aws/iam/private/util.js +87 -0
- package/lib/aws/iam/role.d.ts +425 -0
- package/lib/aws/iam/role.js +407 -0
- package/lib/aws/iam/saml-provider.d.ts +79 -0
- package/lib/aws/iam/saml-provider.js +79 -0
- package/lib/aws/iam/unknown-principal.d.ts +32 -0
- package/lib/aws/iam/unknown-principal.js +45 -0
- package/lib/aws/iam/utils.d.ts +12 -0
- package/lib/aws/iam/utils.js +41 -0
- package/lib/aws/index.d.ts +13 -0
- package/lib/aws/index.js +34 -0
- package/lib/aws/log-retention.d.ts +97 -0
- package/lib/aws/log-retention.js +103 -0
- package/lib/aws/network/index.d.ts +4 -0
- package/lib/aws/network/index.js +21 -0
- package/lib/aws/network/network.d.ts +77 -0
- package/lib/aws/network/network.js +3 -0
- package/lib/aws/network/simple-ipv4-vpc.d.ts +84 -0
- package/lib/aws/network/simple-ipv4-vpc.js +236 -0
- package/lib/aws/network/subnet-group.d.ts +42 -0
- package/lib/aws/network/subnet-group.js +72 -0
- package/lib/aws/network/subnet.d.ts +95 -0
- package/lib/aws/network/subnet.js +123 -0
- package/lib/aws/notify/archive.d.ts +77 -0
- package/lib/aws/notify/archive.js +62 -0
- package/lib/aws/notify/connection.d.ts +276 -0
- package/lib/aws/notify/connection.js +261 -0
- package/lib/aws/notify/event-bus.d.ts +298 -0
- package/lib/aws/notify/event-bus.js +326 -0
- package/lib/aws/notify/event-pattern.d.ts +220 -0
- package/lib/aws/notify/event-pattern.js +197 -0
- package/lib/aws/notify/index.d.ts +15 -0
- package/lib/aws/notify/index.js +35 -0
- package/lib/aws/notify/input.d.ts +126 -0
- package/lib/aws/notify/input.js +282 -0
- package/lib/aws/notify/kinesis-canned-metrics.generated.d.ts +68 -0
- package/lib/aws/notify/kinesis-canned-metrics.generated.js +103 -0
- package/lib/aws/notify/kinesis-fixed-canned-metrics.d.ts +195 -0
- package/lib/aws/notify/kinesis-fixed-canned-metrics.js +155 -0
- package/lib/aws/notify/kinesis-stream.d.ts +705 -0
- package/lib/aws/notify/kinesis-stream.js +541 -0
- package/lib/aws/notify/on-event-options.d.ts +54 -0
- package/lib/aws/notify/on-event-options.js +3 -0
- package/lib/aws/notify/queue-config.generated.d.ts +85 -0
- package/lib/aws/notify/queue-config.generated.js +3 -0
- package/lib/aws/notify/queue-policy.d.ts +35 -0
- package/lib/aws/notify/queue-policy.js +39 -0
- package/lib/aws/notify/queue.d.ts +355 -0
- package/lib/aws/notify/queue.js +305 -0
- package/lib/aws/notify/resource-policy.d.ts +41 -0
- package/lib/aws/notify/resource-policy.js +43 -0
- package/lib/aws/notify/rule.d.ts +153 -0
- package/lib/aws/notify/rule.js +227 -0
- package/lib/aws/notify/schedule.d.ts +83 -0
- package/lib/aws/notify/schedule.js +116 -0
- package/lib/aws/notify/target.d.ts +102 -0
- package/lib/aws/notify/target.js +3 -0
- package/lib/aws/notify/targets/event-bus.d.ts +39 -0
- package/lib/aws/notify/targets/event-bus.js +40 -0
- package/lib/aws/notify/targets/function.d.ts +31 -0
- package/lib/aws/notify/targets/function.js +36 -0
- package/lib/aws/notify/targets/index.d.ts +6 -0
- package/lib/aws/notify/targets/index.js +37 -0
- package/lib/aws/notify/targets/log-group.d.ts +89 -0
- package/lib/aws/notify/targets/log-group.js +110 -0
- package/lib/aws/notify/targets/sqs.d.ts +45 -0
- package/lib/aws/notify/targets/sqs.js +73 -0
- package/lib/aws/notify/targets/state-machine.d.ts +36 -0
- package/lib/aws/notify/targets/state-machine.js +39 -0
- package/lib/aws/notify/targets/util.d.ts +71 -0
- package/lib/aws/notify/targets/util.js +130 -0
- package/lib/aws/notify/util.d.ts +13 -0
- package/lib/aws/notify/util.js +69 -0
- package/lib/aws/provider-config.generated.d.ts +220 -0
- package/lib/aws/provider-config.generated.js +3 -0
- package/lib/aws/storage/bucket-destination.d.ts +41 -0
- package/lib/aws/storage/bucket-destination.js +13 -0
- package/lib/aws/storage/bucket-notifications.d.ts +58 -0
- package/lib/aws/storage/bucket-notifications.js +169 -0
- package/lib/aws/storage/bucket-perms.d.ts +9 -0
- package/lib/aws/storage/bucket-perms.js +33 -0
- package/lib/aws/storage/bucket-policy.d.ts +51 -0
- package/lib/aws/storage/bucket-policy.js +53 -0
- package/lib/aws/storage/bucket-source.d.ts +41 -0
- package/lib/aws/storage/bucket-source.js +79 -0
- package/lib/aws/storage/bucket.d.ts +941 -0
- package/lib/aws/storage/bucket.js +869 -0
- package/lib/aws/storage/cors-config.generated.d.ts +57 -0
- package/lib/aws/storage/cors-config.generated.js +3 -0
- package/lib/aws/storage/cors-rule-config.generated.d.ts +38 -0
- package/lib/aws/storage/cors-rule-config.generated.js +3 -0
- package/lib/aws/storage/index.d.ts +12 -0
- package/lib/aws/storage/index.js +31 -0
- package/lib/aws/storage/lifecycle-config.generated.d.ts +55 -0
- package/lib/aws/storage/lifecycle-config.generated.js +3 -0
- package/lib/aws/storage/notification-targets/function.d.ts +11 -0
- package/lib/aws/storage/notification-targets/function.js +48 -0
- package/lib/aws/storage/notification-targets/index.d.ts +2 -0
- package/lib/aws/storage/notification-targets/index.js +21 -0
- package/lib/aws/storage/notification-targets/queue.d.ts +15 -0
- package/lib/aws/storage/notification-targets/queue.js +58 -0
- package/lib/aws/storage/origin-access-identity.d.ts +91 -0
- package/lib/aws/storage/origin-access-identity.js +76 -0
- package/lib/aws/storage/util.d.ts +40 -0
- package/lib/aws/storage/util.js +85 -0
- package/lib/aws/storage/website-config.generated.d.ts +73 -0
- package/lib/aws/storage/website-config.generated.js +3 -0
- package/lib/aws/util.d.ts +4 -0
- package/lib/aws/util.js +25 -0
- package/lib/construct-base.d.ts +69 -0
- package/lib/construct-base.js +89 -0
- package/lib/duration.d.ts +160 -0
- package/lib/duration.js +327 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.js +24 -0
- package/lib/private/index.d.ts +2 -0
- package/lib/private/index.js +19 -0
- package/lib/private/terraform-dependables-aspect.d.ts +20 -0
- package/lib/private/terraform-dependables-aspect.js +95 -0
- package/lib/private/unique-resource-name.d.ts +9 -0
- package/lib/private/unique-resource-name.js +145 -0
- package/lib/size.d.ts +146 -0
- package/lib/size.js +220 -0
- package/lib/stack-base.d.ts +188 -0
- package/lib/stack-base.js +183 -0
- package/lib/token.d.ts +32 -0
- package/lib/token.js +54 -0
- package/node_modules/camel-case/LICENSE +21 -0
- package/node_modules/camel-case/README.md +47 -0
- package/node_modules/camel-case/dist/index.d.ts +5 -0
- package/node_modules/camel-case/dist/index.js +23 -0
- package/node_modules/camel-case/dist/index.js.map +1 -0
- package/node_modules/camel-case/dist/index.spec.d.ts +1 -0
- package/node_modules/camel-case/dist/index.spec.js +26 -0
- package/node_modules/camel-case/dist/index.spec.js.map +1 -0
- package/node_modules/camel-case/dist.es2015/index.d.ts +5 -0
- package/node_modules/camel-case/dist.es2015/index.js +17 -0
- package/node_modules/camel-case/dist.es2015/index.js.map +1 -0
- package/node_modules/camel-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/camel-case/dist.es2015/index.spec.js +24 -0
- package/node_modules/camel-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/camel-case/package.json +89 -0
- package/node_modules/capital-case/LICENSE +21 -0
- package/node_modules/capital-case/README.md +37 -0
- package/node_modules/capital-case/dist/index.d.ts +4 -0
- package/node_modules/capital-case/dist/index.js +16 -0
- package/node_modules/capital-case/dist/index.js.map +1 -0
- package/node_modules/capital-case/dist/index.spec.d.ts +1 -0
- package/node_modules/capital-case/dist/index.spec.js +24 -0
- package/node_modules/capital-case/dist/index.spec.js.map +1 -0
- package/node_modules/capital-case/dist.es2015/index.d.ts +4 -0
- package/node_modules/capital-case/dist.es2015/index.js +11 -0
- package/node_modules/capital-case/dist.es2015/index.js.map +1 -0
- package/node_modules/capital-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/capital-case/dist.es2015/index.spec.js +22 -0
- package/node_modules/capital-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/capital-case/package.json +90 -0
- package/node_modules/change-case/LICENSE +21 -0
- package/node_modules/change-case/README.md +44 -0
- package/node_modules/change-case/dist/index.d.ts +11 -0
- package/node_modules/change-case/dist/index.js +15 -0
- package/node_modules/change-case/dist/index.js.map +1 -0
- package/node_modules/change-case/dist/index.spec.d.ts +1 -0
- package/node_modules/change-case/dist/index.spec.js +9 -0
- package/node_modules/change-case/dist/index.spec.js.map +1 -0
- package/node_modules/change-case/dist.es2015/index.d.ts +11 -0
- package/node_modules/change-case/dist.es2015/index.js +12 -0
- package/node_modules/change-case/dist.es2015/index.js.map +1 -0
- package/node_modules/change-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/change-case/dist.es2015/index.spec.js +7 -0
- package/node_modules/change-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/change-case/package.json +101 -0
- package/node_modules/constant-case/LICENSE +21 -0
- package/node_modules/constant-case/README.md +37 -0
- package/node_modules/constant-case/dist/index.d.ts +3 -0
- package/node_modules/constant-case/dist/index.js +12 -0
- package/node_modules/constant-case/dist/index.js.map +1 -0
- package/node_modules/constant-case/dist/index.spec.d.ts +1 -0
- package/node_modules/constant-case/dist/index.spec.js +26 -0
- package/node_modules/constant-case/dist/index.spec.js.map +1 -0
- package/node_modules/constant-case/dist.es2015/index.d.ts +3 -0
- package/node_modules/constant-case/dist.es2015/index.js +8 -0
- package/node_modules/constant-case/dist.es2015/index.js.map +1 -0
- package/node_modules/constant-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/constant-case/dist.es2015/index.spec.js +24 -0
- package/node_modules/constant-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/constant-case/package.json +90 -0
- package/node_modules/dot-case/LICENSE +21 -0
- package/node_modules/dot-case/README.md +37 -0
- package/node_modules/dot-case/dist/index.d.ts +3 -0
- package/node_modules/dot-case/dist/index.js +11 -0
- package/node_modules/dot-case/dist/index.js.map +1 -0
- package/node_modules/dot-case/dist/index.spec.d.ts +1 -0
- package/node_modules/dot-case/dist/index.spec.js +26 -0
- package/node_modules/dot-case/dist/index.spec.js.map +1 -0
- package/node_modules/dot-case/dist.es2015/index.d.ts +3 -0
- package/node_modules/dot-case/dist.es2015/index.js +7 -0
- package/node_modules/dot-case/dist.es2015/index.js.map +1 -0
- package/node_modules/dot-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/dot-case/dist.es2015/index.spec.js +24 -0
- package/node_modules/dot-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/dot-case/package.json +89 -0
- package/node_modules/esbuild-wasm/LICENSE.md +21 -0
- package/node_modules/esbuild-wasm/README.md +3 -0
- package/node_modules/esbuild-wasm/bin/esbuild +91 -0
- package/node_modules/esbuild-wasm/esbuild.wasm +0 -0
- package/node_modules/esbuild-wasm/esm/browser.d.ts +705 -0
- package/node_modules/esbuild-wasm/esm/browser.js +2370 -0
- package/node_modules/esbuild-wasm/esm/browser.min.js +20 -0
- package/node_modules/esbuild-wasm/lib/browser.d.ts +705 -0
- package/node_modules/esbuild-wasm/lib/browser.js +2415 -0
- package/node_modules/esbuild-wasm/lib/browser.min.js +22 -0
- package/node_modules/esbuild-wasm/lib/main.d.ts +705 -0
- package/node_modules/esbuild-wasm/lib/main.js +2051 -0
- package/node_modules/esbuild-wasm/package.json +19 -0
- package/node_modules/esbuild-wasm/wasm_exec.js +561 -0
- package/node_modules/esbuild-wasm/wasm_exec_node.js +39 -0
- package/node_modules/header-case/LICENSE +21 -0
- package/node_modules/header-case/README.md +37 -0
- package/node_modules/header-case/dist/index.d.ts +3 -0
- package/node_modules/header-case/dist/index.js +11 -0
- package/node_modules/header-case/dist/index.js.map +1 -0
- package/node_modules/header-case/dist/index.spec.d.ts +1 -0
- package/node_modules/header-case/dist/index.spec.js +24 -0
- package/node_modules/header-case/dist/index.spec.js.map +1 -0
- package/node_modules/header-case/dist.es2015/index.d.ts +3 -0
- package/node_modules/header-case/dist.es2015/index.js +7 -0
- package/node_modules/header-case/dist.es2015/index.js.map +1 -0
- package/node_modules/header-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/header-case/dist.es2015/index.spec.js +22 -0
- package/node_modules/header-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/header-case/package.json +89 -0
- package/node_modules/lower-case/LICENSE +21 -0
- package/node_modules/lower-case/README.md +35 -0
- package/node_modules/lower-case/dist/index.d.ts +8 -0
- package/node_modules/lower-case/dist/index.js +53 -0
- package/node_modules/lower-case/dist/index.js.map +1 -0
- package/node_modules/lower-case/dist/index.spec.d.ts +1 -0
- package/node_modules/lower-case/dist/index.spec.js +36 -0
- package/node_modules/lower-case/dist/index.spec.js.map +1 -0
- package/node_modules/lower-case/dist.es2015/index.d.ts +8 -0
- package/node_modules/lower-case/dist.es2015/index.js +48 -0
- package/node_modules/lower-case/dist.es2015/index.js.map +1 -0
- package/node_modules/lower-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/lower-case/dist.es2015/index.spec.js +34 -0
- package/node_modules/lower-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/lower-case/package.json +87 -0
- package/node_modules/mime-db/HISTORY.md +507 -0
- package/node_modules/mime-db/LICENSE +23 -0
- package/node_modules/mime-db/README.md +100 -0
- package/node_modules/mime-db/db.json +8519 -0
- package/node_modules/mime-db/index.js +12 -0
- package/node_modules/mime-db/package.json +60 -0
- package/node_modules/mime-types/HISTORY.md +397 -0
- package/node_modules/mime-types/LICENSE +23 -0
- package/node_modules/mime-types/README.md +113 -0
- package/node_modules/mime-types/index.js +188 -0
- package/node_modules/mime-types/package.json +44 -0
- package/node_modules/no-case/LICENSE +21 -0
- package/node_modules/no-case/README.md +37 -0
- package/node_modules/no-case/dist/index.d.ts +10 -0
- package/node_modules/no-case/dist/index.js +35 -0
- package/node_modules/no-case/dist/index.js.map +1 -0
- package/node_modules/no-case/dist/index.spec.d.ts +1 -0
- package/node_modules/no-case/dist/index.spec.js +59 -0
- package/node_modules/no-case/dist/index.spec.js.map +1 -0
- package/node_modules/no-case/dist.es2015/index.d.ts +10 -0
- package/node_modules/no-case/dist.es2015/index.js +31 -0
- package/node_modules/no-case/dist.es2015/index.js.map +1 -0
- package/node_modules/no-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/no-case/dist.es2015/index.spec.js +57 -0
- package/node_modules/no-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/no-case/package.json +85 -0
- package/node_modules/param-case/LICENSE +21 -0
- package/node_modules/param-case/README.md +37 -0
- package/node_modules/param-case/dist/index.d.ts +3 -0
- package/node_modules/param-case/dist/index.js +11 -0
- package/node_modules/param-case/dist/index.js.map +1 -0
- package/node_modules/param-case/dist/index.spec.d.ts +1 -0
- package/node_modules/param-case/dist/index.spec.js +24 -0
- package/node_modules/param-case/dist/index.spec.js.map +1 -0
- package/node_modules/param-case/dist.es2015/index.d.ts +3 -0
- package/node_modules/param-case/dist.es2015/index.js +7 -0
- package/node_modules/param-case/dist.es2015/index.js.map +1 -0
- package/node_modules/param-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/param-case/dist.es2015/index.spec.js +22 -0
- package/node_modules/param-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/param-case/package.json +91 -0
- package/node_modules/pascal-case/LICENSE +21 -0
- package/node_modules/pascal-case/README.md +47 -0
- package/node_modules/pascal-case/dist/index.d.ts +5 -0
- package/node_modules/pascal-case/dist/index.js +24 -0
- package/node_modules/pascal-case/dist/index.js.map +1 -0
- package/node_modules/pascal-case/dist/index.spec.d.ts +1 -0
- package/node_modules/pascal-case/dist/index.spec.js +25 -0
- package/node_modules/pascal-case/dist/index.spec.js.map +1 -0
- package/node_modules/pascal-case/dist.es2015/index.d.ts +5 -0
- package/node_modules/pascal-case/dist.es2015/index.js +18 -0
- package/node_modules/pascal-case/dist.es2015/index.js.map +1 -0
- package/node_modules/pascal-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/pascal-case/dist.es2015/index.spec.js +23 -0
- package/node_modules/pascal-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/pascal-case/package.json +90 -0
- package/node_modules/path-case/LICENSE +21 -0
- package/node_modules/path-case/README.md +37 -0
- package/node_modules/path-case/dist/index.d.ts +3 -0
- package/node_modules/path-case/dist/index.js +11 -0
- package/node_modules/path-case/dist/index.js.map +1 -0
- package/node_modules/path-case/dist/index.spec.d.ts +1 -0
- package/node_modules/path-case/dist/index.spec.js +24 -0
- package/node_modules/path-case/dist/index.spec.js.map +1 -0
- package/node_modules/path-case/dist.es2015/index.d.ts +3 -0
- package/node_modules/path-case/dist.es2015/index.js +7 -0
- package/node_modules/path-case/dist.es2015/index.js.map +1 -0
- package/node_modules/path-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/path-case/dist.es2015/index.spec.js +22 -0
- package/node_modules/path-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/path-case/package.json +88 -0
- package/node_modules/sentence-case/LICENSE +21 -0
- package/node_modules/sentence-case/README.md +37 -0
- package/node_modules/sentence-case/dist/index.d.ts +4 -0
- package/node_modules/sentence-case/dist/index.js +19 -0
- package/node_modules/sentence-case/dist/index.js.map +1 -0
- package/node_modules/sentence-case/dist/index.spec.d.ts +1 -0
- package/node_modules/sentence-case/dist/index.spec.js +24 -0
- package/node_modules/sentence-case/dist/index.spec.js.map +1 -0
- package/node_modules/sentence-case/dist.es2015/index.d.ts +4 -0
- package/node_modules/sentence-case/dist.es2015/index.js +14 -0
- package/node_modules/sentence-case/dist.es2015/index.js.map +1 -0
- package/node_modules/sentence-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/sentence-case/dist.es2015/index.spec.js +22 -0
- package/node_modules/sentence-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/sentence-case/package.json +89 -0
- package/node_modules/snake-case/LICENSE +21 -0
- package/node_modules/snake-case/README.md +37 -0
- package/node_modules/snake-case/dist/index.d.ts +3 -0
- package/node_modules/snake-case/dist/index.js +11 -0
- package/node_modules/snake-case/dist/index.js.map +1 -0
- package/node_modules/snake-case/dist/index.spec.d.ts +1 -0
- package/node_modules/snake-case/dist/index.spec.js +25 -0
- package/node_modules/snake-case/dist/index.spec.js.map +1 -0
- package/node_modules/snake-case/dist.es2015/index.d.ts +3 -0
- package/node_modules/snake-case/dist.es2015/index.js +7 -0
- package/node_modules/snake-case/dist.es2015/index.js.map +1 -0
- package/node_modules/snake-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/snake-case/dist.es2015/index.spec.js +23 -0
- package/node_modules/snake-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/snake-case/package.json +90 -0
- package/node_modules/tslib/CopyrightNotice.txt +15 -0
- package/node_modules/tslib/LICENSE.txt +12 -0
- package/node_modules/tslib/README.md +164 -0
- package/node_modules/tslib/SECURITY.md +41 -0
- package/node_modules/tslib/modules/index.d.ts +37 -0
- package/node_modules/tslib/modules/index.js +68 -0
- package/node_modules/tslib/modules/package.json +3 -0
- package/node_modules/tslib/package.json +47 -0
- package/node_modules/tslib/tslib.d.ts +453 -0
- package/node_modules/tslib/tslib.es6.html +1 -0
- package/node_modules/tslib/tslib.es6.js +374 -0
- package/node_modules/tslib/tslib.es6.mjs +373 -0
- package/node_modules/tslib/tslib.html +1 -0
- package/node_modules/tslib/tslib.js +424 -0
- package/node_modules/upper-case/README.md +34 -0
- package/node_modules/upper-case/dist/index.d.ts +8 -0
- package/node_modules/upper-case/dist/index.js +49 -0
- package/node_modules/upper-case/dist/index.js.map +1 -0
- package/node_modules/upper-case/dist/index.spec.d.ts +1 -0
- package/node_modules/upper-case/dist/index.spec.js +34 -0
- package/node_modules/upper-case/dist/index.spec.js.map +1 -0
- package/node_modules/upper-case/dist.es2015/index.d.ts +8 -0
- package/node_modules/upper-case/dist.es2015/index.js +44 -0
- package/node_modules/upper-case/dist.es2015/index.js.map +1 -0
- package/node_modules/upper-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/upper-case/dist.es2015/index.spec.js +32 -0
- package/node_modules/upper-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/upper-case/package.json +86 -0
- package/node_modules/upper-case-first/LICENSE +21 -0
- package/node_modules/upper-case-first/README.md +32 -0
- package/node_modules/upper-case-first/dist/index.d.ts +4 -0
- package/node_modules/upper-case-first/dist/index.js +11 -0
- package/node_modules/upper-case-first/dist/index.js.map +1 -0
- package/node_modules/upper-case-first/dist/index.spec.d.ts +1 -0
- package/node_modules/upper-case-first/dist/index.spec.js +20 -0
- package/node_modules/upper-case-first/dist/index.spec.js.map +1 -0
- package/node_modules/upper-case-first/dist.es2015/index.d.ts +4 -0
- package/node_modules/upper-case-first/dist.es2015/index.js +7 -0
- package/node_modules/upper-case-first/dist.es2015/index.js.map +1 -0
- package/node_modules/upper-case-first/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/upper-case-first/dist.es2015/index.spec.js +18 -0
- package/node_modules/upper-case-first/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/upper-case-first/package.json +87 -0
- package/package.json +152 -0
- package/setup.js +2 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "esbuild-wasm",
|
|
3
|
+
"version": "0.23.1",
|
|
4
|
+
"description": "The cross-platform WebAssembly binary for esbuild, a JavaScript bundler.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/evanw/esbuild.git"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=18"
|
|
12
|
+
},
|
|
13
|
+
"main": "lib/main.js",
|
|
14
|
+
"browser": "lib/browser.js",
|
|
15
|
+
"types": "lib/main.d.ts",
|
|
16
|
+
"directories": {
|
|
17
|
+
"bin": "bin"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,561 @@
|
|
|
1
|
+
// Copyright 2018 The Go Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style
|
|
3
|
+
// license that can be found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
|
|
7
|
+
(() => {
|
|
8
|
+
const enosys = () => {
|
|
9
|
+
const err = new Error("not implemented");
|
|
10
|
+
err.code = "ENOSYS";
|
|
11
|
+
return err;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
if (!globalThis.fs) {
|
|
15
|
+
let outputBuf = "";
|
|
16
|
+
globalThis.fs = {
|
|
17
|
+
constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused
|
|
18
|
+
writeSync(fd, buf) {
|
|
19
|
+
outputBuf += decoder.decode(buf);
|
|
20
|
+
const nl = outputBuf.lastIndexOf("\n");
|
|
21
|
+
if (nl != -1) {
|
|
22
|
+
console.log(outputBuf.substring(0, nl));
|
|
23
|
+
outputBuf = outputBuf.substring(nl + 1);
|
|
24
|
+
}
|
|
25
|
+
return buf.length;
|
|
26
|
+
},
|
|
27
|
+
write(fd, buf, offset, length, position, callback) {
|
|
28
|
+
if (offset !== 0 || length !== buf.length || position !== null) {
|
|
29
|
+
callback(enosys());
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const n = this.writeSync(fd, buf);
|
|
33
|
+
callback(null, n);
|
|
34
|
+
},
|
|
35
|
+
chmod(path, mode, callback) { callback(enosys()); },
|
|
36
|
+
chown(path, uid, gid, callback) { callback(enosys()); },
|
|
37
|
+
close(fd, callback) { callback(enosys()); },
|
|
38
|
+
fchmod(fd, mode, callback) { callback(enosys()); },
|
|
39
|
+
fchown(fd, uid, gid, callback) { callback(enosys()); },
|
|
40
|
+
fstat(fd, callback) { callback(enosys()); },
|
|
41
|
+
fsync(fd, callback) { callback(null); },
|
|
42
|
+
ftruncate(fd, length, callback) { callback(enosys()); },
|
|
43
|
+
lchown(path, uid, gid, callback) { callback(enosys()); },
|
|
44
|
+
link(path, link, callback) { callback(enosys()); },
|
|
45
|
+
lstat(path, callback) { callback(enosys()); },
|
|
46
|
+
mkdir(path, perm, callback) { callback(enosys()); },
|
|
47
|
+
open(path, flags, mode, callback) { callback(enosys()); },
|
|
48
|
+
read(fd, buffer, offset, length, position, callback) { callback(enosys()); },
|
|
49
|
+
readdir(path, callback) { callback(enosys()); },
|
|
50
|
+
readlink(path, callback) { callback(enosys()); },
|
|
51
|
+
rename(from, to, callback) { callback(enosys()); },
|
|
52
|
+
rmdir(path, callback) { callback(enosys()); },
|
|
53
|
+
stat(path, callback) { callback(enosys()); },
|
|
54
|
+
symlink(path, link, callback) { callback(enosys()); },
|
|
55
|
+
truncate(path, length, callback) { callback(enosys()); },
|
|
56
|
+
unlink(path, callback) { callback(enosys()); },
|
|
57
|
+
utimes(path, atime, mtime, callback) { callback(enosys()); },
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (!globalThis.process) {
|
|
62
|
+
globalThis.process = {
|
|
63
|
+
getuid() { return -1; },
|
|
64
|
+
getgid() { return -1; },
|
|
65
|
+
geteuid() { return -1; },
|
|
66
|
+
getegid() { return -1; },
|
|
67
|
+
getgroups() { throw enosys(); },
|
|
68
|
+
pid: -1,
|
|
69
|
+
ppid: -1,
|
|
70
|
+
umask() { throw enosys(); },
|
|
71
|
+
cwd() { throw enosys(); },
|
|
72
|
+
chdir() { throw enosys(); },
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (!globalThis.crypto) {
|
|
77
|
+
throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (!globalThis.performance) {
|
|
81
|
+
throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (!globalThis.TextEncoder) {
|
|
85
|
+
throw new Error("globalThis.TextEncoder is not available, polyfill required");
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (!globalThis.TextDecoder) {
|
|
89
|
+
throw new Error("globalThis.TextDecoder is not available, polyfill required");
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const encoder = new TextEncoder("utf-8");
|
|
93
|
+
const decoder = new TextDecoder("utf-8");
|
|
94
|
+
|
|
95
|
+
globalThis.Go = class {
|
|
96
|
+
constructor() {
|
|
97
|
+
this.argv = ["js"];
|
|
98
|
+
this.env = {};
|
|
99
|
+
this.exit = (code) => {
|
|
100
|
+
if (code !== 0) {
|
|
101
|
+
console.warn("exit code:", code);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
this._exitPromise = new Promise((resolve) => {
|
|
105
|
+
this._resolveExitPromise = resolve;
|
|
106
|
+
});
|
|
107
|
+
this._pendingEvent = null;
|
|
108
|
+
this._scheduledTimeouts = new Map();
|
|
109
|
+
this._nextCallbackTimeoutID = 1;
|
|
110
|
+
|
|
111
|
+
const setInt64 = (addr, v) => {
|
|
112
|
+
this.mem.setUint32(addr + 0, v, true);
|
|
113
|
+
this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const setInt32 = (addr, v) => {
|
|
117
|
+
this.mem.setUint32(addr + 0, v, true);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const getInt64 = (addr) => {
|
|
121
|
+
const low = this.mem.getUint32(addr + 0, true);
|
|
122
|
+
const high = this.mem.getInt32(addr + 4, true);
|
|
123
|
+
return low + high * 4294967296;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const loadValue = (addr) => {
|
|
127
|
+
const f = this.mem.getFloat64(addr, true);
|
|
128
|
+
if (f === 0) {
|
|
129
|
+
return undefined;
|
|
130
|
+
}
|
|
131
|
+
if (!isNaN(f)) {
|
|
132
|
+
return f;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const id = this.mem.getUint32(addr, true);
|
|
136
|
+
return this._values[id];
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const storeValue = (addr, v) => {
|
|
140
|
+
const nanHead = 0x7FF80000;
|
|
141
|
+
|
|
142
|
+
if (typeof v === "number" && v !== 0) {
|
|
143
|
+
if (isNaN(v)) {
|
|
144
|
+
this.mem.setUint32(addr + 4, nanHead, true);
|
|
145
|
+
this.mem.setUint32(addr, 0, true);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
this.mem.setFloat64(addr, v, true);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (v === undefined) {
|
|
153
|
+
this.mem.setFloat64(addr, 0, true);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
let id = this._ids.get(v);
|
|
158
|
+
if (id === undefined) {
|
|
159
|
+
id = this._idPool.pop();
|
|
160
|
+
if (id === undefined) {
|
|
161
|
+
id = this._values.length;
|
|
162
|
+
}
|
|
163
|
+
this._values[id] = v;
|
|
164
|
+
this._goRefCounts[id] = 0;
|
|
165
|
+
this._ids.set(v, id);
|
|
166
|
+
}
|
|
167
|
+
this._goRefCounts[id]++;
|
|
168
|
+
let typeFlag = 0;
|
|
169
|
+
switch (typeof v) {
|
|
170
|
+
case "object":
|
|
171
|
+
if (v !== null) {
|
|
172
|
+
typeFlag = 1;
|
|
173
|
+
}
|
|
174
|
+
break;
|
|
175
|
+
case "string":
|
|
176
|
+
typeFlag = 2;
|
|
177
|
+
break;
|
|
178
|
+
case "symbol":
|
|
179
|
+
typeFlag = 3;
|
|
180
|
+
break;
|
|
181
|
+
case "function":
|
|
182
|
+
typeFlag = 4;
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
this.mem.setUint32(addr + 4, nanHead | typeFlag, true);
|
|
186
|
+
this.mem.setUint32(addr, id, true);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const loadSlice = (addr) => {
|
|
190
|
+
const array = getInt64(addr + 0);
|
|
191
|
+
const len = getInt64(addr + 8);
|
|
192
|
+
return new Uint8Array(this._inst.exports.mem.buffer, array, len);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const loadSliceOfValues = (addr) => {
|
|
196
|
+
const array = getInt64(addr + 0);
|
|
197
|
+
const len = getInt64(addr + 8);
|
|
198
|
+
const a = new Array(len);
|
|
199
|
+
for (let i = 0; i < len; i++) {
|
|
200
|
+
a[i] = loadValue(array + i * 8);
|
|
201
|
+
}
|
|
202
|
+
return a;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const loadString = (addr) => {
|
|
206
|
+
const saddr = getInt64(addr + 0);
|
|
207
|
+
const len = getInt64(addr + 8);
|
|
208
|
+
return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const timeOrigin = Date.now() - performance.now();
|
|
212
|
+
this.importObject = {
|
|
213
|
+
_gotest: {
|
|
214
|
+
add: (a, b) => a + b,
|
|
215
|
+
},
|
|
216
|
+
gojs: {
|
|
217
|
+
// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)
|
|
218
|
+
// may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported
|
|
219
|
+
// function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).
|
|
220
|
+
// This changes the SP, thus we have to update the SP used by the imported function.
|
|
221
|
+
|
|
222
|
+
// func wasmExit(code int32)
|
|
223
|
+
"runtime.wasmExit": (sp) => {
|
|
224
|
+
sp >>>= 0;
|
|
225
|
+
const code = this.mem.getInt32(sp + 8, true);
|
|
226
|
+
this.exited = true;
|
|
227
|
+
delete this._inst;
|
|
228
|
+
delete this._values;
|
|
229
|
+
delete this._goRefCounts;
|
|
230
|
+
delete this._ids;
|
|
231
|
+
delete this._idPool;
|
|
232
|
+
this.exit(code);
|
|
233
|
+
},
|
|
234
|
+
|
|
235
|
+
// func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)
|
|
236
|
+
"runtime.wasmWrite": (sp) => {
|
|
237
|
+
sp >>>= 0;
|
|
238
|
+
const fd = getInt64(sp + 8);
|
|
239
|
+
const p = getInt64(sp + 16);
|
|
240
|
+
const n = this.mem.getInt32(sp + 24, true);
|
|
241
|
+
fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));
|
|
242
|
+
},
|
|
243
|
+
|
|
244
|
+
// func resetMemoryDataView()
|
|
245
|
+
"runtime.resetMemoryDataView": (sp) => {
|
|
246
|
+
sp >>>= 0;
|
|
247
|
+
this.mem = new DataView(this._inst.exports.mem.buffer);
|
|
248
|
+
},
|
|
249
|
+
|
|
250
|
+
// func nanotime1() int64
|
|
251
|
+
"runtime.nanotime1": (sp) => {
|
|
252
|
+
sp >>>= 0;
|
|
253
|
+
setInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);
|
|
254
|
+
},
|
|
255
|
+
|
|
256
|
+
// func walltime() (sec int64, nsec int32)
|
|
257
|
+
"runtime.walltime": (sp) => {
|
|
258
|
+
sp >>>= 0;
|
|
259
|
+
const msec = (new Date).getTime();
|
|
260
|
+
setInt64(sp + 8, msec / 1000);
|
|
261
|
+
this.mem.setInt32(sp + 16, (msec % 1000) * 1000000, true);
|
|
262
|
+
},
|
|
263
|
+
|
|
264
|
+
// func scheduleTimeoutEvent(delay int64) int32
|
|
265
|
+
"runtime.scheduleTimeoutEvent": (sp) => {
|
|
266
|
+
sp >>>= 0;
|
|
267
|
+
const id = this._nextCallbackTimeoutID;
|
|
268
|
+
this._nextCallbackTimeoutID++;
|
|
269
|
+
this._scheduledTimeouts.set(id, setTimeout(
|
|
270
|
+
() => {
|
|
271
|
+
this._resume();
|
|
272
|
+
while (this._scheduledTimeouts.has(id)) {
|
|
273
|
+
// for some reason Go failed to register the timeout event, log and try again
|
|
274
|
+
// (temporary workaround for https://github.com/golang/go/issues/28975)
|
|
275
|
+
console.warn("scheduleTimeoutEvent: missed timeout event");
|
|
276
|
+
this._resume();
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
getInt64(sp + 8),
|
|
280
|
+
));
|
|
281
|
+
this.mem.setInt32(sp + 16, id, true);
|
|
282
|
+
},
|
|
283
|
+
|
|
284
|
+
// func clearTimeoutEvent(id int32)
|
|
285
|
+
"runtime.clearTimeoutEvent": (sp) => {
|
|
286
|
+
sp >>>= 0;
|
|
287
|
+
const id = this.mem.getInt32(sp + 8, true);
|
|
288
|
+
clearTimeout(this._scheduledTimeouts.get(id));
|
|
289
|
+
this._scheduledTimeouts.delete(id);
|
|
290
|
+
},
|
|
291
|
+
|
|
292
|
+
// func getRandomData(r []byte)
|
|
293
|
+
"runtime.getRandomData": (sp) => {
|
|
294
|
+
sp >>>= 0;
|
|
295
|
+
crypto.getRandomValues(loadSlice(sp + 8));
|
|
296
|
+
},
|
|
297
|
+
|
|
298
|
+
// func finalizeRef(v ref)
|
|
299
|
+
"syscall/js.finalizeRef": (sp) => {
|
|
300
|
+
sp >>>= 0;
|
|
301
|
+
const id = this.mem.getUint32(sp + 8, true);
|
|
302
|
+
this._goRefCounts[id]--;
|
|
303
|
+
if (this._goRefCounts[id] === 0) {
|
|
304
|
+
const v = this._values[id];
|
|
305
|
+
this._values[id] = null;
|
|
306
|
+
this._ids.delete(v);
|
|
307
|
+
this._idPool.push(id);
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
|
|
311
|
+
// func stringVal(value string) ref
|
|
312
|
+
"syscall/js.stringVal": (sp) => {
|
|
313
|
+
sp >>>= 0;
|
|
314
|
+
storeValue(sp + 24, loadString(sp + 8));
|
|
315
|
+
},
|
|
316
|
+
|
|
317
|
+
// func valueGet(v ref, p string) ref
|
|
318
|
+
"syscall/js.valueGet": (sp) => {
|
|
319
|
+
sp >>>= 0;
|
|
320
|
+
const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));
|
|
321
|
+
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
|
322
|
+
storeValue(sp + 32, result);
|
|
323
|
+
},
|
|
324
|
+
|
|
325
|
+
// func valueSet(v ref, p string, x ref)
|
|
326
|
+
"syscall/js.valueSet": (sp) => {
|
|
327
|
+
sp >>>= 0;
|
|
328
|
+
Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));
|
|
329
|
+
},
|
|
330
|
+
|
|
331
|
+
// func valueDelete(v ref, p string)
|
|
332
|
+
"syscall/js.valueDelete": (sp) => {
|
|
333
|
+
sp >>>= 0;
|
|
334
|
+
Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));
|
|
335
|
+
},
|
|
336
|
+
|
|
337
|
+
// func valueIndex(v ref, i int) ref
|
|
338
|
+
"syscall/js.valueIndex": (sp) => {
|
|
339
|
+
sp >>>= 0;
|
|
340
|
+
storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));
|
|
341
|
+
},
|
|
342
|
+
|
|
343
|
+
// valueSetIndex(v ref, i int, x ref)
|
|
344
|
+
"syscall/js.valueSetIndex": (sp) => {
|
|
345
|
+
sp >>>= 0;
|
|
346
|
+
Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));
|
|
347
|
+
},
|
|
348
|
+
|
|
349
|
+
// func valueCall(v ref, m string, args []ref) (ref, bool)
|
|
350
|
+
"syscall/js.valueCall": (sp) => {
|
|
351
|
+
sp >>>= 0;
|
|
352
|
+
try {
|
|
353
|
+
const v = loadValue(sp + 8);
|
|
354
|
+
const m = Reflect.get(v, loadString(sp + 16));
|
|
355
|
+
const args = loadSliceOfValues(sp + 32);
|
|
356
|
+
const result = Reflect.apply(m, v, args);
|
|
357
|
+
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
|
358
|
+
storeValue(sp + 56, result);
|
|
359
|
+
this.mem.setUint8(sp + 64, 1);
|
|
360
|
+
} catch (err) {
|
|
361
|
+
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
|
362
|
+
storeValue(sp + 56, err);
|
|
363
|
+
this.mem.setUint8(sp + 64, 0);
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
|
|
367
|
+
// func valueInvoke(v ref, args []ref) (ref, bool)
|
|
368
|
+
"syscall/js.valueInvoke": (sp) => {
|
|
369
|
+
sp >>>= 0;
|
|
370
|
+
try {
|
|
371
|
+
const v = loadValue(sp + 8);
|
|
372
|
+
const args = loadSliceOfValues(sp + 16);
|
|
373
|
+
const result = Reflect.apply(v, undefined, args);
|
|
374
|
+
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
|
375
|
+
storeValue(sp + 40, result);
|
|
376
|
+
this.mem.setUint8(sp + 48, 1);
|
|
377
|
+
} catch (err) {
|
|
378
|
+
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
|
379
|
+
storeValue(sp + 40, err);
|
|
380
|
+
this.mem.setUint8(sp + 48, 0);
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
|
|
384
|
+
// func valueNew(v ref, args []ref) (ref, bool)
|
|
385
|
+
"syscall/js.valueNew": (sp) => {
|
|
386
|
+
sp >>>= 0;
|
|
387
|
+
try {
|
|
388
|
+
const v = loadValue(sp + 8);
|
|
389
|
+
const args = loadSliceOfValues(sp + 16);
|
|
390
|
+
const result = Reflect.construct(v, args);
|
|
391
|
+
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
|
392
|
+
storeValue(sp + 40, result);
|
|
393
|
+
this.mem.setUint8(sp + 48, 1);
|
|
394
|
+
} catch (err) {
|
|
395
|
+
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
|
396
|
+
storeValue(sp + 40, err);
|
|
397
|
+
this.mem.setUint8(sp + 48, 0);
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
|
|
401
|
+
// func valueLength(v ref) int
|
|
402
|
+
"syscall/js.valueLength": (sp) => {
|
|
403
|
+
sp >>>= 0;
|
|
404
|
+
setInt64(sp + 16, parseInt(loadValue(sp + 8).length));
|
|
405
|
+
},
|
|
406
|
+
|
|
407
|
+
// valuePrepareString(v ref) (ref, int)
|
|
408
|
+
"syscall/js.valuePrepareString": (sp) => {
|
|
409
|
+
sp >>>= 0;
|
|
410
|
+
const str = encoder.encode(String(loadValue(sp + 8)));
|
|
411
|
+
storeValue(sp + 16, str);
|
|
412
|
+
setInt64(sp + 24, str.length);
|
|
413
|
+
},
|
|
414
|
+
|
|
415
|
+
// valueLoadString(v ref, b []byte)
|
|
416
|
+
"syscall/js.valueLoadString": (sp) => {
|
|
417
|
+
sp >>>= 0;
|
|
418
|
+
const str = loadValue(sp + 8);
|
|
419
|
+
loadSlice(sp + 16).set(str);
|
|
420
|
+
},
|
|
421
|
+
|
|
422
|
+
// func valueInstanceOf(v ref, t ref) bool
|
|
423
|
+
"syscall/js.valueInstanceOf": (sp) => {
|
|
424
|
+
sp >>>= 0;
|
|
425
|
+
this.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0);
|
|
426
|
+
},
|
|
427
|
+
|
|
428
|
+
// func copyBytesToGo(dst []byte, src ref) (int, bool)
|
|
429
|
+
"syscall/js.copyBytesToGo": (sp) => {
|
|
430
|
+
sp >>>= 0;
|
|
431
|
+
const dst = loadSlice(sp + 8);
|
|
432
|
+
const src = loadValue(sp + 32);
|
|
433
|
+
if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {
|
|
434
|
+
this.mem.setUint8(sp + 48, 0);
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
const toCopy = src.subarray(0, dst.length);
|
|
438
|
+
dst.set(toCopy);
|
|
439
|
+
setInt64(sp + 40, toCopy.length);
|
|
440
|
+
this.mem.setUint8(sp + 48, 1);
|
|
441
|
+
},
|
|
442
|
+
|
|
443
|
+
// func copyBytesToJS(dst ref, src []byte) (int, bool)
|
|
444
|
+
"syscall/js.copyBytesToJS": (sp) => {
|
|
445
|
+
sp >>>= 0;
|
|
446
|
+
const dst = loadValue(sp + 8);
|
|
447
|
+
const src = loadSlice(sp + 16);
|
|
448
|
+
if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {
|
|
449
|
+
this.mem.setUint8(sp + 48, 0);
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
const toCopy = src.subarray(0, dst.length);
|
|
453
|
+
dst.set(toCopy);
|
|
454
|
+
setInt64(sp + 40, toCopy.length);
|
|
455
|
+
this.mem.setUint8(sp + 48, 1);
|
|
456
|
+
},
|
|
457
|
+
|
|
458
|
+
"debug": (value) => {
|
|
459
|
+
console.log(value);
|
|
460
|
+
},
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
async run(instance) {
|
|
466
|
+
if (!(instance instanceof WebAssembly.Instance)) {
|
|
467
|
+
throw new Error("Go.run: WebAssembly.Instance expected");
|
|
468
|
+
}
|
|
469
|
+
this._inst = instance;
|
|
470
|
+
this.mem = new DataView(this._inst.exports.mem.buffer);
|
|
471
|
+
this._values = [ // JS values that Go currently has references to, indexed by reference id
|
|
472
|
+
NaN,
|
|
473
|
+
0,
|
|
474
|
+
null,
|
|
475
|
+
true,
|
|
476
|
+
false,
|
|
477
|
+
globalThis,
|
|
478
|
+
this,
|
|
479
|
+
];
|
|
480
|
+
this._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id
|
|
481
|
+
this._ids = new Map([ // mapping from JS values to reference ids
|
|
482
|
+
[0, 1],
|
|
483
|
+
[null, 2],
|
|
484
|
+
[true, 3],
|
|
485
|
+
[false, 4],
|
|
486
|
+
[globalThis, 5],
|
|
487
|
+
[this, 6],
|
|
488
|
+
]);
|
|
489
|
+
this._idPool = []; // unused ids that have been garbage collected
|
|
490
|
+
this.exited = false; // whether the Go program has exited
|
|
491
|
+
|
|
492
|
+
// Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory.
|
|
493
|
+
let offset = 4096;
|
|
494
|
+
|
|
495
|
+
const strPtr = (str) => {
|
|
496
|
+
const ptr = offset;
|
|
497
|
+
const bytes = encoder.encode(str + "\0");
|
|
498
|
+
new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);
|
|
499
|
+
offset += bytes.length;
|
|
500
|
+
if (offset % 8 !== 0) {
|
|
501
|
+
offset += 8 - (offset % 8);
|
|
502
|
+
}
|
|
503
|
+
return ptr;
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
const argc = this.argv.length;
|
|
507
|
+
|
|
508
|
+
const argvPtrs = [];
|
|
509
|
+
this.argv.forEach((arg) => {
|
|
510
|
+
argvPtrs.push(strPtr(arg));
|
|
511
|
+
});
|
|
512
|
+
argvPtrs.push(0);
|
|
513
|
+
|
|
514
|
+
const keys = Object.keys(this.env).sort();
|
|
515
|
+
keys.forEach((key) => {
|
|
516
|
+
argvPtrs.push(strPtr(`${key}=${this.env[key]}`));
|
|
517
|
+
});
|
|
518
|
+
argvPtrs.push(0);
|
|
519
|
+
|
|
520
|
+
const argv = offset;
|
|
521
|
+
argvPtrs.forEach((ptr) => {
|
|
522
|
+
this.mem.setUint32(offset, ptr, true);
|
|
523
|
+
this.mem.setUint32(offset + 4, 0, true);
|
|
524
|
+
offset += 8;
|
|
525
|
+
});
|
|
526
|
+
|
|
527
|
+
// The linker guarantees global data starts from at least wasmMinDataAddr.
|
|
528
|
+
// Keep in sync with cmd/link/internal/ld/data.go:wasmMinDataAddr.
|
|
529
|
+
const wasmMinDataAddr = 4096 + 8192;
|
|
530
|
+
if (offset >= wasmMinDataAddr) {
|
|
531
|
+
throw new Error("total length of command line and environment variables exceeds limit");
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
this._inst.exports.run(argc, argv);
|
|
535
|
+
if (this.exited) {
|
|
536
|
+
this._resolveExitPromise();
|
|
537
|
+
}
|
|
538
|
+
await this._exitPromise;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
_resume() {
|
|
542
|
+
if (this.exited) {
|
|
543
|
+
throw new Error("Go program has already exited");
|
|
544
|
+
}
|
|
545
|
+
this._inst.exports.resume();
|
|
546
|
+
if (this.exited) {
|
|
547
|
+
this._resolveExitPromise();
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
_makeFuncWrapper(id) {
|
|
552
|
+
const go = this;
|
|
553
|
+
return function () {
|
|
554
|
+
const event = { id: id, this: this, args: arguments };
|
|
555
|
+
go._pendingEvent = event;
|
|
556
|
+
go._resume();
|
|
557
|
+
return event.result;
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
})();
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Copyright 2021 The Go Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style
|
|
3
|
+
// license that can be found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
|
|
7
|
+
if (process.argv.length < 3) {
|
|
8
|
+
console.error("usage: go_js_wasm_exec [wasm binary] [arguments]");
|
|
9
|
+
process.exit(1);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
globalThis.require = require;
|
|
13
|
+
globalThis.fs = require("fs");
|
|
14
|
+
globalThis.TextEncoder = require("util").TextEncoder;
|
|
15
|
+
globalThis.TextDecoder = require("util").TextDecoder;
|
|
16
|
+
|
|
17
|
+
globalThis.performance ??= require("performance");
|
|
18
|
+
|
|
19
|
+
globalThis.crypto ??= require("crypto");
|
|
20
|
+
|
|
21
|
+
require("./wasm_exec");
|
|
22
|
+
|
|
23
|
+
const go = new Go();
|
|
24
|
+
go.argv = process.argv.slice(2);
|
|
25
|
+
go.env = Object.assign({ TMPDIR: require("os").tmpdir() }, process.env);
|
|
26
|
+
go.exit = process.exit;
|
|
27
|
+
WebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => {
|
|
28
|
+
process.on("exit", (code) => { // Node.js exits if no event handler is pending
|
|
29
|
+
if (code === 0 && !go.exited) {
|
|
30
|
+
// deadlock, make Go print error and stack traces
|
|
31
|
+
go._pendingEvent = { id: 0 };
|
|
32
|
+
go._resume();
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return go.run(result.instance);
|
|
36
|
+
}).catch((err) => {
|
|
37
|
+
console.error(err);
|
|
38
|
+
process.exit(1);
|
|
39
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Header Case
|
|
2
|
+
|
|
3
|
+
[![NPM version][npm-image]][npm-url]
|
|
4
|
+
[![NPM downloads][downloads-image]][downloads-url]
|
|
5
|
+
[![Bundle size][bundlephobia-image]][bundlephobia-url]
|
|
6
|
+
|
|
7
|
+
> Transform into a dash separated string of capitalized words.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
npm install header-case --save
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
import { headerCase } from "header-case";
|
|
19
|
+
|
|
20
|
+
headerCase("string"); //=> "String"
|
|
21
|
+
headerCase("dot.case"); //=> "Dot-Case"
|
|
22
|
+
headerCase("PascalCase"); //=> "Pascal-Case"
|
|
23
|
+
headerCase("version 1.2.10"); //=> "Version-1-2-10"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The function also accepts [`options`](https://github.com/blakeembrey/change-case#options).
|
|
27
|
+
|
|
28
|
+
## License
|
|
29
|
+
|
|
30
|
+
MIT
|
|
31
|
+
|
|
32
|
+
[npm-image]: https://img.shields.io/npm/v/header-case.svg?style=flat
|
|
33
|
+
[npm-url]: https://npmjs.org/package/header-case
|
|
34
|
+
[downloads-image]: https://img.shields.io/npm/dm/header-case.svg?style=flat
|
|
35
|
+
[downloads-url]: https://npmjs.org/package/header-case
|
|
36
|
+
[bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/header-case.svg
|
|
37
|
+
[bundlephobia-url]: https://bundlephobia.com/result?p=header-case
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.headerCase = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var capital_case_1 = require("capital-case");
|
|
6
|
+
function headerCase(input, options) {
|
|
7
|
+
if (options === void 0) { options = {}; }
|
|
8
|
+
return capital_case_1.capitalCase(input, tslib_1.__assign({ delimiter: "-" }, options));
|
|
9
|
+
}
|
|
10
|
+
exports.headerCase = headerCase;
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,6CAAoD;AAIpD,SAAgB,UAAU,CAAC,KAAa,EAAE,OAAqB;IAArB,wBAAA,EAAA,YAAqB;IAC7D,OAAO,0BAAW,CAAC,KAAK,qBACtB,SAAS,EAAE,GAAG,IACX,OAAO,EACV,CAAC;AACL,CAAC;AALD,gCAKC","sourcesContent":["import { capitalCase, Options } from \"capital-case\";\n\nexport { Options };\n\nexport function headerCase(input: string, options: Options = {}) {\n return capitalCase(input, {\n delimiter: \"-\",\n ...options,\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|