@fluidframework/runtime-utils 2.0.0-rc.2.0.2 → 2.0.0-rc.3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/api-report/runtime-utils.api.md +10 -10
- package/dist/dataStoreHelpers.d.ts +2 -2
- package/dist/dataStoreHelpers.d.ts.map +1 -1
- package/dist/dataStoreHelpers.js +7 -7
- package/dist/dataStoreHelpers.js.map +1 -1
- package/dist/legacy.d.ts +18 -0
- package/dist/objectstoragepartition.js +2 -2
- package/dist/objectstoragepartition.js.map +1 -1
- package/dist/public.d.ts +12 -0
- package/dist/requestParser.d.ts.map +1 -1
- package/dist/requestParser.js +4 -0
- package/dist/requestParser.js.map +1 -1
- package/dist/runtimeFactoryHelper.d.ts +2 -2
- package/dist/runtimeFactoryHelper.d.ts.map +1 -1
- package/dist/runtimeFactoryHelper.js.map +1 -1
- package/dist/summaryUtils.d.ts +4 -3
- package/dist/summaryUtils.d.ts.map +1 -1
- package/dist/summaryUtils.js +7 -7
- package/dist/summaryUtils.js.map +1 -1
- package/dist/unpackUsedRoutes.js +2 -2
- package/dist/unpackUsedRoutes.js.map +1 -1
- package/dist/utils.js +2 -2
- package/dist/utils.js.map +1 -1
- package/internal.d.ts +11 -0
- package/legacy.d.ts +11 -0
- package/lib/dataStoreHelpers.d.ts +2 -2
- package/lib/dataStoreHelpers.d.ts.map +1 -1
- package/lib/dataStoreHelpers.js +3 -3
- package/lib/dataStoreHelpers.js.map +1 -1
- package/lib/legacy.d.ts +18 -0
- package/lib/objectstoragepartition.js +1 -1
- package/lib/objectstoragepartition.js.map +1 -1
- package/lib/public.d.ts +12 -0
- package/lib/requestParser.d.ts.map +1 -1
- package/lib/requestParser.js +4 -0
- package/lib/requestParser.js.map +1 -1
- package/lib/runtimeFactoryHelper.d.ts +2 -2
- package/lib/runtimeFactoryHelper.d.ts.map +1 -1
- package/lib/runtimeFactoryHelper.js.map +1 -1
- package/lib/summaryUtils.d.ts +4 -3
- package/lib/summaryUtils.d.ts.map +1 -1
- package/lib/summaryUtils.js +3 -3
- package/lib/summaryUtils.js.map +1 -1
- package/lib/unpackUsedRoutes.js +1 -1
- package/lib/unpackUsedRoutes.js.map +1 -1
- package/lib/utils.js +1 -1
- package/lib/utils.js.map +1 -1
- package/package.json +33 -54
- package/src/dataStoreHelpers.ts +4 -4
- package/src/objectstoragepartition.ts +1 -1
- package/src/requestParser.ts +1 -0
- package/src/runtimeFactoryHelper.ts +2 -2
- package/src/summaryUtils.ts +16 -12
- package/src/unpackUsedRoutes.ts +1 -1
- package/src/utils.ts +1 -1
- package/api-extractor-cjs.json +0 -8
- package/dist/runtime-utils-alpha.d.ts +0 -161
- package/dist/runtime-utils-beta.d.ts +0 -109
- package/dist/runtime-utils-public.d.ts +0 -109
- package/dist/runtime-utils-untrimmed.d.ts +0 -346
- package/lib/runtime-utils-alpha.d.ts +0 -161
- package/lib/runtime-utils-beta.d.ts +0 -109
- package/lib/runtime-utils-public.d.ts +0 -109
- package/lib/runtime-utils-untrimmed.d.ts +0 -346
- package/lib/test/dataStoreHelpers.spec.js +0 -29
- package/lib/test/dataStoreHelpers.spec.js.map +0 -1
- package/lib/test/requestParser.spec.js +0 -111
- package/lib/test/requestParser.spec.js.map +0 -1
- package/lib/test/runtimeFactoryHelper.spec.js +0 -44
- package/lib/test/runtimeFactoryHelper.spec.js.map +0 -1
- package/lib/test/summaryUtils.spec.js +0 -283
- package/lib/test/summaryUtils.spec.js.map +0 -1
- package/lib/test/types/validateRuntimeUtilsPrevious.generated.js +0 -58
- package/lib/test/types/validateRuntimeUtilsPrevious.generated.js.map +0 -1
- package/lib/test/utils.spec.js +0 -65
- package/lib/test/utils.spec.js.map +0 -1
- /package/{dist → lib}/tsdoc-metadata.json +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validateRuntimeUtilsPrevious.generated.js","sourceRoot":"","sources":["../../../src/test/types/validateRunt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AC;AAW3D,2CAA2C,CACvC,uCAAuC,EAAE,CAAC,CAAC;AAW/C,uCAAuC,CACnC,2CAA2C,EAAE,CAAC,CAAC;AAWnD,0DAA0D,CACtD,sDAAsD,EAAE,CAAC,CAAC;AAW9D,sDAAsD,CAClD,0DAA0D,EAAE,CAAC,CAAC;AAWlE,8CAA8C,CAC1C,0CAA0C,EAAE,CAAC,CAAC;AAWlD,0CAA0C,CACtC,8CAA8C,EAAE,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/*\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n * Generated by fluid-type-test-generator in @fluidframework/build-tools.\n */\nimport type * as old from \"@fluidframework/runtime-utils-previous\";\nimport type * as current from \"../../index.js\";\n\n\n// See 'build-tools/src/type-test-generator/compatibility.ts' for more information.\ntype TypeOnly<T> = T extends number\n\t? number\n\t: T extends string\n\t? string\n\t: T extends boolean | bigint | symbol\n\t? T\n\t: {\n\t\t\t[P in keyof T]: TypeOnly<T[P]>;\n\t };\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"TypeAliasDeclaration_Factory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_TypeAliasDeclaration_Factory():\n TypeOnly<old.Factory>;\ndeclare function use_current_TypeAliasDeclaration_Factory(\n use: TypeOnly<current.Factory>): void;\nuse_current_TypeAliasDeclaration_Factory(\n get_old_TypeAliasDeclaration_Factory());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"TypeAliasDeclaration_Factory\": {\"backCompat\": false}\n*/\ndeclare function get_current_TypeAliasDeclaration_Factory():\n TypeOnly<current.Factory>;\ndeclare function use_old_TypeAliasDeclaration_Factory(\n use: TypeOnly<old.Factory>): void;\nuse_old_TypeAliasDeclaration_Factory(\n get_current_TypeAliasDeclaration_Factory());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_GCDataBuilder\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_GCDataBuilder():\n TypeOnly<old.GCDataBuilder>;\ndeclare function use_current_ClassDeclaration_GCDataBuilder(\n use: TypeOnly<current.GCDataBuilder>): void;\nuse_current_ClassDeclaration_GCDataBuilder(\n get_old_ClassDeclaration_GCDataBuilder());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_GCDataBuilder\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_GCDataBuilder():\n TypeOnly<current.GCDataBuilder>;\ndeclare function use_old_ClassDeclaration_GCDataBuilder(\n use: TypeOnly<old.GCDataBuilder>): void;\nuse_old_ClassDeclaration_GCDataBuilder(\n get_current_ClassDeclaration_GCDataBuilder());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ObjectStoragePartition\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_ObjectStoragePartition():\n TypeOnly<old.ObjectStoragePartition>;\ndeclare function use_current_ClassDeclaration_ObjectStoragePartition(\n use: TypeOnly<current.ObjectStoragePartition>): void;\nuse_current_ClassDeclaration_ObjectStoragePartition(\n get_old_ClassDeclaration_ObjectStoragePartition());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ObjectStoragePartition\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_ObjectStoragePartition():\n TypeOnly<current.ObjectStoragePartition>;\ndeclare function use_old_ClassDeclaration_ObjectStoragePartition(\n use: TypeOnly<old.ObjectStoragePartition>): void;\nuse_old_ClassDeclaration_ObjectStoragePartition(\n get_current_ClassDeclaration_ObjectStoragePartition());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"TypeAliasDeclaration_ReadAndParseBlob\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_TypeAliasDeclaration_ReadAndParseBlob():\n TypeOnly<old.ReadAndParseBlob>;\ndeclare function use_current_TypeAliasDeclaration_ReadAndParseBlob(\n use: TypeOnly<current.ReadAndParseBlob>): void;\nuse_current_TypeAliasDeclaration_ReadAndParseBlob(\n get_old_TypeAliasDeclaration_ReadAndParseBlob());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"TypeAliasDeclaration_ReadAndParseBlob\": {\"backCompat\": false}\n*/\ndeclare function get_current_TypeAliasDeclaration_ReadAndParseBlob():\n TypeOnly<current.ReadAndParseBlob>;\ndeclare function use_old_TypeAliasDeclaration_ReadAndParseBlob(\n use: TypeOnly<old.ReadAndParseBlob>): void;\nuse_old_TypeAliasDeclaration_ReadAndParseBlob(\n get_current_TypeAliasDeclaration_ReadAndParseBlob());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_RequestParser\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_RequestParser():\n TypeOnly<old.RequestParser>;\ndeclare function use_current_ClassDeclaration_RequestParser(\n use: TypeOnly<current.RequestParser>): void;\nuse_current_ClassDeclaration_RequestParser(\n get_old_ClassDeclaration_RequestParser());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_RequestParser\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_RequestParser():\n TypeOnly<current.RequestParser>;\ndeclare function use_old_ClassDeclaration_RequestParser(\n use: TypeOnly<old.RequestParser>): void;\nuse_old_ClassDeclaration_RequestParser(\n get_current_ClassDeclaration_RequestParser());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_RuntimeFactoryHelper\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_RuntimeFactoryHelper():\n TypeOnly<old.RuntimeFactoryHelper>;\ndeclare function use_current_ClassDeclaration_RuntimeFactoryHelper(\n use: TypeOnly<current.RuntimeFactoryHelper>): void;\nuse_current_ClassDeclaration_RuntimeFactoryHelper(\n get_old_ClassDeclaration_RuntimeFactoryHelper());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_RuntimeFactoryHelper\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_RuntimeFactoryHelper():\n TypeOnly<current.RuntimeFactoryHelper>;\ndeclare function use_old_ClassDeclaration_RuntimeFactoryHelper(\n use: TypeOnly<old.RuntimeFactoryHelper>): void;\nuse_old_ClassDeclaration_RuntimeFactoryHelper(\n get_current_ClassDeclaration_RuntimeFactoryHelper());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_SummaryTreeBuilder\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_SummaryTreeBuilder():\n TypeOnly<old.SummaryTreeBuilder>;\ndeclare function use_current_ClassDeclaration_SummaryTreeBuilder(\n use: TypeOnly<current.SummaryTreeBuilder>): void;\nuse_current_ClassDeclaration_SummaryTreeBuilder(\n get_old_ClassDeclaration_SummaryTreeBuilder());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_SummaryTreeBuilder\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_SummaryTreeBuilder():\n TypeOnly<current.SummaryTreeBuilder>;\ndeclare function use_old_ClassDeclaration_SummaryTreeBuilder(\n use: TypeOnly<old.SummaryTreeBuilder>): void;\nuse_old_ClassDeclaration_SummaryTreeBuilder(\n get_current_ClassDeclaration_SummaryTreeBuilder());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_TelemetryContext\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_TelemetryContext():\n TypeOnly<old.TelemetryContext>;\ndeclare function use_current_ClassDeclaration_TelemetryContext(\n use: TypeOnly<current.TelemetryContext>): void;\nuse_current_ClassDeclaration_TelemetryContext(\n get_old_ClassDeclaration_TelemetryContext());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_TelemetryContext\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_TelemetryContext():\n TypeOnly<current.TelemetryContext>;\ndeclare function use_old_ClassDeclaration_TelemetryContext(\n use: TypeOnly<old.TelemetryContext>): void;\nuse_old_ClassDeclaration_TelemetryContext(\n get_current_ClassDeclaration_TelemetryContext());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_addBlobToSummary\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_addBlobToSummary():\n TypeOnly<typeof old.addBlobToSummary>;\ndeclare function use_current_FunctionDeclaration_addBlobToSummary(\n use: TypeOnly<typeof current.addBlobToSummary>): void;\nuse_current_FunctionDeclaration_addBlobToSummary(\n get_old_FunctionDeclaration_addBlobToSummary());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_addBlobToSummary\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_addBlobToSummary():\n TypeOnly<typeof current.addBlobToSummary>;\ndeclare function use_old_FunctionDeclaration_addBlobToSummary(\n use: TypeOnly<typeof old.addBlobToSummary>): void;\nuse_old_FunctionDeclaration_addBlobToSummary(\n get_current_FunctionDeclaration_addBlobToSummary());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_addSummarizeResultToSummary\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_addSummarizeResultToSummary():\n TypeOnly<typeof old.addSummarizeResultToSummary>;\ndeclare function use_current_FunctionDeclaration_addSummarizeResultToSummary(\n use: TypeOnly<typeof current.addSummarizeResultToSummary>): void;\nuse_current_FunctionDeclaration_addSummarizeResultToSummary(\n get_old_FunctionDeclaration_addSummarizeResultToSummary());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_addSummarizeResultToSummary\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_addSummarizeResultToSummary():\n TypeOnly<typeof current.addSummarizeResultToSummary>;\ndeclare function use_old_FunctionDeclaration_addSummarizeResultToSummary(\n use: TypeOnly<typeof old.addSummarizeResultToSummary>): void;\nuse_old_FunctionDeclaration_addSummarizeResultToSummary(\n get_current_FunctionDeclaration_addSummarizeResultToSummary());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"RemovedFunctionDeclaration_addTreeToSummary\": {\"forwardCompat\": false}\n*/\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"RemovedFunctionDeclaration_addTreeToSummary\": {\"backCompat\": false}\n*/\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_calculateStats\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_calculateStats():\n TypeOnly<typeof old.calculateStats>;\ndeclare function use_current_FunctionDeclaration_calculateStats(\n use: TypeOnly<typeof current.calculateStats>): void;\nuse_current_FunctionDeclaration_calculateStats(\n get_old_FunctionDeclaration_calculateStats());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_calculateStats\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_calculateStats():\n TypeOnly<typeof current.calculateStats>;\ndeclare function use_old_FunctionDeclaration_calculateStats(\n use: TypeOnly<typeof old.calculateStats>): void;\nuse_old_FunctionDeclaration_calculateStats(\n get_current_FunctionDeclaration_calculateStats());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_convertSnapshotTreeToSummaryTree\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_convertSnapshotTreeToSummaryTree():\n TypeOnly<typeof old.convertSnapshotTreeToSummaryTree>;\ndeclare function use_current_FunctionDeclaration_convertSnapshotTreeToSummaryTree(\n use: TypeOnly<typeof current.convertSnapshotTreeToSummaryTree>): void;\nuse_current_FunctionDeclaration_convertSnapshotTreeToSummaryTree(\n get_old_FunctionDeclaration_convertSnapshotTreeToSummaryTree());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_convertSnapshotTreeToSummaryTree\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_convertSnapshotTreeToSummaryTree():\n TypeOnly<typeof current.convertSnapshotTreeToSummaryTree>;\ndeclare function use_old_FunctionDeclaration_convertSnapshotTreeToSummaryTree(\n use: TypeOnly<typeof old.convertSnapshotTreeToSummaryTree>): void;\nuse_old_FunctionDeclaration_convertSnapshotTreeToSummaryTree(\n get_current_FunctionDeclaration_convertSnapshotTreeToSummaryTree());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_convertSummaryTreeToITree\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_convertSummaryTreeToITree():\n TypeOnly<typeof old.convertSummaryTreeToITree>;\ndeclare function use_current_FunctionDeclaration_convertSummaryTreeToITree(\n use: TypeOnly<typeof current.convertSummaryTreeToITree>): void;\nuse_current_FunctionDeclaration_convertSummaryTreeToITree(\n get_old_FunctionDeclaration_convertSummaryTreeToITree());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_convertSummaryTreeToITree\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_convertSummaryTreeToITree():\n TypeOnly<typeof current.convertSummaryTreeToITree>;\ndeclare function use_old_FunctionDeclaration_convertSummaryTreeToITree(\n use: TypeOnly<typeof old.convertSummaryTreeToITree>): void;\nuse_old_FunctionDeclaration_convertSummaryTreeToITree(\n get_current_FunctionDeclaration_convertSummaryTreeToITree());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_convertToSummaryTree\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_convertToSummaryTree():\n TypeOnly<typeof old.convertToSummaryTree>;\ndeclare function use_current_FunctionDeclaration_convertToSummaryTree(\n use: TypeOnly<typeof current.convertToSummaryTree>): void;\nuse_current_FunctionDeclaration_convertToSummaryTree(\n get_old_FunctionDeclaration_convertToSummaryTree());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_convertToSummaryTree\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_convertToSummaryTree():\n TypeOnly<typeof current.convertToSummaryTree>;\ndeclare function use_old_FunctionDeclaration_convertToSummaryTree(\n use: TypeOnly<typeof old.convertToSummaryTree>): void;\nuse_old_FunctionDeclaration_convertToSummaryTree(\n get_current_FunctionDeclaration_convertToSummaryTree());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_convertToSummaryTreeWithStats\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_convertToSummaryTreeWithStats():\n TypeOnly<typeof old.convertToSummaryTreeWithStats>;\ndeclare function use_current_FunctionDeclaration_convertToSummaryTreeWithStats(\n use: TypeOnly<typeof current.convertToSummaryTreeWithStats>): void;\nuse_current_FunctionDeclaration_convertToSummaryTreeWithStats(\n get_old_FunctionDeclaration_convertToSummaryTreeWithStats());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_convertToSummaryTreeWithStats\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_convertToSummaryTreeWithStats():\n TypeOnly<typeof current.convertToSummaryTreeWithStats>;\ndeclare function use_old_FunctionDeclaration_convertToSummaryTreeWithStats(\n use: TypeOnly<typeof old.convertToSummaryTreeWithStats>): void;\nuse_old_FunctionDeclaration_convertToSummaryTreeWithStats(\n get_current_FunctionDeclaration_convertToSummaryTreeWithStats());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_create404Response\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_VariableDeclaration_create404Response():\n TypeOnly<typeof old.create404Response>;\ndeclare function use_current_VariableDeclaration_create404Response(\n use: TypeOnly<typeof current.create404Response>): void;\nuse_current_VariableDeclaration_create404Response(\n get_old_VariableDeclaration_create404Response());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_create404Response\": {\"backCompat\": false}\n*/\ndeclare function get_current_VariableDeclaration_create404Response():\n TypeOnly<typeof current.create404Response>;\ndeclare function use_old_VariableDeclaration_create404Response(\n use: TypeOnly<typeof old.create404Response>): void;\nuse_old_VariableDeclaration_create404Response(\n get_current_VariableDeclaration_create404Response());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_createDataStoreFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_createDataStoreFactory():\n TypeOnly<typeof old.createDataStoreFactory>;\ndeclare function use_current_FunctionDeclaration_createDataStoreFactory(\n use: TypeOnly<typeof current.createDataStoreFactory>): void;\nuse_current_FunctionDeclaration_createDataStoreFactory(\n get_old_FunctionDeclaration_createDataStoreFactory());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_createDataStoreFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_createDataStoreFactory():\n TypeOnly<typeof current.createDataStoreFactory>;\ndeclare function use_old_FunctionDeclaration_createDataStoreFactory(\n use: TypeOnly<typeof old.createDataStoreFactory>): void;\nuse_old_FunctionDeclaration_createDataStoreFactory(\n get_current_FunctionDeclaration_createDataStoreFactory());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_createResponseError\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_createResponseError():\n TypeOnly<typeof old.createResponseError>;\ndeclare function use_current_FunctionDeclaration_createResponseError(\n use: TypeOnly<typeof current.createResponseError>): void;\nuse_current_FunctionDeclaration_createResponseError(\n get_old_FunctionDeclaration_createResponseError());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_createResponseError\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_createResponseError():\n TypeOnly<typeof current.createResponseError>;\ndeclare function use_old_FunctionDeclaration_createResponseError(\n use: TypeOnly<typeof old.createResponseError>): void;\nuse_old_FunctionDeclaration_createResponseError(\n get_current_FunctionDeclaration_createResponseError());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_exceptionToResponse\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_exceptionToResponse():\n TypeOnly<typeof old.exceptionToResponse>;\ndeclare function use_current_FunctionDeclaration_exceptionToResponse(\n use: TypeOnly<typeof current.exceptionToResponse>): void;\nuse_current_FunctionDeclaration_exceptionToResponse(\n get_old_FunctionDeclaration_exceptionToResponse());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_exceptionToResponse\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_exceptionToResponse():\n TypeOnly<typeof current.exceptionToResponse>;\ndeclare function use_old_FunctionDeclaration_exceptionToResponse(\n use: TypeOnly<typeof old.exceptionToResponse>): void;\nuse_old_FunctionDeclaration_exceptionToResponse(\n get_current_FunctionDeclaration_exceptionToResponse());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_generateHandleContextPath\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_generateHandleContextPath():\n TypeOnly<typeof old.generateHandleContextPath>;\ndeclare function use_current_FunctionDeclaration_generateHandleContextPath(\n use: TypeOnly<typeof current.generateHandleContextPath>): void;\nuse_current_FunctionDeclaration_generateHandleContextPath(\n get_old_FunctionDeclaration_generateHandleContextPath());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_generateHandleContextPath\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_generateHandleContextPath():\n TypeOnly<typeof current.generateHandleContextPath>;\ndeclare function use_old_FunctionDeclaration_generateHandleContextPath(\n use: TypeOnly<typeof old.generateHandleContextPath>): void;\nuse_old_FunctionDeclaration_generateHandleContextPath(\n get_current_FunctionDeclaration_generateHandleContextPath());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getBlobSize\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_getBlobSize():\n TypeOnly<typeof old.getBlobSize>;\ndeclare function use_current_FunctionDeclaration_getBlobSize(\n use: TypeOnly<typeof current.getBlobSize>): void;\nuse_current_FunctionDeclaration_getBlobSize(\n get_old_FunctionDeclaration_getBlobSize());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getBlobSize\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_getBlobSize():\n TypeOnly<typeof current.getBlobSize>;\ndeclare function use_old_FunctionDeclaration_getBlobSize(\n use: TypeOnly<typeof old.getBlobSize>): void;\nuse_old_FunctionDeclaration_getBlobSize(\n get_current_FunctionDeclaration_getBlobSize());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getNormalizedObjectStoragePathParts\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_getNormalizedObjectStoragePathParts():\n TypeOnly<typeof old.getNormalizedObjectStoragePathParts>;\ndeclare function use_current_FunctionDeclaration_getNormalizedObjectStoragePathParts(\n use: TypeOnly<typeof current.getNormalizedObjectStoragePathParts>): void;\nuse_current_FunctionDeclaration_getNormalizedObjectStoragePathParts(\n get_old_FunctionDeclaration_getNormalizedObjectStoragePathParts());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_getNormalizedObjectStoragePathParts\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_getNormalizedObjectStoragePathParts():\n TypeOnly<typeof current.getNormalizedObjectStoragePathParts>;\ndeclare function use_old_FunctionDeclaration_getNormalizedObjectStoragePathParts(\n use: TypeOnly<typeof old.getNormalizedObjectStoragePathParts>): void;\nuse_old_FunctionDeclaration_getNormalizedObjectStoragePathParts(\n get_current_FunctionDeclaration_getNormalizedObjectStoragePathParts());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_listBlobsAtTreePath\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_listBlobsAtTreePath():\n TypeOnly<typeof old.listBlobsAtTreePath>;\ndeclare function use_current_FunctionDeclaration_listBlobsAtTreePath(\n use: TypeOnly<typeof current.listBlobsAtTreePath>): void;\nuse_current_FunctionDeclaration_listBlobsAtTreePath(\n get_old_FunctionDeclaration_listBlobsAtTreePath());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_listBlobsAtTreePath\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_listBlobsAtTreePath():\n TypeOnly<typeof current.listBlobsAtTreePath>;\ndeclare function use_old_FunctionDeclaration_listBlobsAtTreePath(\n use: TypeOnly<typeof old.listBlobsAtTreePath>): void;\nuse_old_FunctionDeclaration_listBlobsAtTreePath(\n get_current_FunctionDeclaration_listBlobsAtTreePath());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_mergeStats\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_mergeStats():\n TypeOnly<typeof old.mergeStats>;\ndeclare function use_current_FunctionDeclaration_mergeStats(\n use: TypeOnly<typeof current.mergeStats>): void;\nuse_current_FunctionDeclaration_mergeStats(\n get_old_FunctionDeclaration_mergeStats());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_mergeStats\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_mergeStats():\n TypeOnly<typeof current.mergeStats>;\ndeclare function use_old_FunctionDeclaration_mergeStats(\n use: TypeOnly<typeof old.mergeStats>): void;\nuse_old_FunctionDeclaration_mergeStats(\n get_current_FunctionDeclaration_mergeStats());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_responseToException\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_responseToException():\n TypeOnly<typeof old.responseToException>;\ndeclare function use_current_FunctionDeclaration_responseToException(\n use: TypeOnly<typeof current.responseToException>): void;\nuse_current_FunctionDeclaration_responseToException(\n get_old_FunctionDeclaration_responseToException());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_responseToException\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_responseToException():\n TypeOnly<typeof current.responseToException>;\ndeclare function use_old_FunctionDeclaration_responseToException(\n use: TypeOnly<typeof old.responseToException>): void;\nuse_old_FunctionDeclaration_responseToException(\n get_current_FunctionDeclaration_responseToException());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_seqFromTree\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_seqFromTree():\n TypeOnly<typeof old.seqFromTree>;\ndeclare function use_current_FunctionDeclaration_seqFromTree(\n use: TypeOnly<typeof current.seqFromTree>): void;\nuse_current_FunctionDeclaration_seqFromTree(\n get_old_FunctionDeclaration_seqFromTree());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_seqFromTree\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_seqFromTree():\n TypeOnly<typeof current.seqFromTree>;\ndeclare function use_old_FunctionDeclaration_seqFromTree(\n use: TypeOnly<typeof old.seqFromTree>): void;\nuse_old_FunctionDeclaration_seqFromTree(\n get_current_FunctionDeclaration_seqFromTree());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_unpackChildNodesUsedRoutes\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_unpackChildNodesUsedRoutes():\n TypeOnly<typeof old.unpackChildNodesUsedRoutes>;\ndeclare function use_current_FunctionDeclaration_unpackChildNodesUsedRoutes(\n use: TypeOnly<typeof current.unpackChildNodesUsedRoutes>): void;\nuse_current_FunctionDeclaration_unpackChildNodesUsedRoutes(\n get_old_FunctionDeclaration_unpackChildNodesUsedRoutes());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_unpackChildNodesUsedRoutes\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_unpackChildNodesUsedRoutes():\n TypeOnly<typeof current.unpackChildNodesUsedRoutes>;\ndeclare function use_old_FunctionDeclaration_unpackChildNodesUsedRoutes(\n use: TypeOnly<typeof old.unpackChildNodesUsedRoutes>): void;\nuse_old_FunctionDeclaration_unpackChildNodesUsedRoutes(\n get_current_FunctionDeclaration_unpackChildNodesUsedRoutes());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_utf8ByteLength\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_utf8ByteLength():\n TypeOnly<typeof old.utf8ByteLength>;\ndeclare function use_current_FunctionDeclaration_utf8ByteLength(\n use: TypeOnly<typeof current.utf8ByteLength>): void;\nuse_current_FunctionDeclaration_utf8ByteLength(\n get_old_FunctionDeclaration_utf8ByteLength());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_utf8ByteLength\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_utf8ByteLength():\n TypeOnly<typeof current.utf8ByteLength>;\ndeclare function use_old_FunctionDeclaration_utf8ByteLength(\n use: TypeOnly<typeof old.utf8ByteLength>): void;\nuse_old_FunctionDeclaration_utf8ByteLength(\n get_current_FunctionDeclaration_utf8ByteLength());\n"]}
|
package/lib/test/utils.spec.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { strict as assert } from "assert";
|
|
6
|
-
import { encodeCompactIdToString } from "../utils.js";
|
|
7
|
-
describe("Utils", () => {
|
|
8
|
-
beforeEach(() => { });
|
|
9
|
-
it("encodeCompactIdToString() with strings", () => {
|
|
10
|
-
assert(encodeCompactIdToString("a-b-c") === "a-b-c", "text");
|
|
11
|
-
assert(encodeCompactIdToString("_abcdefghijklmn") === "_abcdefghijklmn", "text");
|
|
12
|
-
});
|
|
13
|
-
it("encodeCompactIdToString() has base of 64 (sort of)", () => {
|
|
14
|
-
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ[abcdefghijklmnopqrstuvwxyz{01234567890";
|
|
15
|
-
for (let i = 0; i < 64; i++) {
|
|
16
|
-
const value = encodeCompactIdToString(i);
|
|
17
|
-
assert(value.length === 1, "length");
|
|
18
|
-
assert(chars[i] === value, "value");
|
|
19
|
-
}
|
|
20
|
-
for (let i = 64; i < 65 * 64 - 1; i++) {
|
|
21
|
-
const value = encodeCompactIdToString(i);
|
|
22
|
-
assert(value.length === 2, "length");
|
|
23
|
-
assert(chars.includes(value[0]), "value");
|
|
24
|
-
assert(chars.includes(value[1]), "value");
|
|
25
|
-
}
|
|
26
|
-
// This is a bit weird, as it does not work as our intuition suggests.
|
|
27
|
-
// That's because in base10 system we do not use "01" form - leading 0 is not used.
|
|
28
|
-
// Here, because we use forms like 01, 001, 011, we can put more numbers into less chars.
|
|
29
|
-
assert(encodeCompactIdToString(64) === "AA", "AA");
|
|
30
|
-
assert(encodeCompactIdToString(64 * 64) === "9A", "9A");
|
|
31
|
-
assert(encodeCompactIdToString(64 * 64 * 64) === "89A", "89A");
|
|
32
|
-
assert(encodeCompactIdToString(64 * 64 * 64 * 64) === "889A", "889A"); // 16M!
|
|
33
|
-
assert(encodeCompactIdToString(64 * 64 * 64 * 64 * 64) === "8889A", "8889A"); // 1G (~10^9)
|
|
34
|
-
assert(encodeCompactIdToString(64 * 64 * 64 * 64 * 64 * 64) === "88889A", "88889A");
|
|
35
|
-
});
|
|
36
|
-
it("encodeCompactIdToString() generates Unique values", () => {
|
|
37
|
-
const result = new Set();
|
|
38
|
-
const len = 10000;
|
|
39
|
-
for (let i = 0; i < len; i++) {
|
|
40
|
-
const value = encodeCompactIdToString(i);
|
|
41
|
-
result.add(value);
|
|
42
|
-
// Strong rules:
|
|
43
|
-
assert(!value.includes("/"), "no slashses");
|
|
44
|
-
assert(value.length > 0, "length");
|
|
45
|
-
// Soft rules: these rules can be broken, but they are great to have for efficiency
|
|
46
|
-
// as such IDs are encoded as JSON, and some symbols require escaping
|
|
47
|
-
assert(!value.includes('"'), "no quotes");
|
|
48
|
-
assert(!value.includes("\\"), "no backslashes");
|
|
49
|
-
}
|
|
50
|
-
assert(result.size === len, "collision detected!");
|
|
51
|
-
});
|
|
52
|
-
it("encodeCompactIdToString() with prefix", () => {
|
|
53
|
-
const result = new Set();
|
|
54
|
-
const len = 1000;
|
|
55
|
-
for (let i = 0; i < len; i++) {
|
|
56
|
-
const value = encodeCompactIdToString(i, "_");
|
|
57
|
-
result.add(value);
|
|
58
|
-
assert(!value.includes("/"), "no slashses");
|
|
59
|
-
assert(value.startsWith("_"), "prefix");
|
|
60
|
-
assert(value.length > 1, "length");
|
|
61
|
-
}
|
|
62
|
-
assert(result.size === len, "collision detected!");
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
//# sourceMappingURL=utils.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.spec.js","sourceRoot":"","sources":["../../src/test/utils.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACtB,UAAU,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAErB,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QACjD,MAAM,CAAC,uBAAuB,CA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CAAC,MAAM,CAAC,IAAI,KAAK,GAAG,EAAE,qBAAqB,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAChD,MAAM,MAAM,GAAgB,IAAI,GAAG,EAAE,CAAC;QACtC,MAAM,GAAG,GAAG,IAAI,CAAC;QACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;YAC7B,MAAM,KAAK,GAAG,uBAAuB,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YAC9C,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YAElB,MAAM,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,aAAa,CAAC,CAAC;YAC5C,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAC;YACxC,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAC;SACnC;QACD,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,GAAG,EAAE,qBAAqB,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strict as assert } from \"assert\";\nimport { encodeCompactIdToString } from \"../utils.js\";\n\ndescribe(\"Utils\", () => {\n\tbeforeEach(() => {});\n\n\tit(\"encodeCompactIdToString() with strings\", () => {\n\t\tassert(encodeCompactIdToString(\"a-b-c\") === \"a-b-c\", \"text\");\n\t\tassert(encodeCompactIdToString(\"_abcdefghijklmn\") === \"_abcdefghijklmn\", \"text\");\n\t});\n\n\tit(\"encodeCompactIdToString() has base of 64 (sort of)\", () => {\n\t\tconst chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ[abcdefghijklmnopqrstuvwxyz{01234567890\";\n\t\tfor (let i = 0; i < 64; i++) {\n\t\t\tconst value = encodeCompactIdToString(i);\n\t\t\tassert(value.length === 1, \"length\");\n\t\t\tassert(chars[i] === value, \"value\");\n\t\t}\n\n\t\tfor (let i = 64; i < 65 * 64 - 1; i++) {\n\t\t\tconst value = encodeCompactIdToString(i);\n\t\t\tassert(value.length === 2, \"length\");\n\t\t\tassert(chars.includes(value[0]), \"value\");\n\t\t\tassert(chars.includes(value[1]), \"value\");\n\t\t}\n\n\t\t// This is a bit weird, as it does not work as our intuition suggests.\n\t\t// That's because in base10 system we do not use \"01\" form - leading 0 is not used.\n\t\t// Here, because we use forms like 01, 001, 011, we can put more numbers into less chars.\n\t\tassert(encodeCompactIdToString(64) === \"AA\", \"AA\");\n\t\tassert(encodeCompactIdToString(64 * 64) === \"9A\", \"9A\");\n\t\tassert(encodeCompactIdToString(64 * 64 * 64) === \"89A\", \"89A\");\n\t\tassert(encodeCompactIdToString(64 * 64 * 64 * 64) === \"889A\", \"889A\"); // 16M!\n\t\tassert(encodeCompactIdToString(64 * 64 * 64 * 64 * 64) === \"8889A\", \"8889A\"); // 1G (~10^9)\n\t\tassert(encodeCompactIdToString(64 * 64 * 64 * 64 * 64 * 64) === \"88889A\", \"88889A\");\n\t});\n\n\tit(\"encodeCompactIdToString() generates Unique values\", () => {\n\t\tconst result: Set<string> = new Set();\n\t\tconst len = 10000;\n\t\tfor (let i = 0; i < len; i++) {\n\t\t\tconst value = encodeCompactIdToString(i);\n\t\t\tresult.add(value);\n\n\t\t\t// Strong rules:\n\t\t\tassert(!value.includes(\"/\"), \"no slashses\");\n\t\t\tassert(value.length > 0, \"length\");\n\n\t\t\t// Soft rules: these rules can be broken, but they are great to have for efficiency\n\t\t\t// as such IDs are encoded as JSON, and some symbols require escaping\n\t\t\tassert(!value.includes('\"'), \"no quotes\");\n\t\t\tassert(!value.includes(\"\\\\\"), \"no backslashes\");\n\t\t}\n\t\tassert(result.size === len, \"collision detected!\");\n\t});\n\n\tit(\"encodeCompactIdToString() with prefix\", () => {\n\t\tconst result: Set<string> = new Set();\n\t\tconst len = 1000;\n\t\tfor (let i = 0; i < len; i++) {\n\t\t\tconst value = encodeCompactIdToString(i, \"_\");\n\t\t\tresult.add(value);\n\n\t\t\tassert(!value.includes(\"/\"), \"no slashses\");\n\t\t\tassert(value.startsWith(\"_\"), \"prefix\");\n\t\t\tassert(value.length > 1, \"length\");\n\t\t}\n\t\tassert(result.size === len, \"collision detected!\");\n\t});\n});\n"]}
|
|
File without changes
|