@aws-amplify/graphql-api-construct 1.18.3-ai-next.0 → 1.18.3
Sign up to get free protection for your applications and to get access to all the features.
- package/.jsii +456 -59
- package/API.md +17 -0
- package/CHANGELOG.md +1 -1
- package/jest.config.js +12 -0
- package/lib/amplify-dynamodb-table-wrapper.js +1 -1
- package/lib/amplify-graphql-api.js +4 -3
- package/lib/amplify-graphql-definition.js +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +5 -2
- package/lib/log-config-types.d.ts +78 -0
- package/lib/log-config-types.js +8 -0
- package/lib/sql-model-datasource-strategy.js +1 -1
- package/lib/types.d.ts +5 -0
- package/lib/types.js +1 -1
- package/node_modules/@aws-amplify/graphql-auth-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/jest.config.js +12 -0
- package/node_modules/@aws-amplify/graphql-auth-transformer/package.json +15 -54
- package/node_modules/@aws-amplify/graphql-conversation-transformer/CHANGELOG.md +2 -2
- package/node_modules/@aws-amplify/graphql-conversation-transformer/jest.config.js +10 -0
- package/node_modules/@aws-amplify/graphql-conversation-transformer/package.json +12 -48
- package/node_modules/@aws-amplify/graphql-default-value-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-default-value-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-default-value-transformer/jest.config.js +12 -0
- package/node_modules/@aws-amplify/graphql-default-value-transformer/package.json +9 -49
- package/node_modules/@aws-amplify/graphql-directives/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-directives/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-directives/jest.config.js +6 -0
- package/node_modules/@aws-amplify/graphql-directives/package.json +2 -42
- package/node_modules/@aws-amplify/graphql-function-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-function-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-function-transformer/jest.config.js +12 -0
- package/node_modules/@aws-amplify/graphql-function-transformer/package.json +9 -48
- package/node_modules/@aws-amplify/graphql-generation-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/jest.config.js +9 -0
- package/node_modules/@aws-amplify/graphql-generation-transformer/package.json +9 -44
- package/node_modules/@aws-amplify/graphql-http-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-http-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-http-transformer/jest.config.js +12 -0
- package/node_modules/@aws-amplify/graphql-http-transformer/package.json +9 -48
- package/node_modules/@aws-amplify/graphql-index-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-index-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-index-transformer/jest.config.js +12 -0
- package/node_modules/@aws-amplify/graphql-index-transformer/package.json +10 -46
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/jest.config.js +12 -0
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/assets/mapping-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-maps-to-transformer/package.json +13 -49
- package/node_modules/@aws-amplify/graphql-model-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/jest.config.js +12 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-notification-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-patching-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-model-transformer/package.json +9 -49
- package/node_modules/@aws-amplify/graphql-predictions-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-predictions-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-predictions-transformer/jest.config.js +5 -0
- package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/predictionsLambdaFunction.zip +0 -0
- package/node_modules/@aws-amplify/graphql-predictions-transformer/package.json +9 -48
- package/node_modules/@aws-amplify/graphql-relational-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-relational-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-relational-transformer/jest.config.js +12 -0
- package/node_modules/@aws-amplify/graphql-relational-transformer/package.json +11 -47
- package/node_modules/@aws-amplify/graphql-searchable-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-searchable-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-searchable-transformer/jest.config.js +12 -0
- package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/streaming-lambda.zip +0 -0
- package/node_modules/@aws-amplify/graphql-searchable-transformer/package.json +10 -52
- package/node_modules/@aws-amplify/graphql-sql-transformer/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-sql-transformer/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-sql-transformer/jest.config.js +12 -0
- package/node_modules/@aws-amplify/graphql-sql-transformer/package.json +10 -49
- package/node_modules/@aws-amplify/graphql-transformer/API.md +2 -0
- package/node_modules/@aws-amplify/graphql-transformer/CHANGELOG.md +1 -1
- package/node_modules/@aws-amplify/graphql-transformer/jest.config.js +12 -0
- package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.d.ts +2 -1
- package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.js +2 -1
- package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer/package.json +20 -61
- package/node_modules/@aws-amplify/graphql-transformer/src/graphql-transformer.ts +4 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/API.md +3 -3
- package/node_modules/@aws-amplify/graphql-transformer-core/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/jest.config.js +12 -0
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/graphql-api.d.ts +4 -3
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/graphql-api.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/graphql-api.js +27 -7
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/graphql-api.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.d.ts +4 -3
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.js +5 -3
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.d.ts +3 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.js +2 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.js.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-core/package.json +8 -46
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/API.md +12 -0
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/CHANGELOG.md +4 -0
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/LICENSE +201 -0
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.d.ts +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.d.ts.map +1 -1
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/logConfig.d.ts +8 -0
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/logConfig.d.ts.map +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/logConfig.js +3 -0
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/logConfig.js.map +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/package.json +3 -35
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/index.ts +1 -0
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/logConfig.ts +8 -0
- package/node_modules/@aws-amplify/graphql-transformer-interfaces/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@aws-cdk/assert/BUILD.md +15 -0
- package/node_modules/@aws-cdk/assert/LICENSE +201 -0
- package/node_modules/@aws-cdk/assert/NOTICE +2 -0
- package/node_modules/@aws-cdk/assert/README.md +228 -0
- package/node_modules/@aws-cdk/assert/clone.sh +29 -0
- package/node_modules/@aws-cdk/assert/jest.d.ts +14 -0
- package/node_modules/@aws-cdk/assert/jest.js +57 -0
- package/node_modules/@aws-cdk/assert/lib/assertion.d.ts +17 -0
- package/node_modules/@aws-cdk/assert/lib/assertion.js +31 -0
- package/node_modules/@aws-cdk/assert/lib/assertions/and-assertion.d.ts +10 -0
- package/node_modules/@aws-cdk/assert/lib/assertions/and-assertion.js +21 -0
- package/node_modules/@aws-cdk/assert/lib/assertions/count-resources.d.ts +10 -0
- package/node_modules/@aws-cdk/assert/lib/assertions/count-resources.js +54 -0
- package/node_modules/@aws-cdk/assert/lib/assertions/exist.d.ts +3 -0
- package/node_modules/@aws-cdk/assert/lib/assertions/exist.js +18 -0
- package/node_modules/@aws-cdk/assert/lib/assertions/have-output.d.ts +29 -0
- package/node_modules/@aws-cdk/assert/lib/assertions/have-output.js +77 -0
- package/node_modules/@aws-cdk/assert/lib/assertions/have-resource-matchers.d.ts +123 -0
- package/node_modules/@aws-cdk/assert/lib/assertions/have-resource-matchers.js +404 -0
- package/node_modules/@aws-cdk/assert/lib/assertions/have-resource.d.ts +69 -0
- package/node_modules/@aws-cdk/assert/lib/assertions/have-resource.js +130 -0
- package/node_modules/@aws-cdk/assert/lib/assertions/have-type.d.ts +3 -0
- package/node_modules/@aws-cdk/assert/lib/assertions/have-type.js +22 -0
- package/node_modules/@aws-cdk/assert/lib/assertions/match-template.d.ts +19 -0
- package/node_modules/@aws-cdk/assert/lib/assertions/match-template.js +98 -0
- package/node_modules/@aws-cdk/assert/lib/assertions/negated-assertion.d.ts +8 -0
- package/node_modules/@aws-cdk/assert/lib/assertions/negated-assertion.js +18 -0
- package/node_modules/@aws-cdk/assert/lib/canonicalize-assets.d.ts +11 -0
- package/node_modules/@aws-cdk/assert/lib/canonicalize-assets.js +70 -0
- package/node_modules/@aws-cdk/assert/lib/expect.d.ts +4 -0
- package/node_modules/@aws-cdk/assert/lib/expect.js +16 -0
- package/node_modules/@aws-cdk/assert/lib/index.d.ts +14 -0
- package/node_modules/@aws-cdk/assert/lib/index.js +27 -0
- package/node_modules/@aws-cdk/assert/lib/inspector.d.ts +31 -0
- package/node_modules/@aws-cdk/assert/lib/inspector.js +69 -0
- package/node_modules/@aws-cdk/assert/lib/synth-utils.d.ts +30 -0
- package/node_modules/@aws-cdk/assert/lib/synth-utils.js +92 -0
- package/node_modules/@aws-cdk/assert/package.json +77 -0
- package/node_modules/@aws-cdk/cfnspec/CHANGELOG.md +16795 -0
- package/node_modules/@aws-cdk/cfnspec/LICENSE +201 -0
- package/node_modules/@aws-cdk/cfnspec/NOTICE +2 -0
- package/node_modules/@aws-cdk/cfnspec/README.md +14 -0
- package/node_modules/@aws-cdk/cfnspec/build-tools/build.d.ts +1 -0
- package/node_modules/@aws-cdk/cfnspec/build-tools/build.js +37 -0
- package/node_modules/@aws-cdk/cfnspec/build-tools/create-missing-libraries.d.ts +6 -0
- package/node_modules/@aws-cdk/cfnspec/build-tools/create-missing-libraries.js +311 -0
- package/node_modules/@aws-cdk/cfnspec/build-tools/massage-spec.d.ts +10 -0
- package/node_modules/@aws-cdk/cfnspec/build-tools/massage-spec.js +70 -0
- package/node_modules/@aws-cdk/cfnspec/build-tools/patch-set.d.ts +25 -0
- package/node_modules/@aws-cdk/cfnspec/build-tools/patch-set.js +241 -0
- package/node_modules/@aws-cdk/cfnspec/build-tools/report-issues.d.ts +9 -0
- package/node_modules/@aws-cdk/cfnspec/build-tools/report-issues.js +72 -0
- package/node_modules/@aws-cdk/cfnspec/build-tools/scrutiny.d.ts +12 -0
- package/node_modules/@aws-cdk/cfnspec/build-tools/scrutiny.js +85 -0
- package/node_modules/@aws-cdk/cfnspec/build-tools/spec-diff.d.ts +1 -0
- package/node_modules/@aws-cdk/cfnspec/build-tools/spec-diff.js +248 -0
- package/node_modules/@aws-cdk/cfnspec/build-tools/split-spec-by-service.d.ts +1 -0
- package/node_modules/@aws-cdk/cfnspec/build-tools/split-spec-by-service.js +120 -0
- package/node_modules/@aws-cdk/cfnspec/build-tools/template/LICENSE +201 -0
- package/node_modules/@aws-cdk/cfnspec/build-tools/template/NOTICE +2 -0
- package/node_modules/@aws-cdk/cfnspec/build-tools/update-cfnlint.sh +18 -0
- package/node_modules/@aws-cdk/cfnspec/build-tools/update-metrics.sh +15 -0
- package/node_modules/@aws-cdk/cfnspec/build-tools/update.sh +113 -0
- package/node_modules/@aws-cdk/cfnspec/build-tools/validate-cfn.d.ts +67 -0
- package/node_modules/@aws-cdk/cfnspec/build-tools/validate-cfn.js +285 -0
- package/node_modules/@aws-cdk/cfnspec/cfn.version +1 -0
- package/node_modules/@aws-cdk/cfnspec/lib/_private_schema/cfn-lint.d.ts +24 -0
- package/node_modules/@aws-cdk/cfnspec/lib/_private_schema/cfn-lint.js +3 -0
- package/node_modules/@aws-cdk/cfnspec/lib/augmentations/AWS_EC2_VPNConnection.json +27 -0
- package/node_modules/@aws-cdk/cfnspec/lib/augmentations/AWS_Lambda_Function.json +27 -0
- package/node_modules/@aws-cdk/cfnspec/lib/augmentations/AWS_RDS_DBCluster.json +70 -0
- package/node_modules/@aws-cdk/cfnspec/lib/augmentations/AWS_RDS_DBInstance.json +37 -0
- package/node_modules/@aws-cdk/cfnspec/lib/augmentations/AWS_SNS_Topic.json +52 -0
- package/node_modules/@aws-cdk/cfnspec/lib/augmentations/AWS_SQS_Queue.json +53 -0
- package/node_modules/@aws-cdk/cfnspec/lib/canned-metrics/README.md +168 -0
- package/node_modules/@aws-cdk/cfnspec/lib/canned-metrics/canned-metrics-schema.d.ts +60 -0
- package/node_modules/@aws-cdk/cfnspec/lib/canned-metrics/canned-metrics-schema.js +12 -0
- package/node_modules/@aws-cdk/cfnspec/lib/canned-metrics/services.json +31957 -0
- package/node_modules/@aws-cdk/cfnspec/lib/canned-metrics.d.ts +41 -0
- package/node_modules/@aws-cdk/cfnspec/lib/canned-metrics.js +75 -0
- package/node_modules/@aws-cdk/cfnspec/lib/index.d.ts +63 -0
- package/node_modules/@aws-cdk/cfnspec/lib/index.js +200 -0
- package/node_modules/@aws-cdk/cfnspec/lib/schema/augmentation.d.ts +87 -0
- package/node_modules/@aws-cdk/cfnspec/lib/schema/augmentation.js +28 -0
- package/node_modules/@aws-cdk/cfnspec/lib/schema/base-types.d.ts +14 -0
- package/node_modules/@aws-cdk/cfnspec/lib/schema/base-types.js +29 -0
- package/node_modules/@aws-cdk/cfnspec/lib/schema/cfn-lint.d.ts +13 -0
- package/node_modules/@aws-cdk/cfnspec/lib/schema/cfn-lint.js +3 -0
- package/node_modules/@aws-cdk/cfnspec/lib/schema/docs.d.ts +20 -0
- package/node_modules/@aws-cdk/cfnspec/lib/schema/docs.js +3 -0
- package/node_modules/@aws-cdk/cfnspec/lib/schema/index.d.ts +7 -0
- package/node_modules/@aws-cdk/cfnspec/lib/schema/index.js +20 -0
- package/node_modules/@aws-cdk/cfnspec/lib/schema/property.d.ts +179 -0
- package/node_modules/@aws-cdk/cfnspec/lib/schema/property.js +168 -0
- package/node_modules/@aws-cdk/cfnspec/lib/schema/resource-type.d.ts +118 -0
- package/node_modules/@aws-cdk/cfnspec/lib/schema/resource-type.js +99 -0
- package/node_modules/@aws-cdk/cfnspec/lib/schema/specification.d.ts +56 -0
- package/node_modules/@aws-cdk/cfnspec/lib/schema/specification.js +11 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/CHANGELOG.md +902 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/LICENSE +15 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/README.md +264 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/copy/copy.js +232 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/copy/index.js +6 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/copy-sync/copy-sync.js +166 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/copy-sync/index.js +5 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/empty/index.js +48 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/ensure/file.js +69 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/ensure/index.js +23 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/ensure/link.js +61 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/ensure/symlink-paths.js +99 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/ensure/symlink-type.js +31 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/ensure/symlink.js +63 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/fs/index.js +130 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/index.js +27 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/json/index.js +16 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/json/jsonfile.js +11 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/json/output-json-sync.js +12 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/json/output-json.js +12 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/mkdirs/index.js +14 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/mkdirs/make-dir.js +141 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/move/index.js +6 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/move/move.js +65 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/move-sync/index.js +5 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/move-sync/move-sync.js +47 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/output/index.js +40 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/path-exists/index.js +12 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/remove/index.js +9 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/remove/rimraf.js +302 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/util/stat.js +139 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/lib/util/utimes.js +26 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/fs-extra/package.json +70 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/jsonfile/CHANGELOG.md +171 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/jsonfile/LICENSE +15 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/jsonfile/README.md +230 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/jsonfile/index.js +88 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/jsonfile/package.json +40 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/jsonfile/utils.js +14 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/universalify/LICENSE +20 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/universalify/README.md +76 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/universalify/index.js +24 -0
- package/node_modules/@aws-cdk/cfnspec/node_modules/universalify/package.json +34 -0
- package/node_modules/@aws-cdk/cfnspec/package.json +63 -0
- package/node_modules/@aws-cdk/cfnspec/spec/cfn-docs.json +51044 -0
- package/node_modules/@aws-cdk/cfnspec/spec/cfn-lint.json +35 -0
- package/node_modules/@aws-cdk/cfnspec/spec/specification.json +148332 -0
- package/node_modules/@aws-cdk/cloudformation-diff/LICENSE +201 -0
- package/node_modules/@aws-cdk/cloudformation-diff/NOTICE +2 -0
- package/node_modules/@aws-cdk/cloudformation-diff/README.md +12 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/diff/index.d.ts +9 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/diff/index.js +94 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/diff/types.d.ts +326 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/diff/types.js +457 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/diff/util.d.ts +41 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/diff/util.js +165 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/diff-template.d.ts +21 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/diff-template.js +166 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/diffable.d.ts +22 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/diffable.js +47 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/format-table.d.ts +6 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/format-table.js +109 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/format.d.ts +23 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/format.js +414 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/iam/iam-changes.d.ts +62 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/iam/iam-changes.js +246 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/iam/managed-policy.d.ts +18 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/iam/managed-policy.js +29 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/iam/statement.d.ts +127 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/iam/statement.js +268 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/index.d.ts +4 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/index.js +18 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/network/security-group-changes.d.ts +32 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/network/security-group-changes.js +95 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/network/security-group-rule.d.ts +50 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/network/security-group-rule.js +91 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/render-intrinsics.d.ts +21 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/render-intrinsics.js +79 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/util.d.ts +7 -0
- package/node_modules/@aws-cdk/cloudformation-diff/lib/util.js +63 -0
- package/node_modules/@aws-cdk/cloudformation-diff/package.json +60 -0
- package/node_modules/ajv/.runkit_example.js +23 -0
- package/node_modules/ajv/LICENSE +22 -0
- package/node_modules/ajv/README.md +207 -0
- package/node_modules/ajv/dist/2019.d.ts +19 -0
- package/node_modules/ajv/dist/2019.js +61 -0
- package/node_modules/ajv/dist/2019.js.map +1 -0
- package/node_modules/ajv/dist/2020.d.ts +19 -0
- package/node_modules/ajv/dist/2020.js +55 -0
- package/node_modules/ajv/dist/2020.js.map +1 -0
- package/node_modules/ajv/dist/ajv.d.ts +18 -0
- package/node_modules/ajv/dist/ajv.js +50 -0
- package/node_modules/ajv/dist/ajv.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/code.d.ts +40 -0
- package/node_modules/ajv/dist/compile/codegen/code.js +156 -0
- package/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/index.d.ts +79 -0
- package/node_modules/ajv/dist/compile/codegen/index.js +697 -0
- package/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/scope.d.ts +79 -0
- package/node_modules/ajv/dist/compile/codegen/scope.js +143 -0
- package/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
- package/node_modules/ajv/dist/compile/errors.d.ts +13 -0
- package/node_modules/ajv/dist/compile/errors.js +123 -0
- package/node_modules/ajv/dist/compile/errors.js.map +1 -0
- package/node_modules/ajv/dist/compile/index.d.ts +80 -0
- package/node_modules/ajv/dist/compile/index.js +242 -0
- package/node_modules/ajv/dist/compile/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/parse.d.ts +4 -0
- package/node_modules/ajv/dist/compile/jtd/parse.js +350 -0
- package/node_modules/ajv/dist/compile/jtd/parse.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.d.ts +4 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.js +229 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/types.d.ts +6 -0
- package/node_modules/ajv/dist/compile/jtd/types.js +14 -0
- package/node_modules/ajv/dist/compile/jtd/types.js.map +1 -0
- package/node_modules/ajv/dist/compile/names.d.ts +20 -0
- package/node_modules/ajv/dist/compile/names.js +28 -0
- package/node_modules/ajv/dist/compile/names.js.map +1 -0
- package/node_modules/ajv/dist/compile/ref_error.d.ts +6 -0
- package/node_modules/ajv/dist/compile/ref_error.js +12 -0
- package/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
- package/node_modules/ajv/dist/compile/resolve.d.ts +12 -0
- package/node_modules/ajv/dist/compile/resolve.js +155 -0
- package/node_modules/ajv/dist/compile/resolve.js.map +1 -0
- package/node_modules/ajv/dist/compile/rules.d.ts +28 -0
- package/node_modules/ajv/dist/compile/rules.js +26 -0
- package/node_modules/ajv/dist/compile/rules.js.map +1 -0
- package/node_modules/ajv/dist/compile/util.d.ts +40 -0
- package/node_modules/ajv/dist/compile/util.js +178 -0
- package/node_modules/ajv/dist/compile/util.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/applicability.d.ts +6 -0
- package/node_modules/ajv/dist/compile/validate/applicability.js +19 -0
- package/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.d.ts +4 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.js +50 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/dataType.d.ts +17 -0
- package/node_modules/ajv/dist/compile/validate/dataType.js +203 -0
- package/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/defaults.d.ts +2 -0
- package/node_modules/ajv/dist/compile/validate/defaults.js +35 -0
- package/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/index.d.ts +42 -0
- package/node_modules/ajv/dist/compile/validate/index.js +520 -0
- package/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/keyword.d.ts +8 -0
- package/node_modules/ajv/dist/compile/validate/keyword.js +124 -0
- package/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/subschema.d.ts +47 -0
- package/node_modules/ajv/dist/compile/validate/subschema.js +81 -0
- package/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
- package/node_modules/ajv/dist/core.d.ts +173 -0
- package/node_modules/ajv/dist/core.js +618 -0
- package/node_modules/ajv/dist/core.js.map +1 -0
- package/node_modules/ajv/dist/jtd.d.ts +47 -0
- package/node_modules/ajv/dist/jtd.js +72 -0
- package/node_modules/ajv/dist/jtd.js.map +1 -0
- package/node_modules/ajv/dist/refs/data.json +13 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts +2 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.js +28 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map +1 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json +53 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json +17 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json +57 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json +14 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json +90 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json +39 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts +2 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +30 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map +1 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json +17 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json +51 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json +55 -0
- package/node_modules/ajv/dist/refs/json-schema-draft-06.json +137 -0
- package/node_modules/ajv/dist/refs/json-schema-draft-07.json +151 -0
- package/node_modules/ajv/dist/refs/json-schema-secure.json +88 -0
- package/node_modules/ajv/dist/refs/jtd-schema.d.ts +3 -0
- package/node_modules/ajv/dist/refs/jtd-schema.js +118 -0
- package/node_modules/ajv/dist/refs/jtd-schema.js.map +1 -0
- package/node_modules/ajv/dist/runtime/equal.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/equal.js +7 -0
- package/node_modules/ajv/dist/runtime/equal.js.map +1 -0
- package/node_modules/ajv/dist/runtime/parseJson.d.ts +18 -0
- package/node_modules/ajv/dist/runtime/parseJson.js +185 -0
- package/node_modules/ajv/dist/runtime/parseJson.js.map +1 -0
- package/node_modules/ajv/dist/runtime/quote.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/quote.js +30 -0
- package/node_modules/ajv/dist/runtime/quote.js.map +1 -0
- package/node_modules/ajv/dist/runtime/re2.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/re2.js +6 -0
- package/node_modules/ajv/dist/runtime/re2.js.map +1 -0
- package/node_modules/ajv/dist/runtime/timestamp.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/timestamp.js +42 -0
- package/node_modules/ajv/dist/runtime/timestamp.js.map +1 -0
- package/node_modules/ajv/dist/runtime/ucs2length.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/ucs2length.js +24 -0
- package/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
- package/node_modules/ajv/dist/runtime/uri.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/uri.js +6 -0
- package/node_modules/ajv/dist/runtime/uri.js.map +1 -0
- package/node_modules/ajv/dist/runtime/validation_error.d.ts +7 -0
- package/node_modules/ajv/dist/runtime/validation_error.js +11 -0
- package/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
- package/node_modules/ajv/dist/standalone/index.d.ts +6 -0
- package/node_modules/ajv/dist/standalone/index.js +90 -0
- package/node_modules/ajv/dist/standalone/index.js.map +1 -0
- package/node_modules/ajv/dist/standalone/instance.d.ts +12 -0
- package/node_modules/ajv/dist/standalone/instance.js +35 -0
- package/node_modules/ajv/dist/standalone/instance.js.map +1 -0
- package/node_modules/ajv/dist/types/index.d.ts +183 -0
- package/node_modules/ajv/dist/types/index.js +3 -0
- package/node_modules/ajv/dist/types/index.js.map +1 -0
- package/node_modules/ajv/dist/types/json-schema.d.ts +125 -0
- package/node_modules/ajv/dist/types/json-schema.js +3 -0
- package/node_modules/ajv/dist/types/json-schema.js.map +1 -0
- package/node_modules/ajv/dist/types/jtd-schema.d.ts +174 -0
- package/node_modules/ajv/dist/types/jtd-schema.js +3 -0
- package/node_modules/ajv/dist/types/jtd-schema.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +49 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +106 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.js +23 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +12 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts +7 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.js +95 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts +21 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +85 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +11 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.js +66 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.d.ts +13 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.js +44 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.js +52 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.js +30 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.js +26 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +60 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +75 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +12 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.js +54 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +38 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +13 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/code.d.ts +17 -0
- package/node_modules/ajv/dist/vocabularies/code.js +131 -0
- package/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/id.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/core/id.js +10 -0
- package/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/core/index.js +16 -0
- package/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.js +122 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.js +104 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.js +9 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.js +23 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/draft7.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/draft7.js +17 -0
- package/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +30 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +51 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.js +9 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +16 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +10 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/errors.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/errors.js +3 -0
- package/node_modules/ajv/dist/vocabularies/errors.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/format/format.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/format/format.js +92 -0
- package/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/format/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/format/index.js +6 -0
- package/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.js +71 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.js +24 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.js +43 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.js +20 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.js +29 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.js +25 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.js +22 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js +15 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts +22 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.js +149 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.js +67 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.js +69 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.js +12 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.js +51 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/metadata.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/metadata.js +18 -0
- package/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/next.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/next.js +8 -0
- package/node_modules/ajv/dist/vocabularies/next.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.js +7 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +40 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +65 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.js +25 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +12 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.js +48 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.d.ts +16 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.js +33 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.js +15 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.js +24 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.js +27 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts +11 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +27 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +24 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +26 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.js +24 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.js +79 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +64 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
- package/node_modules/ajv/lib/2019.ts +81 -0
- package/node_modules/ajv/lib/2020.ts +75 -0
- package/node_modules/ajv/lib/ajv.ts +70 -0
- package/node_modules/ajv/lib/compile/codegen/code.ts +169 -0
- package/node_modules/ajv/lib/compile/codegen/index.ts +852 -0
- package/node_modules/ajv/lib/compile/codegen/scope.ts +215 -0
- package/node_modules/ajv/lib/compile/errors.ts +184 -0
- package/node_modules/ajv/lib/compile/index.ts +324 -0
- package/node_modules/ajv/lib/compile/jtd/parse.ts +411 -0
- package/node_modules/ajv/lib/compile/jtd/serialize.ts +266 -0
- package/node_modules/ajv/lib/compile/jtd/types.ts +16 -0
- package/node_modules/ajv/lib/compile/names.ts +27 -0
- package/node_modules/ajv/lib/compile/ref_error.ts +13 -0
- package/node_modules/ajv/lib/compile/resolve.ts +149 -0
- package/node_modules/ajv/lib/compile/rules.ts +50 -0
- package/node_modules/ajv/lib/compile/util.ts +213 -0
- package/node_modules/ajv/lib/compile/validate/applicability.ts +22 -0
- package/node_modules/ajv/lib/compile/validate/boolSchema.ts +47 -0
- package/node_modules/ajv/lib/compile/validate/dataType.ts +230 -0
- package/node_modules/ajv/lib/compile/validate/defaults.ts +32 -0
- package/node_modules/ajv/lib/compile/validate/index.ts +582 -0
- package/node_modules/ajv/lib/compile/validate/keyword.ts +171 -0
- package/node_modules/ajv/lib/compile/validate/subschema.ts +135 -0
- package/node_modules/ajv/lib/core.ts +891 -0
- package/node_modules/ajv/lib/jtd.ts +132 -0
- package/node_modules/ajv/lib/refs/data.json +13 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts +28 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json +53 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json +17 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json +57 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json +14 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json +90 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json +39 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts +30 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json +17 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json +51 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json +55 -0
- package/node_modules/ajv/lib/refs/json-schema-draft-06.json +137 -0
- package/node_modules/ajv/lib/refs/json-schema-draft-07.json +151 -0
- package/node_modules/ajv/lib/refs/json-schema-secure.json +88 -0
- package/node_modules/ajv/lib/refs/jtd-schema.ts +130 -0
- package/node_modules/ajv/lib/runtime/equal.ts +7 -0
- package/node_modules/ajv/lib/runtime/parseJson.ts +177 -0
- package/node_modules/ajv/lib/runtime/quote.ts +31 -0
- package/node_modules/ajv/lib/runtime/re2.ts +6 -0
- package/node_modules/ajv/lib/runtime/timestamp.ts +46 -0
- package/node_modules/ajv/lib/runtime/ucs2length.ts +20 -0
- package/node_modules/ajv/lib/runtime/uri.ts +6 -0
- package/node_modules/ajv/lib/runtime/validation_error.ts +13 -0
- package/node_modules/ajv/lib/standalone/index.ts +100 -0
- package/node_modules/ajv/lib/standalone/instance.ts +36 -0
- package/node_modules/ajv/lib/types/index.ts +244 -0
- package/node_modules/ajv/lib/types/json-schema.ts +187 -0
- package/node_modules/ajv/lib/types/jtd-schema.ts +273 -0
- package/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts +56 -0
- package/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts +118 -0
- package/node_modules/ajv/lib/vocabularies/applicator/allOf.ts +22 -0
- package/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts +14 -0
- package/node_modules/ajv/lib/vocabularies/applicator/contains.ts +109 -0
- package/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts +112 -0
- package/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts +11 -0
- package/node_modules/ajv/lib/vocabularies/applicator/if.ts +80 -0
- package/node_modules/ajv/lib/vocabularies/applicator/index.ts +53 -0
- package/node_modules/ajv/lib/vocabularies/applicator/items.ts +59 -0
- package/node_modules/ajv/lib/vocabularies/applicator/items2020.ts +36 -0
- package/node_modules/ajv/lib/vocabularies/applicator/not.ts +38 -0
- package/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts +82 -0
- package/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts +91 -0
- package/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/applicator/properties.ts +57 -0
- package/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts +50 -0
- package/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts +13 -0
- package/node_modules/ajv/lib/vocabularies/code.ts +168 -0
- package/node_modules/ajv/lib/vocabularies/core/id.ts +10 -0
- package/node_modules/ajv/lib/vocabularies/core/index.ts +16 -0
- package/node_modules/ajv/lib/vocabularies/core/ref.ts +129 -0
- package/node_modules/ajv/lib/vocabularies/discriminator/index.ts +113 -0
- package/node_modules/ajv/lib/vocabularies/discriminator/types.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/draft2020.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/draft7.ts +17 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts +31 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts +51 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/index.ts +9 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts +14 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts +10 -0
- package/node_modules/ajv/lib/vocabularies/errors.ts +18 -0
- package/node_modules/ajv/lib/vocabularies/format/format.ts +120 -0
- package/node_modules/ajv/lib/vocabularies/format/index.ts +6 -0
- package/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts +89 -0
- package/node_modules/ajv/lib/vocabularies/jtd/elements.ts +32 -0
- package/node_modules/ajv/lib/vocabularies/jtd/enum.ts +45 -0
- package/node_modules/ajv/lib/vocabularies/jtd/error.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/jtd/index.ts +37 -0
- package/node_modules/ajv/lib/vocabularies/jtd/metadata.ts +24 -0
- package/node_modules/ajv/lib/vocabularies/jtd/nullable.ts +21 -0
- package/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts +15 -0
- package/node_modules/ajv/lib/vocabularies/jtd/properties.ts +184 -0
- package/node_modules/ajv/lib/vocabularies/jtd/ref.ts +76 -0
- package/node_modules/ajv/lib/vocabularies/jtd/type.ts +75 -0
- package/node_modules/ajv/lib/vocabularies/jtd/union.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/jtd/values.ts +58 -0
- package/node_modules/ajv/lib/vocabularies/metadata.ts +17 -0
- package/node_modules/ajv/lib/vocabularies/next.ts +8 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/index.ts +7 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts +47 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts +85 -0
- package/node_modules/ajv/lib/vocabularies/validation/const.ts +28 -0
- package/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/validation/enum.ts +54 -0
- package/node_modules/ajv/lib/vocabularies/validation/index.ts +49 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitContains.ts +16 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitItems.ts +26 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitLength.ts +30 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts +42 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts +26 -0
- package/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts +34 -0
- package/node_modules/ajv/lib/vocabularies/validation/pattern.ts +28 -0
- package/node_modules/ajv/lib/vocabularies/validation/required.ts +98 -0
- package/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts +79 -0
- package/node_modules/ajv/package.json +126 -0
- package/node_modules/ansi-regex/index.d.ts +37 -0
- package/node_modules/ansi-regex/index.js +10 -0
- package/node_modules/ansi-regex/license +9 -0
- package/node_modules/ansi-regex/package.json +55 -0
- package/node_modules/ansi-regex/readme.md +78 -0
- package/node_modules/ansi-styles/index.d.ts +345 -0
- package/node_modules/ansi-styles/index.js +163 -0
- package/node_modules/ansi-styles/license +9 -0
- package/node_modules/ansi-styles/package.json +56 -0
- package/node_modules/ansi-styles/readme.md +152 -0
- package/node_modules/astral-regex/index.d.ts +28 -0
- package/node_modules/astral-regex/index.js +6 -0
- package/node_modules/astral-regex/license +9 -0
- package/node_modules/astral-regex/package.json +33 -0
- package/node_modules/astral-regex/readme.md +46 -0
- package/node_modules/at-least-node/LICENSE +6 -0
- package/node_modules/at-least-node/README.md +25 -0
- package/node_modules/at-least-node/index.js +5 -0
- package/node_modules/at-least-node/package.json +32 -0
- package/node_modules/chalk/index.d.ts +415 -0
- package/node_modules/chalk/license +9 -0
- package/node_modules/chalk/package.json +68 -0
- package/node_modules/chalk/readme.md +341 -0
- package/node_modules/chalk/source/index.js +229 -0
- package/node_modules/chalk/source/templates.js +134 -0
- package/node_modules/chalk/source/util.js +39 -0
- package/node_modules/color-convert/CHANGELOG.md +54 -0
- package/node_modules/color-convert/LICENSE +21 -0
- package/node_modules/color-convert/README.md +68 -0
- package/node_modules/color-convert/conversions.js +839 -0
- package/node_modules/color-convert/index.js +81 -0
- package/node_modules/color-convert/package.json +48 -0
- package/node_modules/color-convert/route.js +97 -0
- package/node_modules/color-name/LICENSE +8 -0
- package/node_modules/color-name/README.md +11 -0
- package/node_modules/color-name/index.js +152 -0
- package/node_modules/color-name/package.json +28 -0
- package/node_modules/diff/CONTRIBUTING.md +36 -0
- package/node_modules/diff/LICENSE +29 -0
- package/node_modules/diff/README.md +339 -0
- package/node_modules/diff/dist/diff.js +1730 -0
- package/node_modules/diff/dist/diff.min.js +1 -0
- package/node_modules/diff/lib/convert/dmp.js +32 -0
- package/node_modules/diff/lib/convert/xml.js +42 -0
- package/node_modules/diff/lib/diff/array.js +45 -0
- package/node_modules/diff/lib/diff/base.js +358 -0
- package/node_modules/diff/lib/diff/character.js +37 -0
- package/node_modules/diff/lib/diff/css.js +41 -0
- package/node_modules/diff/lib/diff/json.js +163 -0
- package/node_modules/diff/lib/diff/line.js +94 -0
- package/node_modules/diff/lib/diff/sentence.js +41 -0
- package/node_modules/diff/lib/diff/word.js +108 -0
- package/node_modules/diff/lib/index.es6.js +1699 -0
- package/node_modules/diff/lib/index.js +234 -0
- package/node_modules/diff/lib/index.mjs +1699 -0
- package/node_modules/diff/lib/patch/apply.js +238 -0
- package/node_modules/diff/lib/patch/create.js +276 -0
- package/node_modules/diff/lib/patch/merge.js +613 -0
- package/node_modules/diff/lib/patch/parse.js +167 -0
- package/node_modules/diff/lib/patch/reverse.js +63 -0
- package/node_modules/diff/lib/util/array.js +32 -0
- package/node_modules/diff/lib/util/distance-iterator.js +57 -0
- package/node_modules/diff/lib/util/params.js +24 -0
- package/node_modules/diff/package.json +89 -0
- package/node_modules/diff/release-notes.md +317 -0
- package/node_modules/diff/runtime.js +3 -0
- package/node_modules/emoji-regex/LICENSE-MIT.txt +20 -0
- package/node_modules/emoji-regex/README.md +73 -0
- package/node_modules/emoji-regex/es2015/index.js +6 -0
- package/node_modules/emoji-regex/es2015/text.js +6 -0
- package/node_modules/emoji-regex/index.d.ts +23 -0
- package/node_modules/emoji-regex/index.js +6 -0
- package/node_modules/emoji-regex/package.json +50 -0
- package/node_modules/emoji-regex/text.js +6 -0
- package/node_modules/fast-deep-equal/LICENSE +21 -0
- package/node_modules/fast-deep-equal/README.md +96 -0
- package/node_modules/fast-deep-equal/es6/index.d.ts +2 -0
- package/node_modules/fast-deep-equal/es6/index.js +72 -0
- package/node_modules/fast-deep-equal/es6/react.d.ts +2 -0
- package/node_modules/fast-deep-equal/es6/react.js +79 -0
- package/node_modules/fast-deep-equal/index.d.ts +4 -0
- package/node_modules/fast-deep-equal/index.js +46 -0
- package/node_modules/fast-deep-equal/package.json +61 -0
- package/node_modules/fast-deep-equal/react.d.ts +2 -0
- package/node_modules/fast-deep-equal/react.js +53 -0
- package/node_modules/fast-uri/.gitattributes +2 -0
- package/node_modules/fast-uri/.github/.stale.yml +21 -0
- package/node_modules/fast-uri/.github/dependabot.yml +13 -0
- package/node_modules/fast-uri/.github/tests_checker.yml +8 -0
- package/node_modules/fast-uri/.github/workflows/ci.yml +23 -0
- package/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +20 -0
- package/node_modules/fast-uri/LICENSE +30 -0
- package/node_modules/fast-uri/README.md +125 -0
- package/node_modules/fast-uri/benchmark.js +105 -0
- package/node_modules/fast-uri/index.js +303 -0
- package/node_modules/fast-uri/lib/schemes.js +188 -0
- package/node_modules/fast-uri/lib/scopedChars.js +30 -0
- package/node_modules/fast-uri/lib/utils.js +242 -0
- package/node_modules/fast-uri/package.json +39 -0
- package/node_modules/fast-uri/test/.gitkeep +0 -0
- package/node_modules/fast-uri/test/ajv.test.js +39 -0
- package/node_modules/fast-uri/test/compatibility.test.js +131 -0
- package/node_modules/fast-uri/test/equal.test.js +103 -0
- package/node_modules/fast-uri/test/parse.test.js +318 -0
- package/node_modules/fast-uri/test/resolve.test.js +75 -0
- package/node_modules/fast-uri/test/serialize.test.js +143 -0
- package/node_modules/fast-uri/test/uri-js.test.js +912 -0
- package/node_modules/fast-uri/test/util.test.js +23 -0
- package/node_modules/fast-uri/types/index.d.ts +53 -0
- package/node_modules/fast-uri/types/index.test-d.ts +17 -0
- package/node_modules/graphql-mapping-template/CHANGELOG.md +4 -0
- package/node_modules/graphql-mapping-template/LICENSE +201 -0
- package/node_modules/graphql-mapping-template/jest.config.js +12 -0
- package/node_modules/graphql-mapping-template/package.json +2 -41
- package/node_modules/graphql-transformer-common/CHANGELOG.md +4 -0
- package/node_modules/graphql-transformer-common/LICENSE +201 -0
- package/node_modules/graphql-transformer-common/jest.config.js +12 -0
- package/node_modules/graphql-transformer-common/package.json +3 -42
- package/node_modules/has-flag/index.d.ts +39 -0
- package/node_modules/has-flag/index.js +8 -0
- package/node_modules/has-flag/license +9 -0
- package/node_modules/has-flag/package.json +46 -0
- package/node_modules/has-flag/readme.md +89 -0
- package/node_modules/is-fullwidth-code-point/index.d.ts +17 -0
- package/node_modules/is-fullwidth-code-point/index.js +50 -0
- package/node_modules/is-fullwidth-code-point/license +9 -0
- package/node_modules/is-fullwidth-code-point/package.json +42 -0
- package/node_modules/is-fullwidth-code-point/readme.md +39 -0
- package/node_modules/json-schema-traverse/.eslintrc.yml +27 -0
- package/node_modules/json-schema-traverse/.github/FUNDING.yml +2 -0
- package/node_modules/json-schema-traverse/.github/workflows/build.yml +28 -0
- package/node_modules/json-schema-traverse/.github/workflows/publish.yml +27 -0
- package/node_modules/json-schema-traverse/LICENSE +21 -0
- package/node_modules/json-schema-traverse/README.md +95 -0
- package/node_modules/json-schema-traverse/index.d.ts +40 -0
- package/node_modules/json-schema-traverse/index.js +93 -0
- package/node_modules/json-schema-traverse/package.json +43 -0
- package/node_modules/json-schema-traverse/spec/.eslintrc.yml +6 -0
- package/node_modules/json-schema-traverse/spec/fixtures/schema.js +125 -0
- package/node_modules/json-schema-traverse/spec/index.spec.js +171 -0
- package/node_modules/lodash.truncate/LICENSE +47 -0
- package/node_modules/lodash.truncate/README.md +18 -0
- package/node_modules/lodash.truncate/index.js +632 -0
- package/node_modules/lodash.truncate/package.json +17 -0
- package/node_modules/require-from-string/index.js +34 -0
- package/node_modules/require-from-string/license +21 -0
- package/node_modules/require-from-string/package.json +28 -0
- package/node_modules/require-from-string/readme.md +56 -0
- package/node_modules/slice-ansi/index.js +103 -0
- package/node_modules/slice-ansi/license +10 -0
- package/node_modules/slice-ansi/package.json +52 -0
- package/node_modules/slice-ansi/readme.md +66 -0
- package/node_modules/string-width/index.d.ts +29 -0
- package/node_modules/string-width/index.js +47 -0
- package/node_modules/string-width/license +9 -0
- package/node_modules/string-width/package.json +56 -0
- package/node_modules/string-width/readme.md +50 -0
- package/node_modules/strip-ansi/index.d.ts +17 -0
- package/node_modules/strip-ansi/index.js +4 -0
- package/node_modules/strip-ansi/license +9 -0
- package/node_modules/strip-ansi/package.json +54 -0
- package/node_modules/strip-ansi/readme.md +46 -0
- package/node_modules/supports-color/browser.js +5 -0
- package/node_modules/supports-color/index.js +135 -0
- package/node_modules/supports-color/license +9 -0
- package/node_modules/supports-color/package.json +53 -0
- package/node_modules/supports-color/readme.md +76 -0
- package/node_modules/table/LICENSE +24 -0
- package/node_modules/table/README.md +837 -0
- package/node_modules/table/dist/src/alignSpanningCell.d.ts +7 -0
- package/node_modules/table/dist/src/alignSpanningCell.js +48 -0
- package/node_modules/table/dist/src/alignSpanningCell.js.map +1 -0
- package/node_modules/table/dist/src/alignString.d.ts +6 -0
- package/node_modules/table/dist/src/alignString.js +60 -0
- package/node_modules/table/dist/src/alignString.js.map +1 -0
- package/node_modules/table/dist/src/alignTableData.d.ts +2 -0
- package/node_modules/table/dist/src/alignTableData.js +20 -0
- package/node_modules/table/dist/src/alignTableData.js.map +1 -0
- package/node_modules/table/dist/src/calculateCellHeight.d.ts +4 -0
- package/node_modules/table/dist/src/calculateCellHeight.js +12 -0
- package/node_modules/table/dist/src/calculateCellHeight.js.map +1 -0
- package/node_modules/table/dist/src/calculateMaximumColumnWidths.d.ts +7 -0
- package/node_modules/table/dist/src/calculateMaximumColumnWidths.js +36 -0
- package/node_modules/table/dist/src/calculateMaximumColumnWidths.js.map +1 -0
- package/node_modules/table/dist/src/calculateOutputColumnWidths.d.ts +2 -0
- package/node_modules/table/dist/src/calculateOutputColumnWidths.js +10 -0
- package/node_modules/table/dist/src/calculateOutputColumnWidths.js.map +1 -0
- package/node_modules/table/dist/src/calculateRowHeights.d.ts +5 -0
- package/node_modules/table/dist/src/calculateRowHeights.js +42 -0
- package/node_modules/table/dist/src/calculateRowHeights.js.map +1 -0
- package/node_modules/table/dist/src/calculateSpanningCellWidth.d.ts +3 -0
- package/node_modules/table/dist/src/calculateSpanningCellWidth.js +26 -0
- package/node_modules/table/dist/src/calculateSpanningCellWidth.js.map +1 -0
- package/node_modules/table/dist/src/createStream.d.ts +2 -0
- package/node_modules/table/dist/src/createStream.js +74 -0
- package/node_modules/table/dist/src/createStream.js.map +1 -0
- package/node_modules/table/dist/src/drawBorder.d.ts +34 -0
- package/node_modules/table/dist/src/drawBorder.js +202 -0
- package/node_modules/table/dist/src/drawBorder.js.map +1 -0
- package/node_modules/table/dist/src/drawContent.d.ts +14 -0
- package/node_modules/table/dist/src/drawContent.js +51 -0
- package/node_modules/table/dist/src/drawContent.js.map +1 -0
- package/node_modules/table/dist/src/drawRow.d.ts +10 -0
- package/node_modules/table/dist/src/drawRow.js +25 -0
- package/node_modules/table/dist/src/drawRow.js.map +1 -0
- package/node_modules/table/dist/src/drawTable.d.ts +2 -0
- package/node_modules/table/dist/src/drawTable.js +31 -0
- package/node_modules/table/dist/src/drawTable.js.map +1 -0
- package/node_modules/table/dist/src/generated/validators.d.ts +13 -0
- package/node_modules/table/dist/src/generated/validators.js +2694 -0
- package/node_modules/table/dist/src/generated/validators.js.map +1 -0
- package/node_modules/table/dist/src/getBorderCharacters.d.ts +2 -0
- package/node_modules/table/dist/src/getBorderCharacters.js +105 -0
- package/node_modules/table/dist/src/getBorderCharacters.js.map +1 -0
- package/node_modules/table/dist/src/index.d.ts +5 -0
- package/node_modules/table/dist/src/index.js +21 -0
- package/node_modules/table/dist/src/index.js.map +1 -0
- package/node_modules/table/dist/src/injectHeaderConfig.d.ts +3 -0
- package/node_modules/table/dist/src/injectHeaderConfig.js +29 -0
- package/node_modules/table/dist/src/injectHeaderConfig.js.map +1 -0
- package/node_modules/table/dist/src/makeRangeConfig.d.ts +3 -0
- package/node_modules/table/dist/src/makeRangeConfig.js +18 -0
- package/node_modules/table/dist/src/makeRangeConfig.js.map +1 -0
- package/node_modules/table/dist/src/makeStreamConfig.d.ts +7 -0
- package/node_modules/table/dist/src/makeStreamConfig.js +43 -0
- package/node_modules/table/dist/src/makeStreamConfig.js.map +1 -0
- package/node_modules/table/dist/src/makeTableConfig.d.ts +7 -0
- package/node_modules/table/dist/src/makeTableConfig.js +62 -0
- package/node_modules/table/dist/src/makeTableConfig.js.map +1 -0
- package/node_modules/table/dist/src/mapDataUsingRowHeights.d.ts +4 -0
- package/node_modules/table/dist/src/mapDataUsingRowHeights.js +52 -0
- package/node_modules/table/dist/src/mapDataUsingRowHeights.js.map +1 -0
- package/node_modules/table/dist/src/padTableData.d.ts +3 -0
- package/node_modules/table/dist/src/padTableData.js +23 -0
- package/node_modules/table/dist/src/padTableData.js.map +1 -0
- package/node_modules/table/dist/src/schemas/config.json +95 -0
- package/node_modules/table/dist/src/schemas/shared.json +139 -0
- package/node_modules/table/dist/src/schemas/streamConfig.json +25 -0
- package/node_modules/table/dist/src/spanningCellManager.d.ts +23 -0
- package/node_modules/table/dist/src/spanningCellManager.js +95 -0
- package/node_modules/table/dist/src/spanningCellManager.js.map +1 -0
- package/node_modules/table/dist/src/stringifyTableData.d.ts +2 -0
- package/node_modules/table/dist/src/stringifyTableData.js +13 -0
- package/node_modules/table/dist/src/stringifyTableData.js.map +1 -0
- package/node_modules/table/dist/src/table.d.ts +2 -0
- package/node_modules/table/dist/src/table.js +32 -0
- package/node_modules/table/dist/src/table.js.map +1 -0
- package/node_modules/table/dist/src/truncateTableData.d.ts +6 -0
- package/node_modules/table/dist/src/truncateTableData.js +24 -0
- package/node_modules/table/dist/src/truncateTableData.js.map +1 -0
- package/node_modules/table/dist/src/types/api.d.ts +130 -0
- package/node_modules/table/dist/src/types/api.js +3 -0
- package/node_modules/table/dist/src/types/api.js.map +1 -0
- package/node_modules/table/dist/src/types/internal.d.ts +1 -0
- package/node_modules/table/dist/src/types/internal.js +3 -0
- package/node_modules/table/dist/src/types/internal.js.map +1 -0
- package/node_modules/table/dist/src/utils.d.ts +9 -0
- package/node_modules/table/dist/src/utils.js +134 -0
- package/node_modules/table/dist/src/utils.js.map +1 -0
- package/node_modules/table/dist/src/validateConfig.d.ts +2 -0
- package/node_modules/table/dist/src/validateConfig.js +27 -0
- package/node_modules/table/dist/src/validateConfig.js.map +1 -0
- package/node_modules/table/dist/src/validateSpanningCellConfig.d.ts +3 -0
- package/node_modules/table/dist/src/validateSpanningCellConfig.js +46 -0
- package/node_modules/table/dist/src/validateSpanningCellConfig.js.map +1 -0
- package/node_modules/table/dist/src/validateTableData.d.ts +1 -0
- package/node_modules/table/dist/src/validateTableData.js +32 -0
- package/node_modules/table/dist/src/validateTableData.js.map +1 -0
- package/node_modules/table/dist/src/wrapCell.d.ts +8 -0
- package/node_modules/table/dist/src/wrapCell.js +33 -0
- package/node_modules/table/dist/src/wrapCell.js.map +1 -0
- package/node_modules/table/dist/src/wrapString.d.ts +9 -0
- package/node_modules/table/dist/src/wrapString.js +27 -0
- package/node_modules/table/dist/src/wrapString.js.map +1 -0
- package/node_modules/table/dist/src/wrapWord.d.ts +1 -0
- package/node_modules/table/dist/src/wrapWord.js +42 -0
- package/node_modules/table/dist/src/wrapWord.js.map +1 -0
- package/node_modules/table/package.json +77 -0
- package/package.json +132 -123
- package/src/amplify-graphql-api.ts +2 -0
- package/src/index.ts +2 -0
- package/src/log-config-types.ts +84 -0
- package/src/types.ts +6 -1
@@ -0,0 +1,1730 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
4
|
+
(global = global || self, factory(global.Diff = {}));
|
5
|
+
}(this, (function (exports) { 'use strict';
|
6
|
+
|
7
|
+
function Diff() {}
|
8
|
+
Diff.prototype = {
|
9
|
+
diff: function diff(oldString, newString) {
|
10
|
+
var _options$timeout;
|
11
|
+
|
12
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
13
|
+
var callback = options.callback;
|
14
|
+
|
15
|
+
if (typeof options === 'function') {
|
16
|
+
callback = options;
|
17
|
+
options = {};
|
18
|
+
}
|
19
|
+
|
20
|
+
this.options = options;
|
21
|
+
var self = this;
|
22
|
+
|
23
|
+
function done(value) {
|
24
|
+
if (callback) {
|
25
|
+
setTimeout(function () {
|
26
|
+
callback(undefined, value);
|
27
|
+
}, 0);
|
28
|
+
return true;
|
29
|
+
} else {
|
30
|
+
return value;
|
31
|
+
}
|
32
|
+
} // Allow subclasses to massage the input prior to running
|
33
|
+
|
34
|
+
|
35
|
+
oldString = this.castInput(oldString);
|
36
|
+
newString = this.castInput(newString);
|
37
|
+
oldString = this.removeEmpty(this.tokenize(oldString));
|
38
|
+
newString = this.removeEmpty(this.tokenize(newString));
|
39
|
+
var newLen = newString.length,
|
40
|
+
oldLen = oldString.length;
|
41
|
+
var editLength = 1;
|
42
|
+
var maxEditLength = newLen + oldLen;
|
43
|
+
|
44
|
+
if (options.maxEditLength) {
|
45
|
+
maxEditLength = Math.min(maxEditLength, options.maxEditLength);
|
46
|
+
}
|
47
|
+
|
48
|
+
var maxExecutionTime = (_options$timeout = options.timeout) !== null && _options$timeout !== void 0 ? _options$timeout : Infinity;
|
49
|
+
var abortAfterTimestamp = Date.now() + maxExecutionTime;
|
50
|
+
var bestPath = [{
|
51
|
+
oldPos: -1,
|
52
|
+
lastComponent: undefined
|
53
|
+
}]; // Seed editLength = 0, i.e. the content starts with the same values
|
54
|
+
|
55
|
+
var newPos = this.extractCommon(bestPath[0], newString, oldString, 0);
|
56
|
+
|
57
|
+
if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
|
58
|
+
// Identity per the equality and tokenizer
|
59
|
+
return done([{
|
60
|
+
value: this.join(newString),
|
61
|
+
count: newString.length
|
62
|
+
}]);
|
63
|
+
} // Once we hit the right edge of the edit graph on some diagonal k, we can
|
64
|
+
// definitely reach the end of the edit graph in no more than k edits, so
|
65
|
+
// there's no point in considering any moves to diagonal k+1 any more (from
|
66
|
+
// which we're guaranteed to need at least k+1 more edits).
|
67
|
+
// Similarly, once we've reached the bottom of the edit graph, there's no
|
68
|
+
// point considering moves to lower diagonals.
|
69
|
+
// We record this fact by setting minDiagonalToConsider and
|
70
|
+
// maxDiagonalToConsider to some finite value once we've hit the edge of
|
71
|
+
// the edit graph.
|
72
|
+
// This optimization is not faithful to the original algorithm presented in
|
73
|
+
// Myers's paper, which instead pointlessly extends D-paths off the end of
|
74
|
+
// the edit graph - see page 7 of Myers's paper which notes this point
|
75
|
+
// explicitly and illustrates it with a diagram. This has major performance
|
76
|
+
// implications for some common scenarios. For instance, to compute a diff
|
77
|
+
// where the new text simply appends d characters on the end of the
|
78
|
+
// original text of length n, the true Myers algorithm will take O(n+d^2)
|
79
|
+
// time while this optimization needs only O(n+d) time.
|
80
|
+
|
81
|
+
|
82
|
+
var minDiagonalToConsider = -Infinity,
|
83
|
+
maxDiagonalToConsider = Infinity; // Main worker method. checks all permutations of a given edit length for acceptance.
|
84
|
+
|
85
|
+
function execEditLength() {
|
86
|
+
for (var diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {
|
87
|
+
var basePath = void 0;
|
88
|
+
var removePath = bestPath[diagonalPath - 1],
|
89
|
+
addPath = bestPath[diagonalPath + 1];
|
90
|
+
|
91
|
+
if (removePath) {
|
92
|
+
// No one else is going to attempt to use this value, clear it
|
93
|
+
bestPath[diagonalPath - 1] = undefined;
|
94
|
+
}
|
95
|
+
|
96
|
+
var canAdd = false;
|
97
|
+
|
98
|
+
if (addPath) {
|
99
|
+
// what newPos will be after we do an insertion:
|
100
|
+
var addPathNewPos = addPath.oldPos - diagonalPath;
|
101
|
+
canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;
|
102
|
+
}
|
103
|
+
|
104
|
+
var canRemove = removePath && removePath.oldPos + 1 < oldLen;
|
105
|
+
|
106
|
+
if (!canAdd && !canRemove) {
|
107
|
+
// If this path is a terminal then prune
|
108
|
+
bestPath[diagonalPath] = undefined;
|
109
|
+
continue;
|
110
|
+
} // Select the diagonal that we want to branch from. We select the prior
|
111
|
+
// path whose position in the old string is the farthest from the origin
|
112
|
+
// and does not pass the bounds of the diff graph
|
113
|
+
// TODO: Remove the `+ 1` here to make behavior match Myers algorithm
|
114
|
+
// and prefer to order removals before insertions.
|
115
|
+
|
116
|
+
|
117
|
+
if (!canRemove || canAdd && removePath.oldPos + 1 < addPath.oldPos) {
|
118
|
+
basePath = self.addToPath(addPath, true, undefined, 0);
|
119
|
+
} else {
|
120
|
+
basePath = self.addToPath(removePath, undefined, true, 1);
|
121
|
+
}
|
122
|
+
|
123
|
+
newPos = self.extractCommon(basePath, newString, oldString, diagonalPath);
|
124
|
+
|
125
|
+
if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
|
126
|
+
// If we have hit the end of both strings, then we are done
|
127
|
+
return done(buildValues(self, basePath.lastComponent, newString, oldString, self.useLongestToken));
|
128
|
+
} else {
|
129
|
+
bestPath[diagonalPath] = basePath;
|
130
|
+
|
131
|
+
if (basePath.oldPos + 1 >= oldLen) {
|
132
|
+
maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);
|
133
|
+
}
|
134
|
+
|
135
|
+
if (newPos + 1 >= newLen) {
|
136
|
+
minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);
|
137
|
+
}
|
138
|
+
}
|
139
|
+
}
|
140
|
+
|
141
|
+
editLength++;
|
142
|
+
} // Performs the length of edit iteration. Is a bit fugly as this has to support the
|
143
|
+
// sync and async mode which is never fun. Loops over execEditLength until a value
|
144
|
+
// is produced, or until the edit length exceeds options.maxEditLength (if given),
|
145
|
+
// in which case it will return undefined.
|
146
|
+
|
147
|
+
|
148
|
+
if (callback) {
|
149
|
+
(function exec() {
|
150
|
+
setTimeout(function () {
|
151
|
+
if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {
|
152
|
+
return callback();
|
153
|
+
}
|
154
|
+
|
155
|
+
if (!execEditLength()) {
|
156
|
+
exec();
|
157
|
+
}
|
158
|
+
}, 0);
|
159
|
+
})();
|
160
|
+
} else {
|
161
|
+
while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {
|
162
|
+
var ret = execEditLength();
|
163
|
+
|
164
|
+
if (ret) {
|
165
|
+
return ret;
|
166
|
+
}
|
167
|
+
}
|
168
|
+
}
|
169
|
+
},
|
170
|
+
addToPath: function addToPath(path, added, removed, oldPosInc) {
|
171
|
+
var last = path.lastComponent;
|
172
|
+
|
173
|
+
if (last && last.added === added && last.removed === removed) {
|
174
|
+
return {
|
175
|
+
oldPos: path.oldPos + oldPosInc,
|
176
|
+
lastComponent: {
|
177
|
+
count: last.count + 1,
|
178
|
+
added: added,
|
179
|
+
removed: removed,
|
180
|
+
previousComponent: last.previousComponent
|
181
|
+
}
|
182
|
+
};
|
183
|
+
} else {
|
184
|
+
return {
|
185
|
+
oldPos: path.oldPos + oldPosInc,
|
186
|
+
lastComponent: {
|
187
|
+
count: 1,
|
188
|
+
added: added,
|
189
|
+
removed: removed,
|
190
|
+
previousComponent: last
|
191
|
+
}
|
192
|
+
};
|
193
|
+
}
|
194
|
+
},
|
195
|
+
extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
|
196
|
+
var newLen = newString.length,
|
197
|
+
oldLen = oldString.length,
|
198
|
+
oldPos = basePath.oldPos,
|
199
|
+
newPos = oldPos - diagonalPath,
|
200
|
+
commonCount = 0;
|
201
|
+
|
202
|
+
while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
|
203
|
+
newPos++;
|
204
|
+
oldPos++;
|
205
|
+
commonCount++;
|
206
|
+
}
|
207
|
+
|
208
|
+
if (commonCount) {
|
209
|
+
basePath.lastComponent = {
|
210
|
+
count: commonCount,
|
211
|
+
previousComponent: basePath.lastComponent
|
212
|
+
};
|
213
|
+
}
|
214
|
+
|
215
|
+
basePath.oldPos = oldPos;
|
216
|
+
return newPos;
|
217
|
+
},
|
218
|
+
equals: function equals(left, right) {
|
219
|
+
if (this.options.comparator) {
|
220
|
+
return this.options.comparator(left, right);
|
221
|
+
} else {
|
222
|
+
return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase();
|
223
|
+
}
|
224
|
+
},
|
225
|
+
removeEmpty: function removeEmpty(array) {
|
226
|
+
var ret = [];
|
227
|
+
|
228
|
+
for (var i = 0; i < array.length; i++) {
|
229
|
+
if (array[i]) {
|
230
|
+
ret.push(array[i]);
|
231
|
+
}
|
232
|
+
}
|
233
|
+
|
234
|
+
return ret;
|
235
|
+
},
|
236
|
+
castInput: function castInput(value) {
|
237
|
+
return value;
|
238
|
+
},
|
239
|
+
tokenize: function tokenize(value) {
|
240
|
+
return value.split('');
|
241
|
+
},
|
242
|
+
join: function join(chars) {
|
243
|
+
return chars.join('');
|
244
|
+
}
|
245
|
+
};
|
246
|
+
|
247
|
+
function buildValues(diff, lastComponent, newString, oldString, useLongestToken) {
|
248
|
+
// First we convert our linked list of components in reverse order to an
|
249
|
+
// array in the right order:
|
250
|
+
var components = [];
|
251
|
+
var nextComponent;
|
252
|
+
|
253
|
+
while (lastComponent) {
|
254
|
+
components.push(lastComponent);
|
255
|
+
nextComponent = lastComponent.previousComponent;
|
256
|
+
delete lastComponent.previousComponent;
|
257
|
+
lastComponent = nextComponent;
|
258
|
+
}
|
259
|
+
|
260
|
+
components.reverse();
|
261
|
+
var componentPos = 0,
|
262
|
+
componentLen = components.length,
|
263
|
+
newPos = 0,
|
264
|
+
oldPos = 0;
|
265
|
+
|
266
|
+
for (; componentPos < componentLen; componentPos++) {
|
267
|
+
var component = components[componentPos];
|
268
|
+
|
269
|
+
if (!component.removed) {
|
270
|
+
if (!component.added && useLongestToken) {
|
271
|
+
var value = newString.slice(newPos, newPos + component.count);
|
272
|
+
value = value.map(function (value, i) {
|
273
|
+
var oldValue = oldString[oldPos + i];
|
274
|
+
return oldValue.length > value.length ? oldValue : value;
|
275
|
+
});
|
276
|
+
component.value = diff.join(value);
|
277
|
+
} else {
|
278
|
+
component.value = diff.join(newString.slice(newPos, newPos + component.count));
|
279
|
+
}
|
280
|
+
|
281
|
+
newPos += component.count; // Common case
|
282
|
+
|
283
|
+
if (!component.added) {
|
284
|
+
oldPos += component.count;
|
285
|
+
}
|
286
|
+
} else {
|
287
|
+
component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
|
288
|
+
oldPos += component.count; // Reverse add and remove so removes are output first to match common convention
|
289
|
+
// The diffing algorithm is tied to add then remove output and this is the simplest
|
290
|
+
// route to get the desired output with minimal overhead.
|
291
|
+
|
292
|
+
if (componentPos && components[componentPos - 1].added) {
|
293
|
+
var tmp = components[componentPos - 1];
|
294
|
+
components[componentPos - 1] = components[componentPos];
|
295
|
+
components[componentPos] = tmp;
|
296
|
+
}
|
297
|
+
}
|
298
|
+
} // Special case handle for when one terminal is ignored (i.e. whitespace).
|
299
|
+
// For this case we merge the terminal into the prior string and drop the change.
|
300
|
+
// This is only available for string mode.
|
301
|
+
|
302
|
+
|
303
|
+
var finalComponent = components[componentLen - 1];
|
304
|
+
|
305
|
+
if (componentLen > 1 && typeof finalComponent.value === 'string' && (finalComponent.added || finalComponent.removed) && diff.equals('', finalComponent.value)) {
|
306
|
+
components[componentLen - 2].value += finalComponent.value;
|
307
|
+
components.pop();
|
308
|
+
}
|
309
|
+
|
310
|
+
return components;
|
311
|
+
}
|
312
|
+
|
313
|
+
var characterDiff = new Diff();
|
314
|
+
function diffChars(oldStr, newStr, options) {
|
315
|
+
return characterDiff.diff(oldStr, newStr, options);
|
316
|
+
}
|
317
|
+
|
318
|
+
function generateOptions(options, defaults) {
|
319
|
+
if (typeof options === 'function') {
|
320
|
+
defaults.callback = options;
|
321
|
+
} else if (options) {
|
322
|
+
for (var name in options) {
|
323
|
+
/* istanbul ignore else */
|
324
|
+
if (options.hasOwnProperty(name)) {
|
325
|
+
defaults[name] = options[name];
|
326
|
+
}
|
327
|
+
}
|
328
|
+
}
|
329
|
+
|
330
|
+
return defaults;
|
331
|
+
}
|
332
|
+
|
333
|
+
//
|
334
|
+
// Ranges and exceptions:
|
335
|
+
// Latin-1 Supplement, 0080–00FF
|
336
|
+
// - U+00D7 × Multiplication sign
|
337
|
+
// - U+00F7 ÷ Division sign
|
338
|
+
// Latin Extended-A, 0100–017F
|
339
|
+
// Latin Extended-B, 0180–024F
|
340
|
+
// IPA Extensions, 0250–02AF
|
341
|
+
// Spacing Modifier Letters, 02B0–02FF
|
342
|
+
// - U+02C7 ˇ ˇ Caron
|
343
|
+
// - U+02D8 ˘ ˘ Breve
|
344
|
+
// - U+02D9 ˙ ˙ Dot Above
|
345
|
+
// - U+02DA ˚ ˚ Ring Above
|
346
|
+
// - U+02DB ˛ ˛ Ogonek
|
347
|
+
// - U+02DC ˜ ˜ Small Tilde
|
348
|
+
// - U+02DD ˝ ˝ Double Acute Accent
|
349
|
+
// Latin Extended Additional, 1E00–1EFF
|
350
|
+
|
351
|
+
var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/;
|
352
|
+
var reWhitespace = /\S/;
|
353
|
+
var wordDiff = new Diff();
|
354
|
+
|
355
|
+
wordDiff.equals = function (left, right) {
|
356
|
+
if (this.options.ignoreCase) {
|
357
|
+
left = left.toLowerCase();
|
358
|
+
right = right.toLowerCase();
|
359
|
+
}
|
360
|
+
|
361
|
+
return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right);
|
362
|
+
};
|
363
|
+
|
364
|
+
wordDiff.tokenize = function (value) {
|
365
|
+
// All whitespace symbols except newline group into one token, each newline - in separate token
|
366
|
+
var tokens = value.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/); // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set.
|
367
|
+
|
368
|
+
for (var i = 0; i < tokens.length - 1; i++) {
|
369
|
+
// If we have an empty string in the next field and we have only word chars before and after, merge
|
370
|
+
if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) {
|
371
|
+
tokens[i] += tokens[i + 2];
|
372
|
+
tokens.splice(i + 1, 2);
|
373
|
+
i--;
|
374
|
+
}
|
375
|
+
}
|
376
|
+
|
377
|
+
return tokens;
|
378
|
+
};
|
379
|
+
|
380
|
+
function diffWords(oldStr, newStr, options) {
|
381
|
+
options = generateOptions(options, {
|
382
|
+
ignoreWhitespace: true
|
383
|
+
});
|
384
|
+
return wordDiff.diff(oldStr, newStr, options);
|
385
|
+
}
|
386
|
+
function diffWordsWithSpace(oldStr, newStr, options) {
|
387
|
+
return wordDiff.diff(oldStr, newStr, options);
|
388
|
+
}
|
389
|
+
|
390
|
+
var lineDiff = new Diff();
|
391
|
+
|
392
|
+
lineDiff.tokenize = function (value) {
|
393
|
+
if (this.options.stripTrailingCr) {
|
394
|
+
// remove one \r before \n to match GNU diff's --strip-trailing-cr behavior
|
395
|
+
value = value.replace(/\r\n/g, '\n');
|
396
|
+
}
|
397
|
+
|
398
|
+
var retLines = [],
|
399
|
+
linesAndNewlines = value.split(/(\n|\r\n)/); // Ignore the final empty token that occurs if the string ends with a new line
|
400
|
+
|
401
|
+
if (!linesAndNewlines[linesAndNewlines.length - 1]) {
|
402
|
+
linesAndNewlines.pop();
|
403
|
+
} // Merge the content and line separators into single tokens
|
404
|
+
|
405
|
+
|
406
|
+
for (var i = 0; i < linesAndNewlines.length; i++) {
|
407
|
+
var line = linesAndNewlines[i];
|
408
|
+
|
409
|
+
if (i % 2 && !this.options.newlineIsToken) {
|
410
|
+
retLines[retLines.length - 1] += line;
|
411
|
+
} else {
|
412
|
+
if (this.options.ignoreWhitespace) {
|
413
|
+
line = line.trim();
|
414
|
+
}
|
415
|
+
|
416
|
+
retLines.push(line);
|
417
|
+
}
|
418
|
+
}
|
419
|
+
|
420
|
+
return retLines;
|
421
|
+
};
|
422
|
+
|
423
|
+
function diffLines(oldStr, newStr, callback) {
|
424
|
+
return lineDiff.diff(oldStr, newStr, callback);
|
425
|
+
}
|
426
|
+
function diffTrimmedLines(oldStr, newStr, callback) {
|
427
|
+
var options = generateOptions(callback, {
|
428
|
+
ignoreWhitespace: true
|
429
|
+
});
|
430
|
+
return lineDiff.diff(oldStr, newStr, options);
|
431
|
+
}
|
432
|
+
|
433
|
+
var sentenceDiff = new Diff();
|
434
|
+
|
435
|
+
sentenceDiff.tokenize = function (value) {
|
436
|
+
return value.split(/(\S.+?[.!?])(?=\s+|$)/);
|
437
|
+
};
|
438
|
+
|
439
|
+
function diffSentences(oldStr, newStr, callback) {
|
440
|
+
return sentenceDiff.diff(oldStr, newStr, callback);
|
441
|
+
}
|
442
|
+
|
443
|
+
var cssDiff = new Diff();
|
444
|
+
|
445
|
+
cssDiff.tokenize = function (value) {
|
446
|
+
return value.split(/([{}:;,]|\s+)/);
|
447
|
+
};
|
448
|
+
|
449
|
+
function diffCss(oldStr, newStr, callback) {
|
450
|
+
return cssDiff.diff(oldStr, newStr, callback);
|
451
|
+
}
|
452
|
+
|
453
|
+
function _typeof(obj) {
|
454
|
+
"@babel/helpers - typeof";
|
455
|
+
|
456
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
457
|
+
_typeof = function (obj) {
|
458
|
+
return typeof obj;
|
459
|
+
};
|
460
|
+
} else {
|
461
|
+
_typeof = function (obj) {
|
462
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
463
|
+
};
|
464
|
+
}
|
465
|
+
|
466
|
+
return _typeof(obj);
|
467
|
+
}
|
468
|
+
|
469
|
+
function _defineProperty(obj, key, value) {
|
470
|
+
if (key in obj) {
|
471
|
+
Object.defineProperty(obj, key, {
|
472
|
+
value: value,
|
473
|
+
enumerable: true,
|
474
|
+
configurable: true,
|
475
|
+
writable: true
|
476
|
+
});
|
477
|
+
} else {
|
478
|
+
obj[key] = value;
|
479
|
+
}
|
480
|
+
|
481
|
+
return obj;
|
482
|
+
}
|
483
|
+
|
484
|
+
function ownKeys(object, enumerableOnly) {
|
485
|
+
var keys = Object.keys(object);
|
486
|
+
|
487
|
+
if (Object.getOwnPropertySymbols) {
|
488
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
489
|
+
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
490
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
491
|
+
});
|
492
|
+
keys.push.apply(keys, symbols);
|
493
|
+
}
|
494
|
+
|
495
|
+
return keys;
|
496
|
+
}
|
497
|
+
|
498
|
+
function _objectSpread2(target) {
|
499
|
+
for (var i = 1; i < arguments.length; i++) {
|
500
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
501
|
+
|
502
|
+
if (i % 2) {
|
503
|
+
ownKeys(Object(source), true).forEach(function (key) {
|
504
|
+
_defineProperty(target, key, source[key]);
|
505
|
+
});
|
506
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
507
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
508
|
+
} else {
|
509
|
+
ownKeys(Object(source)).forEach(function (key) {
|
510
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
511
|
+
});
|
512
|
+
}
|
513
|
+
}
|
514
|
+
|
515
|
+
return target;
|
516
|
+
}
|
517
|
+
|
518
|
+
function _toConsumableArray(arr) {
|
519
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
520
|
+
}
|
521
|
+
|
522
|
+
function _arrayWithoutHoles(arr) {
|
523
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
524
|
+
}
|
525
|
+
|
526
|
+
function _iterableToArray(iter) {
|
527
|
+
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
528
|
+
}
|
529
|
+
|
530
|
+
function _unsupportedIterableToArray(o, minLen) {
|
531
|
+
if (!o) return;
|
532
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
533
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
534
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
535
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
536
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
537
|
+
}
|
538
|
+
|
539
|
+
function _arrayLikeToArray(arr, len) {
|
540
|
+
if (len == null || len > arr.length) len = arr.length;
|
541
|
+
|
542
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
543
|
+
|
544
|
+
return arr2;
|
545
|
+
}
|
546
|
+
|
547
|
+
function _nonIterableSpread() {
|
548
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
549
|
+
}
|
550
|
+
|
551
|
+
var objectPrototypeToString = Object.prototype.toString;
|
552
|
+
var jsonDiff = new Diff(); // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a
|
553
|
+
// dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output:
|
554
|
+
|
555
|
+
jsonDiff.useLongestToken = true;
|
556
|
+
jsonDiff.tokenize = lineDiff.tokenize;
|
557
|
+
|
558
|
+
jsonDiff.castInput = function (value) {
|
559
|
+
var _this$options = this.options,
|
560
|
+
undefinedReplacement = _this$options.undefinedReplacement,
|
561
|
+
_this$options$stringi = _this$options.stringifyReplacer,
|
562
|
+
stringifyReplacer = _this$options$stringi === void 0 ? function (k, v) {
|
563
|
+
return typeof v === 'undefined' ? undefinedReplacement : v;
|
564
|
+
} : _this$options$stringi;
|
565
|
+
return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, ' ');
|
566
|
+
};
|
567
|
+
|
568
|
+
jsonDiff.equals = function (left, right) {
|
569
|
+
return Diff.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1'));
|
570
|
+
};
|
571
|
+
|
572
|
+
function diffJson(oldObj, newObj, options) {
|
573
|
+
return jsonDiff.diff(oldObj, newObj, options);
|
574
|
+
} // This function handles the presence of circular references by bailing out when encountering an
|
575
|
+
// object that is already on the "stack" of items being processed. Accepts an optional replacer
|
576
|
+
|
577
|
+
function canonicalize(obj, stack, replacementStack, replacer, key) {
|
578
|
+
stack = stack || [];
|
579
|
+
replacementStack = replacementStack || [];
|
580
|
+
|
581
|
+
if (replacer) {
|
582
|
+
obj = replacer(key, obj);
|
583
|
+
}
|
584
|
+
|
585
|
+
var i;
|
586
|
+
|
587
|
+
for (i = 0; i < stack.length; i += 1) {
|
588
|
+
if (stack[i] === obj) {
|
589
|
+
return replacementStack[i];
|
590
|
+
}
|
591
|
+
}
|
592
|
+
|
593
|
+
var canonicalizedObj;
|
594
|
+
|
595
|
+
if ('[object Array]' === objectPrototypeToString.call(obj)) {
|
596
|
+
stack.push(obj);
|
597
|
+
canonicalizedObj = new Array(obj.length);
|
598
|
+
replacementStack.push(canonicalizedObj);
|
599
|
+
|
600
|
+
for (i = 0; i < obj.length; i += 1) {
|
601
|
+
canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key);
|
602
|
+
}
|
603
|
+
|
604
|
+
stack.pop();
|
605
|
+
replacementStack.pop();
|
606
|
+
return canonicalizedObj;
|
607
|
+
}
|
608
|
+
|
609
|
+
if (obj && obj.toJSON) {
|
610
|
+
obj = obj.toJSON();
|
611
|
+
}
|
612
|
+
|
613
|
+
if (_typeof(obj) === 'object' && obj !== null) {
|
614
|
+
stack.push(obj);
|
615
|
+
canonicalizedObj = {};
|
616
|
+
replacementStack.push(canonicalizedObj);
|
617
|
+
|
618
|
+
var sortedKeys = [],
|
619
|
+
_key;
|
620
|
+
|
621
|
+
for (_key in obj) {
|
622
|
+
/* istanbul ignore else */
|
623
|
+
if (obj.hasOwnProperty(_key)) {
|
624
|
+
sortedKeys.push(_key);
|
625
|
+
}
|
626
|
+
}
|
627
|
+
|
628
|
+
sortedKeys.sort();
|
629
|
+
|
630
|
+
for (i = 0; i < sortedKeys.length; i += 1) {
|
631
|
+
_key = sortedKeys[i];
|
632
|
+
canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key);
|
633
|
+
}
|
634
|
+
|
635
|
+
stack.pop();
|
636
|
+
replacementStack.pop();
|
637
|
+
} else {
|
638
|
+
canonicalizedObj = obj;
|
639
|
+
}
|
640
|
+
|
641
|
+
return canonicalizedObj;
|
642
|
+
}
|
643
|
+
|
644
|
+
var arrayDiff = new Diff();
|
645
|
+
|
646
|
+
arrayDiff.tokenize = function (value) {
|
647
|
+
return value.slice();
|
648
|
+
};
|
649
|
+
|
650
|
+
arrayDiff.join = arrayDiff.removeEmpty = function (value) {
|
651
|
+
return value;
|
652
|
+
};
|
653
|
+
|
654
|
+
function diffArrays(oldArr, newArr, callback) {
|
655
|
+
return arrayDiff.diff(oldArr, newArr, callback);
|
656
|
+
}
|
657
|
+
|
658
|
+
function parsePatch(uniDiff) {
|
659
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
660
|
+
var diffstr = uniDiff.split(/\r\n|[\n\v\f\r\x85]/),
|
661
|
+
delimiters = uniDiff.match(/\r\n|[\n\v\f\r\x85]/g) || [],
|
662
|
+
list = [],
|
663
|
+
i = 0;
|
664
|
+
|
665
|
+
function parseIndex() {
|
666
|
+
var index = {};
|
667
|
+
list.push(index); // Parse diff metadata
|
668
|
+
|
669
|
+
while (i < diffstr.length) {
|
670
|
+
var line = diffstr[i]; // File header found, end parsing diff metadata
|
671
|
+
|
672
|
+
if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) {
|
673
|
+
break;
|
674
|
+
} // Diff index
|
675
|
+
|
676
|
+
|
677
|
+
var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line);
|
678
|
+
|
679
|
+
if (header) {
|
680
|
+
index.index = header[1];
|
681
|
+
}
|
682
|
+
|
683
|
+
i++;
|
684
|
+
} // Parse file headers if they are defined. Unified diff requires them, but
|
685
|
+
// there's no technical issues to have an isolated hunk without file header
|
686
|
+
|
687
|
+
|
688
|
+
parseFileHeader(index);
|
689
|
+
parseFileHeader(index); // Parse hunks
|
690
|
+
|
691
|
+
index.hunks = [];
|
692
|
+
|
693
|
+
while (i < diffstr.length) {
|
694
|
+
var _line = diffstr[i];
|
695
|
+
|
696
|
+
if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(_line)) {
|
697
|
+
break;
|
698
|
+
} else if (/^@@/.test(_line)) {
|
699
|
+
index.hunks.push(parseHunk());
|
700
|
+
} else if (_line && options.strict) {
|
701
|
+
// Ignore unexpected content unless in strict mode
|
702
|
+
throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line));
|
703
|
+
} else {
|
704
|
+
i++;
|
705
|
+
}
|
706
|
+
}
|
707
|
+
} // Parses the --- and +++ headers, if none are found, no lines
|
708
|
+
// are consumed.
|
709
|
+
|
710
|
+
|
711
|
+
function parseFileHeader(index) {
|
712
|
+
var fileHeader = /^(---|\+\+\+)\s+(.*)$/.exec(diffstr[i]);
|
713
|
+
|
714
|
+
if (fileHeader) {
|
715
|
+
var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new';
|
716
|
+
var data = fileHeader[2].split('\t', 2);
|
717
|
+
var fileName = data[0].replace(/\\\\/g, '\\');
|
718
|
+
|
719
|
+
if (/^".*"$/.test(fileName)) {
|
720
|
+
fileName = fileName.substr(1, fileName.length - 2);
|
721
|
+
}
|
722
|
+
|
723
|
+
index[keyPrefix + 'FileName'] = fileName;
|
724
|
+
index[keyPrefix + 'Header'] = (data[1] || '').trim();
|
725
|
+
i++;
|
726
|
+
}
|
727
|
+
} // Parses a hunk
|
728
|
+
// This assumes that we are at the start of a hunk.
|
729
|
+
|
730
|
+
|
731
|
+
function parseHunk() {
|
732
|
+
var chunkHeaderIndex = i,
|
733
|
+
chunkHeaderLine = diffstr[i++],
|
734
|
+
chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);
|
735
|
+
var hunk = {
|
736
|
+
oldStart: +chunkHeader[1],
|
737
|
+
oldLines: typeof chunkHeader[2] === 'undefined' ? 1 : +chunkHeader[2],
|
738
|
+
newStart: +chunkHeader[3],
|
739
|
+
newLines: typeof chunkHeader[4] === 'undefined' ? 1 : +chunkHeader[4],
|
740
|
+
lines: [],
|
741
|
+
linedelimiters: []
|
742
|
+
}; // Unified Diff Format quirk: If the chunk size is 0,
|
743
|
+
// the first number is one lower than one would expect.
|
744
|
+
// https://www.artima.com/weblogs/viewpost.jsp?thread=164293
|
745
|
+
|
746
|
+
if (hunk.oldLines === 0) {
|
747
|
+
hunk.oldStart += 1;
|
748
|
+
}
|
749
|
+
|
750
|
+
if (hunk.newLines === 0) {
|
751
|
+
hunk.newStart += 1;
|
752
|
+
}
|
753
|
+
|
754
|
+
var addCount = 0,
|
755
|
+
removeCount = 0;
|
756
|
+
|
757
|
+
for (; i < diffstr.length; i++) {
|
758
|
+
// Lines starting with '---' could be mistaken for the "remove line" operation
|
759
|
+
// But they could be the header for the next file. Therefore prune such cases out.
|
760
|
+
if (diffstr[i].indexOf('--- ') === 0 && i + 2 < diffstr.length && diffstr[i + 1].indexOf('+++ ') === 0 && diffstr[i + 2].indexOf('@@') === 0) {
|
761
|
+
break;
|
762
|
+
}
|
763
|
+
|
764
|
+
var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? ' ' : diffstr[i][0];
|
765
|
+
|
766
|
+
if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') {
|
767
|
+
hunk.lines.push(diffstr[i]);
|
768
|
+
hunk.linedelimiters.push(delimiters[i] || '\n');
|
769
|
+
|
770
|
+
if (operation === '+') {
|
771
|
+
addCount++;
|
772
|
+
} else if (operation === '-') {
|
773
|
+
removeCount++;
|
774
|
+
} else if (operation === ' ') {
|
775
|
+
addCount++;
|
776
|
+
removeCount++;
|
777
|
+
}
|
778
|
+
} else {
|
779
|
+
break;
|
780
|
+
}
|
781
|
+
} // Handle the empty block count case
|
782
|
+
|
783
|
+
|
784
|
+
if (!addCount && hunk.newLines === 1) {
|
785
|
+
hunk.newLines = 0;
|
786
|
+
}
|
787
|
+
|
788
|
+
if (!removeCount && hunk.oldLines === 1) {
|
789
|
+
hunk.oldLines = 0;
|
790
|
+
} // Perform optional sanity checking
|
791
|
+
|
792
|
+
|
793
|
+
if (options.strict) {
|
794
|
+
if (addCount !== hunk.newLines) {
|
795
|
+
throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
|
796
|
+
}
|
797
|
+
|
798
|
+
if (removeCount !== hunk.oldLines) {
|
799
|
+
throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
|
800
|
+
}
|
801
|
+
}
|
802
|
+
|
803
|
+
return hunk;
|
804
|
+
}
|
805
|
+
|
806
|
+
while (i < diffstr.length) {
|
807
|
+
parseIndex();
|
808
|
+
}
|
809
|
+
|
810
|
+
return list;
|
811
|
+
}
|
812
|
+
|
813
|
+
// Iterator that traverses in the range of [min, max], stepping
|
814
|
+
// by distance from a given start position. I.e. for [0, 4], with
|
815
|
+
// start of 2, this will iterate 2, 3, 1, 4, 0.
|
816
|
+
function distanceIterator (start, minLine, maxLine) {
|
817
|
+
var wantForward = true,
|
818
|
+
backwardExhausted = false,
|
819
|
+
forwardExhausted = false,
|
820
|
+
localOffset = 1;
|
821
|
+
return function iterator() {
|
822
|
+
if (wantForward && !forwardExhausted) {
|
823
|
+
if (backwardExhausted) {
|
824
|
+
localOffset++;
|
825
|
+
} else {
|
826
|
+
wantForward = false;
|
827
|
+
} // Check if trying to fit beyond text length, and if not, check it fits
|
828
|
+
// after offset location (or desired location on first iteration)
|
829
|
+
|
830
|
+
|
831
|
+
if (start + localOffset <= maxLine) {
|
832
|
+
return localOffset;
|
833
|
+
}
|
834
|
+
|
835
|
+
forwardExhausted = true;
|
836
|
+
}
|
837
|
+
|
838
|
+
if (!backwardExhausted) {
|
839
|
+
if (!forwardExhausted) {
|
840
|
+
wantForward = true;
|
841
|
+
} // Check if trying to fit before text beginning, and if not, check it fits
|
842
|
+
// before offset location
|
843
|
+
|
844
|
+
|
845
|
+
if (minLine <= start - localOffset) {
|
846
|
+
return -localOffset++;
|
847
|
+
}
|
848
|
+
|
849
|
+
backwardExhausted = true;
|
850
|
+
return iterator();
|
851
|
+
} // We tried to fit hunk before text beginning and beyond text length, then
|
852
|
+
// hunk can't fit on the text. Return undefined
|
853
|
+
|
854
|
+
};
|
855
|
+
}
|
856
|
+
|
857
|
+
function applyPatch(source, uniDiff) {
|
858
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
859
|
+
|
860
|
+
if (typeof uniDiff === 'string') {
|
861
|
+
uniDiff = parsePatch(uniDiff);
|
862
|
+
}
|
863
|
+
|
864
|
+
if (Array.isArray(uniDiff)) {
|
865
|
+
if (uniDiff.length > 1) {
|
866
|
+
throw new Error('applyPatch only works with a single input.');
|
867
|
+
}
|
868
|
+
|
869
|
+
uniDiff = uniDiff[0];
|
870
|
+
} // Apply the diff to the input
|
871
|
+
|
872
|
+
|
873
|
+
var lines = source.split(/\r\n|[\n\v\f\r\x85]/),
|
874
|
+
delimiters = source.match(/\r\n|[\n\v\f\r\x85]/g) || [],
|
875
|
+
hunks = uniDiff.hunks,
|
876
|
+
compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) {
|
877
|
+
return line === patchContent;
|
878
|
+
},
|
879
|
+
errorCount = 0,
|
880
|
+
fuzzFactor = options.fuzzFactor || 0,
|
881
|
+
minLine = 0,
|
882
|
+
offset = 0,
|
883
|
+
removeEOFNL,
|
884
|
+
addEOFNL;
|
885
|
+
/**
|
886
|
+
* Checks if the hunk exactly fits on the provided location
|
887
|
+
*/
|
888
|
+
|
889
|
+
|
890
|
+
function hunkFits(hunk, toPos) {
|
891
|
+
for (var j = 0; j < hunk.lines.length; j++) {
|
892
|
+
var line = hunk.lines[j],
|
893
|
+
operation = line.length > 0 ? line[0] : ' ',
|
894
|
+
content = line.length > 0 ? line.substr(1) : line;
|
895
|
+
|
896
|
+
if (operation === ' ' || operation === '-') {
|
897
|
+
// Context sanity check
|
898
|
+
if (!compareLine(toPos + 1, lines[toPos], operation, content)) {
|
899
|
+
errorCount++;
|
900
|
+
|
901
|
+
if (errorCount > fuzzFactor) {
|
902
|
+
return false;
|
903
|
+
}
|
904
|
+
}
|
905
|
+
|
906
|
+
toPos++;
|
907
|
+
}
|
908
|
+
}
|
909
|
+
|
910
|
+
return true;
|
911
|
+
} // Search best fit offsets for each hunk based on the previous ones
|
912
|
+
|
913
|
+
|
914
|
+
for (var i = 0; i < hunks.length; i++) {
|
915
|
+
var hunk = hunks[i],
|
916
|
+
maxLine = lines.length - hunk.oldLines,
|
917
|
+
localOffset = 0,
|
918
|
+
toPos = offset + hunk.oldStart - 1;
|
919
|
+
var iterator = distanceIterator(toPos, minLine, maxLine);
|
920
|
+
|
921
|
+
for (; localOffset !== undefined; localOffset = iterator()) {
|
922
|
+
if (hunkFits(hunk, toPos + localOffset)) {
|
923
|
+
hunk.offset = offset += localOffset;
|
924
|
+
break;
|
925
|
+
}
|
926
|
+
}
|
927
|
+
|
928
|
+
if (localOffset === undefined) {
|
929
|
+
return false;
|
930
|
+
} // Set lower text limit to end of the current hunk, so next ones don't try
|
931
|
+
// to fit over already patched text
|
932
|
+
|
933
|
+
|
934
|
+
minLine = hunk.offset + hunk.oldStart + hunk.oldLines;
|
935
|
+
} // Apply patch hunks
|
936
|
+
|
937
|
+
|
938
|
+
var diffOffset = 0;
|
939
|
+
|
940
|
+
for (var _i = 0; _i < hunks.length; _i++) {
|
941
|
+
var _hunk = hunks[_i],
|
942
|
+
_toPos = _hunk.oldStart + _hunk.offset + diffOffset - 1;
|
943
|
+
|
944
|
+
diffOffset += _hunk.newLines - _hunk.oldLines;
|
945
|
+
|
946
|
+
for (var j = 0; j < _hunk.lines.length; j++) {
|
947
|
+
var line = _hunk.lines[j],
|
948
|
+
operation = line.length > 0 ? line[0] : ' ',
|
949
|
+
content = line.length > 0 ? line.substr(1) : line,
|
950
|
+
delimiter = _hunk.linedelimiters && _hunk.linedelimiters[j] || '\n';
|
951
|
+
|
952
|
+
if (operation === ' ') {
|
953
|
+
_toPos++;
|
954
|
+
} else if (operation === '-') {
|
955
|
+
lines.splice(_toPos, 1);
|
956
|
+
delimiters.splice(_toPos, 1);
|
957
|
+
/* istanbul ignore else */
|
958
|
+
} else if (operation === '+') {
|
959
|
+
lines.splice(_toPos, 0, content);
|
960
|
+
delimiters.splice(_toPos, 0, delimiter);
|
961
|
+
_toPos++;
|
962
|
+
} else if (operation === '\\') {
|
963
|
+
var previousOperation = _hunk.lines[j - 1] ? _hunk.lines[j - 1][0] : null;
|
964
|
+
|
965
|
+
if (previousOperation === '+') {
|
966
|
+
removeEOFNL = true;
|
967
|
+
} else if (previousOperation === '-') {
|
968
|
+
addEOFNL = true;
|
969
|
+
}
|
970
|
+
}
|
971
|
+
}
|
972
|
+
} // Handle EOFNL insertion/removal
|
973
|
+
|
974
|
+
|
975
|
+
if (removeEOFNL) {
|
976
|
+
while (!lines[lines.length - 1]) {
|
977
|
+
lines.pop();
|
978
|
+
delimiters.pop();
|
979
|
+
}
|
980
|
+
} else if (addEOFNL) {
|
981
|
+
lines.push('');
|
982
|
+
delimiters.push('\n');
|
983
|
+
}
|
984
|
+
|
985
|
+
for (var _k = 0; _k < lines.length - 1; _k++) {
|
986
|
+
lines[_k] = lines[_k] + delimiters[_k];
|
987
|
+
}
|
988
|
+
|
989
|
+
return lines.join('');
|
990
|
+
} // Wrapper that supports multiple file patches via callbacks.
|
991
|
+
|
992
|
+
function applyPatches(uniDiff, options) {
|
993
|
+
if (typeof uniDiff === 'string') {
|
994
|
+
uniDiff = parsePatch(uniDiff);
|
995
|
+
}
|
996
|
+
|
997
|
+
var currentIndex = 0;
|
998
|
+
|
999
|
+
function processIndex() {
|
1000
|
+
var index = uniDiff[currentIndex++];
|
1001
|
+
|
1002
|
+
if (!index) {
|
1003
|
+
return options.complete();
|
1004
|
+
}
|
1005
|
+
|
1006
|
+
options.loadFile(index, function (err, data) {
|
1007
|
+
if (err) {
|
1008
|
+
return options.complete(err);
|
1009
|
+
}
|
1010
|
+
|
1011
|
+
var updatedContent = applyPatch(data, index, options);
|
1012
|
+
options.patched(index, updatedContent, function (err) {
|
1013
|
+
if (err) {
|
1014
|
+
return options.complete(err);
|
1015
|
+
}
|
1016
|
+
|
1017
|
+
processIndex();
|
1018
|
+
});
|
1019
|
+
});
|
1020
|
+
}
|
1021
|
+
|
1022
|
+
processIndex();
|
1023
|
+
}
|
1024
|
+
|
1025
|
+
function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
|
1026
|
+
if (!options) {
|
1027
|
+
options = {};
|
1028
|
+
}
|
1029
|
+
|
1030
|
+
if (typeof options.context === 'undefined') {
|
1031
|
+
options.context = 4;
|
1032
|
+
}
|
1033
|
+
|
1034
|
+
var diff = diffLines(oldStr, newStr, options);
|
1035
|
+
|
1036
|
+
if (!diff) {
|
1037
|
+
return;
|
1038
|
+
}
|
1039
|
+
|
1040
|
+
diff.push({
|
1041
|
+
value: '',
|
1042
|
+
lines: []
|
1043
|
+
}); // Append an empty value to make cleanup easier
|
1044
|
+
|
1045
|
+
function contextLines(lines) {
|
1046
|
+
return lines.map(function (entry) {
|
1047
|
+
return ' ' + entry;
|
1048
|
+
});
|
1049
|
+
}
|
1050
|
+
|
1051
|
+
var hunks = [];
|
1052
|
+
var oldRangeStart = 0,
|
1053
|
+
newRangeStart = 0,
|
1054
|
+
curRange = [],
|
1055
|
+
oldLine = 1,
|
1056
|
+
newLine = 1;
|
1057
|
+
|
1058
|
+
var _loop = function _loop(i) {
|
1059
|
+
var current = diff[i],
|
1060
|
+
lines = current.lines || current.value.replace(/\n$/, '').split('\n');
|
1061
|
+
current.lines = lines;
|
1062
|
+
|
1063
|
+
if (current.added || current.removed) {
|
1064
|
+
var _curRange;
|
1065
|
+
|
1066
|
+
// If we have previous context, start with that
|
1067
|
+
if (!oldRangeStart) {
|
1068
|
+
var prev = diff[i - 1];
|
1069
|
+
oldRangeStart = oldLine;
|
1070
|
+
newRangeStart = newLine;
|
1071
|
+
|
1072
|
+
if (prev) {
|
1073
|
+
curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : [];
|
1074
|
+
oldRangeStart -= curRange.length;
|
1075
|
+
newRangeStart -= curRange.length;
|
1076
|
+
}
|
1077
|
+
} // Output our changes
|
1078
|
+
|
1079
|
+
|
1080
|
+
(_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function (entry) {
|
1081
|
+
return (current.added ? '+' : '-') + entry;
|
1082
|
+
}))); // Track the updated file position
|
1083
|
+
|
1084
|
+
|
1085
|
+
if (current.added) {
|
1086
|
+
newLine += lines.length;
|
1087
|
+
} else {
|
1088
|
+
oldLine += lines.length;
|
1089
|
+
}
|
1090
|
+
} else {
|
1091
|
+
// Identical context lines. Track line changes
|
1092
|
+
if (oldRangeStart) {
|
1093
|
+
// Close out any changes that have been output (or join overlapping)
|
1094
|
+
if (lines.length <= options.context * 2 && i < diff.length - 2) {
|
1095
|
+
var _curRange2;
|
1096
|
+
|
1097
|
+
// Overlapping
|
1098
|
+
(_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines)));
|
1099
|
+
} else {
|
1100
|
+
var _curRange3;
|
1101
|
+
|
1102
|
+
// end the range and output
|
1103
|
+
var contextSize = Math.min(lines.length, options.context);
|
1104
|
+
|
1105
|
+
(_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize))));
|
1106
|
+
|
1107
|
+
var hunk = {
|
1108
|
+
oldStart: oldRangeStart,
|
1109
|
+
oldLines: oldLine - oldRangeStart + contextSize,
|
1110
|
+
newStart: newRangeStart,
|
1111
|
+
newLines: newLine - newRangeStart + contextSize,
|
1112
|
+
lines: curRange
|
1113
|
+
};
|
1114
|
+
|
1115
|
+
if (i >= diff.length - 2 && lines.length <= options.context) {
|
1116
|
+
// EOF is inside this hunk
|
1117
|
+
var oldEOFNewline = /\n$/.test(oldStr);
|
1118
|
+
var newEOFNewline = /\n$/.test(newStr);
|
1119
|
+
var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines;
|
1120
|
+
|
1121
|
+
if (!oldEOFNewline && noNlBeforeAdds && oldStr.length > 0) {
|
1122
|
+
// special case: old has no eol and no trailing context; no-nl can end up before adds
|
1123
|
+
// however, if the old file is empty, do not output the no-nl line
|
1124
|
+
curRange.splice(hunk.oldLines, 0, '\');
|
1125
|
+
}
|
1126
|
+
|
1127
|
+
if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) {
|
1128
|
+
curRange.push('\');
|
1129
|
+
}
|
1130
|
+
}
|
1131
|
+
|
1132
|
+
hunks.push(hunk);
|
1133
|
+
oldRangeStart = 0;
|
1134
|
+
newRangeStart = 0;
|
1135
|
+
curRange = [];
|
1136
|
+
}
|
1137
|
+
}
|
1138
|
+
|
1139
|
+
oldLine += lines.length;
|
1140
|
+
newLine += lines.length;
|
1141
|
+
}
|
1142
|
+
};
|
1143
|
+
|
1144
|
+
for (var i = 0; i < diff.length; i++) {
|
1145
|
+
_loop(i);
|
1146
|
+
}
|
1147
|
+
|
1148
|
+
return {
|
1149
|
+
oldFileName: oldFileName,
|
1150
|
+
newFileName: newFileName,
|
1151
|
+
oldHeader: oldHeader,
|
1152
|
+
newHeader: newHeader,
|
1153
|
+
hunks: hunks
|
1154
|
+
};
|
1155
|
+
}
|
1156
|
+
function formatPatch(diff) {
|
1157
|
+
if (Array.isArray(diff)) {
|
1158
|
+
return diff.map(formatPatch).join('\n');
|
1159
|
+
}
|
1160
|
+
|
1161
|
+
var ret = [];
|
1162
|
+
|
1163
|
+
if (diff.oldFileName == diff.newFileName) {
|
1164
|
+
ret.push('Index: ' + diff.oldFileName);
|
1165
|
+
}
|
1166
|
+
|
1167
|
+
ret.push('===================================================================');
|
1168
|
+
ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader));
|
1169
|
+
ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader));
|
1170
|
+
|
1171
|
+
for (var i = 0; i < diff.hunks.length; i++) {
|
1172
|
+
var hunk = diff.hunks[i]; // Unified Diff Format quirk: If the chunk size is 0,
|
1173
|
+
// the first number is one lower than one would expect.
|
1174
|
+
// https://www.artima.com/weblogs/viewpost.jsp?thread=164293
|
1175
|
+
|
1176
|
+
if (hunk.oldLines === 0) {
|
1177
|
+
hunk.oldStart -= 1;
|
1178
|
+
}
|
1179
|
+
|
1180
|
+
if (hunk.newLines === 0) {
|
1181
|
+
hunk.newStart -= 1;
|
1182
|
+
}
|
1183
|
+
|
1184
|
+
ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@');
|
1185
|
+
ret.push.apply(ret, hunk.lines);
|
1186
|
+
}
|
1187
|
+
|
1188
|
+
return ret.join('\n') + '\n';
|
1189
|
+
}
|
1190
|
+
function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
|
1191
|
+
return formatPatch(structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options));
|
1192
|
+
}
|
1193
|
+
function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {
|
1194
|
+
return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);
|
1195
|
+
}
|
1196
|
+
|
1197
|
+
function arrayEqual(a, b) {
|
1198
|
+
if (a.length !== b.length) {
|
1199
|
+
return false;
|
1200
|
+
}
|
1201
|
+
|
1202
|
+
return arrayStartsWith(a, b);
|
1203
|
+
}
|
1204
|
+
function arrayStartsWith(array, start) {
|
1205
|
+
if (start.length > array.length) {
|
1206
|
+
return false;
|
1207
|
+
}
|
1208
|
+
|
1209
|
+
for (var i = 0; i < start.length; i++) {
|
1210
|
+
if (start[i] !== array[i]) {
|
1211
|
+
return false;
|
1212
|
+
}
|
1213
|
+
}
|
1214
|
+
|
1215
|
+
return true;
|
1216
|
+
}
|
1217
|
+
|
1218
|
+
function calcLineCount(hunk) {
|
1219
|
+
var _calcOldNewLineCount = calcOldNewLineCount(hunk.lines),
|
1220
|
+
oldLines = _calcOldNewLineCount.oldLines,
|
1221
|
+
newLines = _calcOldNewLineCount.newLines;
|
1222
|
+
|
1223
|
+
if (oldLines !== undefined) {
|
1224
|
+
hunk.oldLines = oldLines;
|
1225
|
+
} else {
|
1226
|
+
delete hunk.oldLines;
|
1227
|
+
}
|
1228
|
+
|
1229
|
+
if (newLines !== undefined) {
|
1230
|
+
hunk.newLines = newLines;
|
1231
|
+
} else {
|
1232
|
+
delete hunk.newLines;
|
1233
|
+
}
|
1234
|
+
}
|
1235
|
+
function merge(mine, theirs, base) {
|
1236
|
+
mine = loadPatch(mine, base);
|
1237
|
+
theirs = loadPatch(theirs, base);
|
1238
|
+
var ret = {}; // For index we just let it pass through as it doesn't have any necessary meaning.
|
1239
|
+
// Leaving sanity checks on this to the API consumer that may know more about the
|
1240
|
+
// meaning in their own context.
|
1241
|
+
|
1242
|
+
if (mine.index || theirs.index) {
|
1243
|
+
ret.index = mine.index || theirs.index;
|
1244
|
+
}
|
1245
|
+
|
1246
|
+
if (mine.newFileName || theirs.newFileName) {
|
1247
|
+
if (!fileNameChanged(mine)) {
|
1248
|
+
// No header or no change in ours, use theirs (and ours if theirs does not exist)
|
1249
|
+
ret.oldFileName = theirs.oldFileName || mine.oldFileName;
|
1250
|
+
ret.newFileName = theirs.newFileName || mine.newFileName;
|
1251
|
+
ret.oldHeader = theirs.oldHeader || mine.oldHeader;
|
1252
|
+
ret.newHeader = theirs.newHeader || mine.newHeader;
|
1253
|
+
} else if (!fileNameChanged(theirs)) {
|
1254
|
+
// No header or no change in theirs, use ours
|
1255
|
+
ret.oldFileName = mine.oldFileName;
|
1256
|
+
ret.newFileName = mine.newFileName;
|
1257
|
+
ret.oldHeader = mine.oldHeader;
|
1258
|
+
ret.newHeader = mine.newHeader;
|
1259
|
+
} else {
|
1260
|
+
// Both changed... figure it out
|
1261
|
+
ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName);
|
1262
|
+
ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName);
|
1263
|
+
ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader);
|
1264
|
+
ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader);
|
1265
|
+
}
|
1266
|
+
}
|
1267
|
+
|
1268
|
+
ret.hunks = [];
|
1269
|
+
var mineIndex = 0,
|
1270
|
+
theirsIndex = 0,
|
1271
|
+
mineOffset = 0,
|
1272
|
+
theirsOffset = 0;
|
1273
|
+
|
1274
|
+
while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) {
|
1275
|
+
var mineCurrent = mine.hunks[mineIndex] || {
|
1276
|
+
oldStart: Infinity
|
1277
|
+
},
|
1278
|
+
theirsCurrent = theirs.hunks[theirsIndex] || {
|
1279
|
+
oldStart: Infinity
|
1280
|
+
};
|
1281
|
+
|
1282
|
+
if (hunkBefore(mineCurrent, theirsCurrent)) {
|
1283
|
+
// This patch does not overlap with any of the others, yay.
|
1284
|
+
ret.hunks.push(cloneHunk(mineCurrent, mineOffset));
|
1285
|
+
mineIndex++;
|
1286
|
+
theirsOffset += mineCurrent.newLines - mineCurrent.oldLines;
|
1287
|
+
} else if (hunkBefore(theirsCurrent, mineCurrent)) {
|
1288
|
+
// This patch does not overlap with any of the others, yay.
|
1289
|
+
ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset));
|
1290
|
+
theirsIndex++;
|
1291
|
+
mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines;
|
1292
|
+
} else {
|
1293
|
+
// Overlap, merge as best we can
|
1294
|
+
var mergedHunk = {
|
1295
|
+
oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart),
|
1296
|
+
oldLines: 0,
|
1297
|
+
newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset),
|
1298
|
+
newLines: 0,
|
1299
|
+
lines: []
|
1300
|
+
};
|
1301
|
+
mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines);
|
1302
|
+
theirsIndex++;
|
1303
|
+
mineIndex++;
|
1304
|
+
ret.hunks.push(mergedHunk);
|
1305
|
+
}
|
1306
|
+
}
|
1307
|
+
|
1308
|
+
return ret;
|
1309
|
+
}
|
1310
|
+
|
1311
|
+
function loadPatch(param, base) {
|
1312
|
+
if (typeof param === 'string') {
|
1313
|
+
if (/^@@/m.test(param) || /^Index:/m.test(param)) {
|
1314
|
+
return parsePatch(param)[0];
|
1315
|
+
}
|
1316
|
+
|
1317
|
+
if (!base) {
|
1318
|
+
throw new Error('Must provide a base reference or pass in a patch');
|
1319
|
+
}
|
1320
|
+
|
1321
|
+
return structuredPatch(undefined, undefined, base, param);
|
1322
|
+
}
|
1323
|
+
|
1324
|
+
return param;
|
1325
|
+
}
|
1326
|
+
|
1327
|
+
function fileNameChanged(patch) {
|
1328
|
+
return patch.newFileName && patch.newFileName !== patch.oldFileName;
|
1329
|
+
}
|
1330
|
+
|
1331
|
+
function selectField(index, mine, theirs) {
|
1332
|
+
if (mine === theirs) {
|
1333
|
+
return mine;
|
1334
|
+
} else {
|
1335
|
+
index.conflict = true;
|
1336
|
+
return {
|
1337
|
+
mine: mine,
|
1338
|
+
theirs: theirs
|
1339
|
+
};
|
1340
|
+
}
|
1341
|
+
}
|
1342
|
+
|
1343
|
+
function hunkBefore(test, check) {
|
1344
|
+
return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart;
|
1345
|
+
}
|
1346
|
+
|
1347
|
+
function cloneHunk(hunk, offset) {
|
1348
|
+
return {
|
1349
|
+
oldStart: hunk.oldStart,
|
1350
|
+
oldLines: hunk.oldLines,
|
1351
|
+
newStart: hunk.newStart + offset,
|
1352
|
+
newLines: hunk.newLines,
|
1353
|
+
lines: hunk.lines
|
1354
|
+
};
|
1355
|
+
}
|
1356
|
+
|
1357
|
+
function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) {
|
1358
|
+
// This will generally result in a conflicted hunk, but there are cases where the context
|
1359
|
+
// is the only overlap where we can successfully merge the content here.
|
1360
|
+
var mine = {
|
1361
|
+
offset: mineOffset,
|
1362
|
+
lines: mineLines,
|
1363
|
+
index: 0
|
1364
|
+
},
|
1365
|
+
their = {
|
1366
|
+
offset: theirOffset,
|
1367
|
+
lines: theirLines,
|
1368
|
+
index: 0
|
1369
|
+
}; // Handle any leading content
|
1370
|
+
|
1371
|
+
insertLeading(hunk, mine, their);
|
1372
|
+
insertLeading(hunk, their, mine); // Now in the overlap content. Scan through and select the best changes from each.
|
1373
|
+
|
1374
|
+
while (mine.index < mine.lines.length && their.index < their.lines.length) {
|
1375
|
+
var mineCurrent = mine.lines[mine.index],
|
1376
|
+
theirCurrent = their.lines[their.index];
|
1377
|
+
|
1378
|
+
if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) {
|
1379
|
+
// Both modified ...
|
1380
|
+
mutualChange(hunk, mine, their);
|
1381
|
+
} else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') {
|
1382
|
+
var _hunk$lines;
|
1383
|
+
|
1384
|
+
// Mine inserted
|
1385
|
+
(_hunk$lines = hunk.lines).push.apply(_hunk$lines, _toConsumableArray(collectChange(mine)));
|
1386
|
+
} else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') {
|
1387
|
+
var _hunk$lines2;
|
1388
|
+
|
1389
|
+
// Theirs inserted
|
1390
|
+
(_hunk$lines2 = hunk.lines).push.apply(_hunk$lines2, _toConsumableArray(collectChange(their)));
|
1391
|
+
} else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') {
|
1392
|
+
// Mine removed or edited
|
1393
|
+
removal(hunk, mine, their);
|
1394
|
+
} else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') {
|
1395
|
+
// Their removed or edited
|
1396
|
+
removal(hunk, their, mine, true);
|
1397
|
+
} else if (mineCurrent === theirCurrent) {
|
1398
|
+
// Context identity
|
1399
|
+
hunk.lines.push(mineCurrent);
|
1400
|
+
mine.index++;
|
1401
|
+
their.index++;
|
1402
|
+
} else {
|
1403
|
+
// Context mismatch
|
1404
|
+
conflict(hunk, collectChange(mine), collectChange(their));
|
1405
|
+
}
|
1406
|
+
} // Now push anything that may be remaining
|
1407
|
+
|
1408
|
+
|
1409
|
+
insertTrailing(hunk, mine);
|
1410
|
+
insertTrailing(hunk, their);
|
1411
|
+
calcLineCount(hunk);
|
1412
|
+
}
|
1413
|
+
|
1414
|
+
function mutualChange(hunk, mine, their) {
|
1415
|
+
var myChanges = collectChange(mine),
|
1416
|
+
theirChanges = collectChange(their);
|
1417
|
+
|
1418
|
+
if (allRemoves(myChanges) && allRemoves(theirChanges)) {
|
1419
|
+
// Special case for remove changes that are supersets of one another
|
1420
|
+
if (arrayStartsWith(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) {
|
1421
|
+
var _hunk$lines3;
|
1422
|
+
|
1423
|
+
(_hunk$lines3 = hunk.lines).push.apply(_hunk$lines3, _toConsumableArray(myChanges));
|
1424
|
+
|
1425
|
+
return;
|
1426
|
+
} else if (arrayStartsWith(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) {
|
1427
|
+
var _hunk$lines4;
|
1428
|
+
|
1429
|
+
(_hunk$lines4 = hunk.lines).push.apply(_hunk$lines4, _toConsumableArray(theirChanges));
|
1430
|
+
|
1431
|
+
return;
|
1432
|
+
}
|
1433
|
+
} else if (arrayEqual(myChanges, theirChanges)) {
|
1434
|
+
var _hunk$lines5;
|
1435
|
+
|
1436
|
+
(_hunk$lines5 = hunk.lines).push.apply(_hunk$lines5, _toConsumableArray(myChanges));
|
1437
|
+
|
1438
|
+
return;
|
1439
|
+
}
|
1440
|
+
|
1441
|
+
conflict(hunk, myChanges, theirChanges);
|
1442
|
+
}
|
1443
|
+
|
1444
|
+
function removal(hunk, mine, their, swap) {
|
1445
|
+
var myChanges = collectChange(mine),
|
1446
|
+
theirChanges = collectContext(their, myChanges);
|
1447
|
+
|
1448
|
+
if (theirChanges.merged) {
|
1449
|
+
var _hunk$lines6;
|
1450
|
+
|
1451
|
+
(_hunk$lines6 = hunk.lines).push.apply(_hunk$lines6, _toConsumableArray(theirChanges.merged));
|
1452
|
+
} else {
|
1453
|
+
conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges);
|
1454
|
+
}
|
1455
|
+
}
|
1456
|
+
|
1457
|
+
function conflict(hunk, mine, their) {
|
1458
|
+
hunk.conflict = true;
|
1459
|
+
hunk.lines.push({
|
1460
|
+
conflict: true,
|
1461
|
+
mine: mine,
|
1462
|
+
theirs: their
|
1463
|
+
});
|
1464
|
+
}
|
1465
|
+
|
1466
|
+
function insertLeading(hunk, insert, their) {
|
1467
|
+
while (insert.offset < their.offset && insert.index < insert.lines.length) {
|
1468
|
+
var line = insert.lines[insert.index++];
|
1469
|
+
hunk.lines.push(line);
|
1470
|
+
insert.offset++;
|
1471
|
+
}
|
1472
|
+
}
|
1473
|
+
|
1474
|
+
function insertTrailing(hunk, insert) {
|
1475
|
+
while (insert.index < insert.lines.length) {
|
1476
|
+
var line = insert.lines[insert.index++];
|
1477
|
+
hunk.lines.push(line);
|
1478
|
+
}
|
1479
|
+
}
|
1480
|
+
|
1481
|
+
function collectChange(state) {
|
1482
|
+
var ret = [],
|
1483
|
+
operation = state.lines[state.index][0];
|
1484
|
+
|
1485
|
+
while (state.index < state.lines.length) {
|
1486
|
+
var line = state.lines[state.index]; // Group additions that are immediately after subtractions and treat them as one "atomic" modify change.
|
1487
|
+
|
1488
|
+
if (operation === '-' && line[0] === '+') {
|
1489
|
+
operation = '+';
|
1490
|
+
}
|
1491
|
+
|
1492
|
+
if (operation === line[0]) {
|
1493
|
+
ret.push(line);
|
1494
|
+
state.index++;
|
1495
|
+
} else {
|
1496
|
+
break;
|
1497
|
+
}
|
1498
|
+
}
|
1499
|
+
|
1500
|
+
return ret;
|
1501
|
+
}
|
1502
|
+
|
1503
|
+
function collectContext(state, matchChanges) {
|
1504
|
+
var changes = [],
|
1505
|
+
merged = [],
|
1506
|
+
matchIndex = 0,
|
1507
|
+
contextChanges = false,
|
1508
|
+
conflicted = false;
|
1509
|
+
|
1510
|
+
while (matchIndex < matchChanges.length && state.index < state.lines.length) {
|
1511
|
+
var change = state.lines[state.index],
|
1512
|
+
match = matchChanges[matchIndex]; // Once we've hit our add, then we are done
|
1513
|
+
|
1514
|
+
if (match[0] === '+') {
|
1515
|
+
break;
|
1516
|
+
}
|
1517
|
+
|
1518
|
+
contextChanges = contextChanges || change[0] !== ' ';
|
1519
|
+
merged.push(match);
|
1520
|
+
matchIndex++; // Consume any additions in the other block as a conflict to attempt
|
1521
|
+
// to pull in the remaining context after this
|
1522
|
+
|
1523
|
+
if (change[0] === '+') {
|
1524
|
+
conflicted = true;
|
1525
|
+
|
1526
|
+
while (change[0] === '+') {
|
1527
|
+
changes.push(change);
|
1528
|
+
change = state.lines[++state.index];
|
1529
|
+
}
|
1530
|
+
}
|
1531
|
+
|
1532
|
+
if (match.substr(1) === change.substr(1)) {
|
1533
|
+
changes.push(change);
|
1534
|
+
state.index++;
|
1535
|
+
} else {
|
1536
|
+
conflicted = true;
|
1537
|
+
}
|
1538
|
+
}
|
1539
|
+
|
1540
|
+
if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) {
|
1541
|
+
conflicted = true;
|
1542
|
+
}
|
1543
|
+
|
1544
|
+
if (conflicted) {
|
1545
|
+
return changes;
|
1546
|
+
}
|
1547
|
+
|
1548
|
+
while (matchIndex < matchChanges.length) {
|
1549
|
+
merged.push(matchChanges[matchIndex++]);
|
1550
|
+
}
|
1551
|
+
|
1552
|
+
return {
|
1553
|
+
merged: merged,
|
1554
|
+
changes: changes
|
1555
|
+
};
|
1556
|
+
}
|
1557
|
+
|
1558
|
+
function allRemoves(changes) {
|
1559
|
+
return changes.reduce(function (prev, change) {
|
1560
|
+
return prev && change[0] === '-';
|
1561
|
+
}, true);
|
1562
|
+
}
|
1563
|
+
|
1564
|
+
function skipRemoveSuperset(state, removeChanges, delta) {
|
1565
|
+
for (var i = 0; i < delta; i++) {
|
1566
|
+
var changeContent = removeChanges[removeChanges.length - delta + i].substr(1);
|
1567
|
+
|
1568
|
+
if (state.lines[state.index + i] !== ' ' + changeContent) {
|
1569
|
+
return false;
|
1570
|
+
}
|
1571
|
+
}
|
1572
|
+
|
1573
|
+
state.index += delta;
|
1574
|
+
return true;
|
1575
|
+
}
|
1576
|
+
|
1577
|
+
function calcOldNewLineCount(lines) {
|
1578
|
+
var oldLines = 0;
|
1579
|
+
var newLines = 0;
|
1580
|
+
lines.forEach(function (line) {
|
1581
|
+
if (typeof line !== 'string') {
|
1582
|
+
var myCount = calcOldNewLineCount(line.mine);
|
1583
|
+
var theirCount = calcOldNewLineCount(line.theirs);
|
1584
|
+
|
1585
|
+
if (oldLines !== undefined) {
|
1586
|
+
if (myCount.oldLines === theirCount.oldLines) {
|
1587
|
+
oldLines += myCount.oldLines;
|
1588
|
+
} else {
|
1589
|
+
oldLines = undefined;
|
1590
|
+
}
|
1591
|
+
}
|
1592
|
+
|
1593
|
+
if (newLines !== undefined) {
|
1594
|
+
if (myCount.newLines === theirCount.newLines) {
|
1595
|
+
newLines += myCount.newLines;
|
1596
|
+
} else {
|
1597
|
+
newLines = undefined;
|
1598
|
+
}
|
1599
|
+
}
|
1600
|
+
} else {
|
1601
|
+
if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) {
|
1602
|
+
newLines++;
|
1603
|
+
}
|
1604
|
+
|
1605
|
+
if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) {
|
1606
|
+
oldLines++;
|
1607
|
+
}
|
1608
|
+
}
|
1609
|
+
});
|
1610
|
+
return {
|
1611
|
+
oldLines: oldLines,
|
1612
|
+
newLines: newLines
|
1613
|
+
};
|
1614
|
+
}
|
1615
|
+
|
1616
|
+
function reversePatch(structuredPatch) {
|
1617
|
+
if (Array.isArray(structuredPatch)) {
|
1618
|
+
return structuredPatch.map(reversePatch).reverse();
|
1619
|
+
}
|
1620
|
+
|
1621
|
+
return _objectSpread2(_objectSpread2({}, structuredPatch), {}, {
|
1622
|
+
oldFileName: structuredPatch.newFileName,
|
1623
|
+
oldHeader: structuredPatch.newHeader,
|
1624
|
+
newFileName: structuredPatch.oldFileName,
|
1625
|
+
newHeader: structuredPatch.oldHeader,
|
1626
|
+
hunks: structuredPatch.hunks.map(function (hunk) {
|
1627
|
+
return {
|
1628
|
+
oldLines: hunk.newLines,
|
1629
|
+
oldStart: hunk.newStart,
|
1630
|
+
newLines: hunk.oldLines,
|
1631
|
+
newStart: hunk.oldStart,
|
1632
|
+
linedelimiters: hunk.linedelimiters,
|
1633
|
+
lines: hunk.lines.map(function (l) {
|
1634
|
+
if (l.startsWith('-')) {
|
1635
|
+
return "+".concat(l.slice(1));
|
1636
|
+
}
|
1637
|
+
|
1638
|
+
if (l.startsWith('+')) {
|
1639
|
+
return "-".concat(l.slice(1));
|
1640
|
+
}
|
1641
|
+
|
1642
|
+
return l;
|
1643
|
+
})
|
1644
|
+
};
|
1645
|
+
})
|
1646
|
+
});
|
1647
|
+
}
|
1648
|
+
|
1649
|
+
// See: http://code.google.com/p/google-diff-match-patch/wiki/API
|
1650
|
+
function convertChangesToDMP(changes) {
|
1651
|
+
var ret = [],
|
1652
|
+
change,
|
1653
|
+
operation;
|
1654
|
+
|
1655
|
+
for (var i = 0; i < changes.length; i++) {
|
1656
|
+
change = changes[i];
|
1657
|
+
|
1658
|
+
if (change.added) {
|
1659
|
+
operation = 1;
|
1660
|
+
} else if (change.removed) {
|
1661
|
+
operation = -1;
|
1662
|
+
} else {
|
1663
|
+
operation = 0;
|
1664
|
+
}
|
1665
|
+
|
1666
|
+
ret.push([operation, change.value]);
|
1667
|
+
}
|
1668
|
+
|
1669
|
+
return ret;
|
1670
|
+
}
|
1671
|
+
|
1672
|
+
function convertChangesToXML(changes) {
|
1673
|
+
var ret = [];
|
1674
|
+
|
1675
|
+
for (var i = 0; i < changes.length; i++) {
|
1676
|
+
var change = changes[i];
|
1677
|
+
|
1678
|
+
if (change.added) {
|
1679
|
+
ret.push('<ins>');
|
1680
|
+
} else if (change.removed) {
|
1681
|
+
ret.push('<del>');
|
1682
|
+
}
|
1683
|
+
|
1684
|
+
ret.push(escapeHTML(change.value));
|
1685
|
+
|
1686
|
+
if (change.added) {
|
1687
|
+
ret.push('</ins>');
|
1688
|
+
} else if (change.removed) {
|
1689
|
+
ret.push('</del>');
|
1690
|
+
}
|
1691
|
+
}
|
1692
|
+
|
1693
|
+
return ret.join('');
|
1694
|
+
}
|
1695
|
+
|
1696
|
+
function escapeHTML(s) {
|
1697
|
+
var n = s;
|
1698
|
+
n = n.replace(/&/g, '&');
|
1699
|
+
n = n.replace(/</g, '<');
|
1700
|
+
n = n.replace(/>/g, '>');
|
1701
|
+
n = n.replace(/"/g, '"');
|
1702
|
+
return n;
|
1703
|
+
}
|
1704
|
+
|
1705
|
+
exports.Diff = Diff;
|
1706
|
+
exports.applyPatch = applyPatch;
|
1707
|
+
exports.applyPatches = applyPatches;
|
1708
|
+
exports.canonicalize = canonicalize;
|
1709
|
+
exports.convertChangesToDMP = convertChangesToDMP;
|
1710
|
+
exports.convertChangesToXML = convertChangesToXML;
|
1711
|
+
exports.createPatch = createPatch;
|
1712
|
+
exports.createTwoFilesPatch = createTwoFilesPatch;
|
1713
|
+
exports.diffArrays = diffArrays;
|
1714
|
+
exports.diffChars = diffChars;
|
1715
|
+
exports.diffCss = diffCss;
|
1716
|
+
exports.diffJson = diffJson;
|
1717
|
+
exports.diffLines = diffLines;
|
1718
|
+
exports.diffSentences = diffSentences;
|
1719
|
+
exports.diffTrimmedLines = diffTrimmedLines;
|
1720
|
+
exports.diffWords = diffWords;
|
1721
|
+
exports.diffWordsWithSpace = diffWordsWithSpace;
|
1722
|
+
exports.formatPatch = formatPatch;
|
1723
|
+
exports.merge = merge;
|
1724
|
+
exports.parsePatch = parsePatch;
|
1725
|
+
exports.reversePatch = reversePatch;
|
1726
|
+
exports.structuredPatch = structuredPatch;
|
1727
|
+
|
1728
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
1729
|
+
|
1730
|
+
})));
|