@fluid-experimental/property-common 2.0.0-dev.2.3.0.115467 → 2.0.0-dev.4.1.0.148229
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/.eslintrc.js +9 -11
- package/.mocharc.json +6 -6
- package/README.md +1 -0
- package/api-extractor.json +2 -2
- package/dist/chronometer.d.ts.map +1 -1
- package/dist/chronometer.js.map +1 -1
- package/dist/consoleUtils.d.ts.map +1 -1
- package/dist/consoleUtils.js +4 -1
- package/dist/consoleUtils.js.map +1 -1
- package/dist/constants.d.ts +6 -6
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +16 -26
- package/dist/constants.js.map +1 -1
- package/dist/datastructures/collection.d.ts.map +1 -1
- package/dist/datastructures/collection.js +5 -4
- package/dist/datastructures/collection.js.map +1 -1
- package/dist/datastructures/dataArray.d.ts.map +1 -1
- package/dist/datastructures/dataArray.js +18 -9
- package/dist/datastructures/dataArray.js.map +1 -1
- package/dist/datastructures/integer64.d.ts.map +1 -1
- package/dist/datastructures/integer64.js +1 -1
- package/dist/datastructures/integer64.js.map +1 -1
- package/dist/datastructures/sortedCollection.d.ts.map +1 -1
- package/dist/datastructures/sortedCollection.js +3 -1
- package/dist/datastructures/sortedCollection.js.map +1 -1
- package/dist/deferredPromise.d.ts +1 -1
- package/dist/deferredPromise.d.ts.map +1 -1
- package/dist/deferredPromise.js +9 -3
- package/dist/deferredPromise.js.map +1 -1
- package/dist/deterministicRandomGenerator.d.ts.map +1 -1
- package/dist/deterministicRandomGenerator.js +6 -6
- package/dist/deterministicRandomGenerator.js.map +1 -1
- package/dist/error_objects/flaggedError.d.ts.map +1 -1
- package/dist/error_objects/flaggedError.js.map +1 -1
- package/dist/error_objects/httpError.d.ts.map +1 -1
- package/dist/error_objects/httpError.js +9 -9
- package/dist/error_objects/httpError.js.map +1 -1
- package/dist/error_objects/httpErrorNoStack.d.ts.map +1 -1
- package/dist/error_objects/httpErrorNoStack.js.map +1 -1
- package/dist/error_objects/operationError.d.ts +7 -7
- package/dist/error_objects/operationError.d.ts.map +1 -1
- package/dist/error_objects/operationError.js +7 -7
- package/dist/error_objects/operationError.js.map +1 -1
- package/dist/guidUtils.d.ts.map +1 -1
- package/dist/guidUtils.js +10 -9
- package/dist/guidUtils.js.map +1 -1
- package/dist/hashCalculator.d.ts.map +1 -1
- package/dist/hashCalculator.js.map +1 -1
- package/dist/joinPaths.d.ts.map +1 -1
- package/dist/joinPaths.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/chronometer.d.ts.map +1 -1
- package/lib/chronometer.js.map +1 -1
- package/lib/consoleUtils.d.ts.map +1 -1
- package/lib/consoleUtils.js +4 -1
- package/lib/consoleUtils.js.map +1 -1
- package/lib/constants.d.ts +6 -6
- package/lib/constants.d.ts.map +1 -1
- package/lib/constants.js +16 -26
- package/lib/constants.js.map +1 -1
- package/lib/datastructures/collection.d.ts.map +1 -1
- package/lib/datastructures/collection.js +5 -4
- package/lib/datastructures/collection.js.map +1 -1
- package/lib/datastructures/dataArray.d.ts.map +1 -1
- package/lib/datastructures/dataArray.js +18 -9
- package/lib/datastructures/dataArray.js.map +1 -1
- package/lib/datastructures/integer64.d.ts.map +1 -1
- package/lib/datastructures/integer64.js +1 -1
- package/lib/datastructures/integer64.js.map +1 -1
- package/lib/datastructures/sortedCollection.d.ts.map +1 -1
- package/lib/datastructures/sortedCollection.js +3 -1
- package/lib/datastructures/sortedCollection.js.map +1 -1
- package/lib/deferredPromise.d.ts +1 -1
- package/lib/deferredPromise.d.ts.map +1 -1
- package/lib/deferredPromise.js +9 -3
- package/lib/deferredPromise.js.map +1 -1
- package/lib/deterministicRandomGenerator.d.ts.map +1 -1
- package/lib/deterministicRandomGenerator.js +6 -6
- package/lib/deterministicRandomGenerator.js.map +1 -1
- package/lib/error_objects/flaggedError.d.ts.map +1 -1
- package/lib/error_objects/flaggedError.js.map +1 -1
- package/lib/error_objects/httpError.d.ts.map +1 -1
- package/lib/error_objects/httpError.js +9 -9
- package/lib/error_objects/httpError.js.map +1 -1
- package/lib/error_objects/httpErrorNoStack.d.ts.map +1 -1
- package/lib/error_objects/httpErrorNoStack.js.map +1 -1
- package/lib/error_objects/operationError.d.ts +7 -7
- package/lib/error_objects/operationError.d.ts.map +1 -1
- package/lib/error_objects/operationError.js +7 -7
- package/lib/error_objects/operationError.js.map +1 -1
- package/lib/guidUtils.d.ts.map +1 -1
- package/lib/guidUtils.js +10 -9
- package/lib/guidUtils.js.map +1 -1
- package/lib/hashCalculator.d.ts.map +1 -1
- package/lib/hashCalculator.js.map +1 -1
- package/lib/joinPaths.d.ts.map +1 -1
- package/lib/joinPaths.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +42 -40
- package/platform-dependent/README.md +1 -0
- package/platform-dependent/browser.js +5 -5
- package/platform-dependent/package.json +14 -14
- package/platform-dependent/server.js +5 -5
- package/prettier.config.cjs +1 -1
- package/src/chronometer.ts +174 -169
- package/src/consoleUtils.ts +16 -11
- package/src/constants.ts +1683 -1640
- package/src/datastructures/collection.ts +417 -416
- package/src/datastructures/dataArray.ts +516 -492
- package/src/datastructures/integer64.ts +102 -99
- package/src/datastructures/sortedCollection.ts +155 -145
- package/src/deferredPromise.ts +43 -42
- package/src/deterministicRandomGenerator.ts +59 -59
- package/src/error_objects/flaggedError.ts +29 -29
- package/src/error_objects/httpError.ts +45 -42
- package/src/error_objects/httpErrorNoStack.ts +17 -17
- package/src/error_objects/operationError.ts +62 -62
- package/src/guidUtils.ts +182 -171
- package/src/hashCalculator.ts +5 -2
- package/src/joinPaths.ts +15 -9
- package/src/packageVersion.ts +1 -1
- package/tsconfig.esnext.json +6 -6
- package/tsconfig.json +9 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deterministicRandomGenerator.js","sourceRoot":"","sources":["../src/deterministicRandomGenerator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,+BAA+B;AAE/B,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,OAAO,4BAA4B;
|
|
1
|
+
{"version":3,"file":"deterministicRandomGenerator.js","sourceRoot":"","sources":["../src/deterministicRandomGenerator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,+BAA+B;AAE/B,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,OAAO,4BAA4B;IAKxC;;;OAGG;IACH,YAAY,OAAwB;QACnC,4DAA4D;QAC5D,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC;YAChC,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,OAAO,CAAC;YACnC,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC5D,IAAI,CAAC,MAAM,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;QACjC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;QAC5C,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;QAC5C,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,I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MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;SAC3B;IACF,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Helper class to create a deterministic sequence of random numbers.\n */\n\n/* eslint-disable no-bitwise */\n\nimport _ from \"lodash\";\nimport { GuidUtils } from \"./guidUtils\";\nimport { calculateHash } from \"./hashCalculator\";\n\n/**\n * Random number generator that creates a deterministic sequence of random numbers based on an initial seed GUID.\n *\n * @remarks Warning: This is a very straight forward implementation based on the hashCombine4xUint32 function.\n * It probably doesn't produce very high quality random numbers (do not use this for cryptography!) and it is not very\n * efficient.\n */\nexport class DeterministicRandomGenerator {\n\t_guid1: Uint32Array;\n\t_guid2: Uint32Array;\n\t_result: Uint32Array;\n\n\t/**\n\t * @param in_seed - The initial seed (it can be either a GUID or a number)\n\t * which is used to initialize the random number generator.\n\t */\n\tconstructor(in_seed: string | number) {\n\t\t// Initialize the internal state from the given initial guid\n\t\tthis._guid1 = _.isString(in_seed)\n\t\t\t? GuidUtils.guidToUint32x4(in_seed)\n\t\t\t: GuidUtils.guidToUint32x4(calculateHash(String(in_seed)));\n\t\tthis._guid2 = new Uint32Array(4);\n\t\tthis._guid2[0] = (this._guid1[0] + 1) >>> 0;\n\t\tthis._guid2[1] = (this._guid1[1] + 1) >>> 0;\n\t\tthis._guid2[2] = (this._guid1[2] + 1) >>> 0;\n\t\tthis._guid2[3] = (this._guid1[3] + 1) >>> 0;\n\n\t\tthis._result = new Uint32Array(4);\n\t}\n\n\t/**\n\t * Creates a floating point random number.\n\t *\n\t * @param in_max - If supplied the returned number will be 0 \\<= number \\< `in_max`.\n\t * If none is given, `in_max` = 1 is assumed.\n\t *\n\t * @returns The random number.\n\t */\n\trandom(in_max = 1.0) {\n\t\tconst randomInteger = this.irandom();\n\t\treturn (randomInteger / 4294967296) * in_max;\n\t}\n\n\t/**\n\t * Creates an integer point random number.\n\t *\n\t * @param in_max - If supplied the returned number will be 0 \\<= number \\< `in_max`.\n\t * If none is given, `in_max` = 14294967296 (2^32) is assumed.\n\t *\n\t * @returns The random number.\n\t */\n\tirandom(in_max?: number): number {\n\t\t// Create a new hash\n\t\tGuidUtils.hashCombine4xUint32(this._guid1, this._guid2, this._result);\n\n\t\t// Permute the hashes\n\t\tfor (let i = 0; i < 4; i++) {\n\t\t\tthis._guid1[i] = this._guid2[i];\n\t\t\tthis._guid2[i] = this._result[i];\n\t\t}\n\n\t\tif (in_max === undefined) {\n\t\t\treturn this._guid1[0];\n\t\t} else {\n\t\t\treturn in_max < 16777619\n\t\t\t\t? // The random generator doesn't seem to be very good.\n\t\t\t\t // It is quite biased (e.g. it generates too many even numbers)\n\t\t\t\t // this is a hack to solve at least this problem, but we probably should\n\t\t\t\t // instead use a different approach altogether\n\t\t\t\t (this._guid1[0] % 16777619) % in_max\n\t\t\t\t: this._guid1[0] % in_max;\n\t\t}\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flaggedError.d.ts","sourceRoot":"","sources":["../../src/error_objects/flaggedError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,qBAAa,YAAY;
|
|
1
|
+
{"version":3,"file":"flaggedError.d.ts","sourceRoot":"","sources":["../../src/error_objects/flaggedError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,qBAAa,YAAY;IACxB;;OAEG;IACH,MAAM,CAAC,KAAK;QACX;;WAEG;;QAEH;;WAEG;;MAEF;IAEF,SAAS,CAAC,KAAK,EAAE,MAAM,CAAK;IAE5B;;OAEG;IACH,OAAO,IAAI,OAAO;IAIlB;;OAEG;IACH,WAAW,IAAI,OAAO;CAGtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flaggedError.js","sourceRoot":"","sources":["../../src/error_objects/flaggedError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"flaggedError.js","sourceRoot":"","sources":["../../src/error_objects/flaggedError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,EAAE;IAClD,sCAAsC;IACtC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC;AAChC,CAAC,CAAC;AAEF,MAAM,OAAO,YAAY;IAAzB;QAeW,UAAK,GAAW,CAAC,CAAC;IAe7B,CAAC;IAbA;;OAEG;IACH,OAAO;QACN,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,WAAW;QACV,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC;;AA5BD;;GAEG;AACI,kBAAK,GAAG;IACd;;OAEG;IACH,SAAS,EAAE,CAAC;IACZ;;OAEG;IACH,KAAK,EAAE,CAAC;CACR,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Checks if a flag is set\n * @param flags - Flags set within an error object\n * @param flag - A flag to be checked\n * @returns True if the flag is set in passed flags, false otherwise.\n */\nconst _isFlagSet = (flags: number, flag: number) => {\n\t// eslint-disable-next-line no-bitwise\n\treturn (flags & flag) === flag;\n};\n\nexport class FlaggedError {\n\t/**\n\t * Flags that may be set on an error instance.\n\t */\n\tstatic FLAGS = {\n\t\t/**\n\t\t * A transient error results from an operation that could succeed if retried.\n\t\t */\n\t\tTRANSIENT: 1,\n\t\t/**\n\t\t * A quiet error should not trigger an error log.\n\t\t */\n\t\tQUIET: 2,\n\t};\n\n\tprotected flags: number = 0;\n\n\t/**\n\t * @returns True if the quiet flag is set.\n\t */\n\tisQuiet(): boolean {\n\t\treturn _isFlagSet(this.flags, FlaggedError.FLAGS.QUIET);\n\t}\n\n\t/**\n\t * @returns True if the transient flag is set.\n\t */\n\tisTransient(): boolean {\n\t\treturn _isFlagSet(this.flags, FlaggedError.FLAGS.TRANSIENT);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpError.d.ts","sourceRoot":"","sources":["../../src/error_objects/httpError.ts"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,qBAAa,SAAU,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"httpError.d.ts","sourceRoot":"","sources":["../../src/error_objects/httpError.ts"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAE3B,KAAK,CAAC;IACN,UAAU,CAAC;IACX,aAAa,CAAC;IACd,MAAM,CAAC;IACP,GAAG,CAAC;IACJ,KAAK;gBALL,KAAK,CAAC,oBAAQ,EACd,UAAU,CAAC,oBAAQ,EACnB,aAAa,CAAC,oBAAQ,EACtB,MAAM,CAAC,oBAAQ,EACf,GAAG,CAAC,oBAAQ,EACZ,KAAK,SAAI;IASjB,MAAM,CAAC,KAAK;;;MAAsB;IAElC,OAAO,IAAI,OAAO;IAIlB,WAAW,IAAI,OAAO;IAItB,OAAO,CAAC,gBAAgB;IAaxB;;;OAGG;IACH,QAAQ,IAAI,MAAM;CAWlB"}
|
|
@@ -24,7 +24,7 @@ export class HTTPError extends Error {
|
|
|
24
24
|
Object.setPrototypeOf(this, HTTPError.prototype);
|
|
25
25
|
this.name = "HTTPError";
|
|
26
26
|
this.message = this._generateMessage(title, statusCode, statusMessage, method, url);
|
|
27
|
-
this.stack =
|
|
27
|
+
this.stack = new Error(this.message).stack;
|
|
28
28
|
}
|
|
29
29
|
isQuiet() {
|
|
30
30
|
return FlaggedError.prototype.isQuiet.call(this);
|
|
@@ -33,20 +33,20 @@ export class HTTPError extends Error {
|
|
|
33
33
|
return FlaggedError.prototype.isTransient.call(this);
|
|
34
34
|
}
|
|
35
35
|
_generateMessage(title, statusCode, statusMessage, method, url) {
|
|
36
|
-
const titleStr =
|
|
37
|
-
const statusCodeStr =
|
|
38
|
-
const statusMessageStr =
|
|
39
|
-
const methodStr =
|
|
40
|
-
const urlStr =
|
|
41
|
-
return `HTTPError: ${titleStr}, statusCode:${statusCodeStr}, ` +
|
|
42
|
-
`statusMessage:${statusMessageStr}, method:${methodStr}, url:${urlStr}
|
|
36
|
+
const titleStr = title === undefined ? "" : String(title);
|
|
37
|
+
const statusCodeStr = statusCode === undefined ? "" : String(statusCode);
|
|
38
|
+
const statusMessageStr = statusMessage === undefined ? "" : String(statusMessage);
|
|
39
|
+
const methodStr = method === undefined ? "" : String(method);
|
|
40
|
+
const urlStr = url === undefined ? "" : String(url);
|
|
41
|
+
return (`HTTPError: ${titleStr}, statusCode:${statusCodeStr}, ` +
|
|
42
|
+
`statusMessage:${statusMessageStr}, method:${methodStr}, url:${urlStr}`);
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* Returns a string representing the HTTPError object
|
|
46
46
|
* @returns a string representing the HTTPError object
|
|
47
47
|
*/
|
|
48
48
|
toString() {
|
|
49
|
-
const stack =
|
|
49
|
+
const stack = this.stack === undefined ? "" : String(this.stack);
|
|
50
50
|
const isFirefox = typeof window !== "undefined" &&
|
|
51
51
|
typeof window.navigator !== "undefined" &&
|
|
52
52
|
typeof window.navigator.userAgent !== "undefined" &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpError.js","sourceRoot":"","sources":["../../src/error_objects/httpError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"httpError.js","sourceRoot":"","sources":["../../src/error_objects/httpError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,M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B,GAAG,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAClF,MAAM,SAAS,GAAG,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC7D,MAAM,MAAM,GAAG,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAEpD,OAAO,CACN,cAAc,QAAQ,gBAAgB,aAAa,IAAI;YACvD,iBAAiB,gBAAgB,YAAY,SAAS,SAAS,MAAM,EAAE,CACvE,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,QAAQ;QACP,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAEjE,MAAM,SAAS,GACd,OAAO,MAAM,KAAK,WAAW;YAC7B,OAAO,MAAM,CAAC,SAAS,KAAK,WAAW;YACvC,OAAO,MAAM,CAAC,SAAS,CAAC,SAAS,KAAK,WAAW;YACjD,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAE9D,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,EAAE,CAAC;IACzE,CAAC;;AArCM,eAAK,GAAG,YAAY,CAAC,KAAK,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { FlaggedError } from \"./flaggedError\";\n\n/**\n * Class extending Error with HTTP-specific error information like statusCode and statusMessage\n * @param title - The error title\n * @param statusCode - A numeric HTTP status code\n * @param statusMessage - A string message representing the response status message\n * @param method - The HTTP method used in the request\n * @param url - The URL that the request was sent to\n * @param flags - Flags that characterize the error. See {@link FlaggedError.FLAGS}.\n */\nexport class HTTPError extends Error {\n\tconstructor(\n\t\tpublic title?: string,\n\t\tpublic statusCode?: number,\n\t\tpublic statusMessage?: string,\n\t\tpublic method?: string,\n\t\tpublic url?: string,\n\t\tpublic flags = 0,\n\t) {\n\t\tsuper();\n\t\tObject.setPrototypeOf(this, HTTPError.prototype);\n\t\tthis.name = \"HTTPError\";\n\t\tthis.message = this._generateMessage(title, statusCode, statusMessage, method, url);\n\t\tthis.stack = new Error(this.message).stack;\n\t}\n\n\tstatic FLAGS = FlaggedError.FLAGS;\n\n\tisQuiet(): boolean {\n\t\treturn FlaggedError.prototype.isQuiet.call(this);\n\t}\n\n\tisTransient(): boolean {\n\t\treturn FlaggedError.prototype.isTransient.call(this);\n\t}\n\n\tprivate _generateMessage(title, statusCode, statusMessage, method, url) {\n\t\tconst titleStr = title === undefined ? \"\" : String(title);\n\t\tconst statusCodeStr = statusCode === undefined ? \"\" : String(statusCode);\n\t\tconst statusMessageStr = statusMessage === undefined ? \"\" : String(statusMessage);\n\t\tconst methodStr = method === undefined ? \"\" : String(method);\n\t\tconst urlStr = url === undefined ? \"\" : String(url);\n\n\t\treturn (\n\t\t\t`HTTPError: ${titleStr}, statusCode:${statusCodeStr}, ` +\n\t\t\t`statusMessage:${statusMessageStr}, method:${methodStr}, url:${urlStr}`\n\t\t);\n\t}\n\n\t/**\n\t * Returns a string representing the HTTPError object\n\t * @returns a string representing the HTTPError object\n\t */\n\ttoString(): string {\n\t\tconst stack = this.stack === undefined ? \"\" : String(this.stack);\n\n\t\tconst isFirefox =\n\t\t\ttypeof window !== \"undefined\" &&\n\t\t\ttypeof window.navigator !== \"undefined\" &&\n\t\t\ttypeof window.navigator.userAgent !== \"undefined\" &&\n\t\t\twindow.navigator.userAgent.toLowerCase().includes(\"firefox\");\n\n\t\treturn isFirefox ? `${this.message}, stack:${stack}` : `stack:${stack}`;\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpErrorNoStack.d.ts","sourceRoot":"","sources":["../../src/error_objects/httpErrorNoStack.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,SAAS;
|
|
1
|
+
{"version":3,"file":"httpErrorNoStack.d.ts","sourceRoot":"","sources":["../../src/error_objects/httpErrorNoStack.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,SAAS;IAC9C,MAAM,CAAC,KAAK;;;MAAsB;IAElC;;;;;;;OAOG;gBACS,OAAO,CAAC,KAAA,EAAE,UAAU,CAAC,KAAA,EAAE,aAAa,CAAC,KAAA,EAAE,MAAM,CAAC,KAAA,EAAE,GAAG,CAAC,KAAA,EAAE,KAAK,CAAC,KAAA;IAMxE,QAAQ,IAAI,MAAM;CAGlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpErrorNoStack.js","sourceRoot":"","sources":["../../src/error_objects/httpErrorNoStack.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,SAAS;
|
|
1
|
+
{"version":3,"file":"httpErrorNoStack.js","sourceRoot":"","sources":["../../src/error_objects/httpErrorNoStack.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,SAAS;IAG9C;;;;;;;OAOG;IACH,YAAY,OAAQ,EAAE,UAAW,EAAE,aAAc,EAAE,MAAO,EAAE,GAAI,EAAE,KAAM;QACvE,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;QAC9D,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IAED,QAAQ;QACP,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;;AAlBM,sBAAK,GAAG,YAAY,CAAC,KAAK,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { HTTPError } from \"./httpError\";\nimport { FlaggedError } from \"./flaggedError\";\n\n/**\n * Class extending HTTPError without storing the stack\n */\nexport class HTTPErrorNoStack extends HTTPError {\n\tstatic FLAGS = FlaggedError.FLAGS;\n\n\t/**\n\t * @param message - The error message\n\t * @param statusCode - A numeric HTTP status code\n\t * @param statusMessage - A string message representing the response status message\n\t * @param method - The HTTP method used in the request\n\t * @param url - The URL that the request was sent to\n\t * @param flags - Flags that characterize the error. See {@link FlaggedError.FLAGS}.\n\t */\n\tconstructor(message?, statusCode?, statusMessage?, method?, url?, flags?) {\n\t\tsuper(message, statusCode, statusMessage, method, url, flags);\n\t\tObject.setPrototypeOf(this, HTTPErrorNoStack.prototype);\n\t\tdelete this.stack;\n\t}\n\n\ttoString(): string {\n\t\treturn this.message;\n\t}\n}\n"]}
|
|
@@ -13,13 +13,13 @@ export declare class OperationError extends Error {
|
|
|
13
13
|
stack: string | undefined;
|
|
14
14
|
readonly name: string;
|
|
15
15
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
* Instantiates an OperationError, which mimics the Error class with added properties
|
|
17
|
+
* meant for reporting the result of operations.
|
|
18
|
+
* @param message - The error message.
|
|
19
|
+
* @param operation - The operation name.
|
|
20
|
+
* @param statusCode - The operation result as a numerical status code.
|
|
21
|
+
* @param flags - Flags that characterize the error. See {@link FlaggedError.FLAGS}.
|
|
22
|
+
*/
|
|
23
23
|
constructor(message?: string, operation?: string | undefined, statusCode?: number | undefined, flags?: number);
|
|
24
24
|
isQuiet(): boolean;
|
|
25
25
|
isTransient(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operationError.d.ts","sourceRoot":"","sources":["../../src/error_objects/operationError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,qBAAa,cAAe,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"operationError.d.ts","sourceRoot":"","sources":["../../src/error_objects/operationError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,qBAAa,cAAe,SAAQ,KAAK;IAehC,SAAS,CAAC;IACV,UAAU,CAAC;IACX,KAAK,EAAE,MAAM;IAhBrB,MAAM,CAAC,KAAK;;;MAAsB;IAC3B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,SAAgB,IAAI,EAAE,MAAM,CAAC;IAE7B;;;;;;;OAOG;gBAEF,OAAO,CAAC,EAAE,MAAM,EACT,SAAS,CAAC,oBAAQ,EAClB,UAAU,CAAC,oBAAQ,EACnB,KAAK,GAAE,MAAU;IAQzB,OAAO;IAIP,WAAW;IAIX;;OAEG;IACH,OAAO,CAAC,cAAc;IAWtB,QAAQ,IAAI,MAAM;CA4BlB"}
|
|
@@ -12,13 +12,13 @@ import _ from "lodash";
|
|
|
12
12
|
import { FlaggedError } from "./flaggedError";
|
|
13
13
|
export class OperationError extends Error {
|
|
14
14
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
* Instantiates an OperationError, which mimics the Error class with added properties
|
|
16
|
+
* meant for reporting the result of operations.
|
|
17
|
+
* @param message - The error message.
|
|
18
|
+
* @param operation - The operation name.
|
|
19
|
+
* @param statusCode - The operation result as a numerical status code.
|
|
20
|
+
* @param flags - Flags that characterize the error. See {@link FlaggedError.FLAGS}.
|
|
21
|
+
*/
|
|
22
22
|
constructor(message, operation, statusCode, flags = 0) {
|
|
23
23
|
super(message);
|
|
24
24
|
this.operation = operation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operationError.js","sourceRoot":"","sources":["../../src/error_objects/operationError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,OAAO,cAAe,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"operationError.js","sourceRoot":"","sources":["../../src/error_objects/operationError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,OAAO,cAAe,SAAQ,KAAK;IAKxC;;;;;;;OAOG;IACH,YACC,OAAgB,EACT,SAAkB,EAClB,UAAmB,EACnB,QAAgB,CAAC;QAExB,KAAK,CAAC,OAAO,CAAC,CAAC;QAJR,cAAS,GAAT,SAAS,CAAS;QAClB,eAAU,GAAV,UAAU,CAAS;QACnB,UAAK,GAAL,KAAK,CAAY;QAGxB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC;IACnC,CAAC;IAED,OAAO;QACN,OAAO,YAAY,CAAC,SAAS,CAAC,OAAO,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C;QAE3B,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;YAC7B,GAAG,IAAI,YAAY,IAAI,CAAC,KAAK,EAAE,CAAC;SAChC;QAED,OAAO,GAAG,CAAC;IACZ,CAAC;;AAzEM,oBAAK,GAAG,YAAY,CAAC,KAAK,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * An operation error maintains additional information compared to a plain {@link #Error}:\n * - The operation name\n * - A status code\n * - Extensible flags. See {@link ExtendedError.FLAGS}.\n */\nimport _ from \"lodash\";\nimport { FlaggedError } from \"./flaggedError\";\n\nexport class OperationError extends Error {\n\tstatic FLAGS = FlaggedError.FLAGS;\n\tpublic stack: string | undefined;\n\tpublic readonly name: string;\n\n\t/**\n\t * Instantiates an OperationError, which mimics the Error class with added properties\n\t * meant for reporting the result of operations.\n\t * @param message - The error message.\n\t * @param operation - The operation name.\n\t * @param statusCode - The operation result as a numerical status code.\n\t * @param flags - Flags that characterize the error. See {@link FlaggedError.FLAGS}.\n\t */\n\tconstructor(\n\t\tmessage?: string,\n\t\tpublic operation?: string,\n\t\tpublic statusCode?: number,\n\t\tpublic flags: number = 0,\n\t) {\n\t\tsuper(message);\n\t\tObject.setPrototypeOf(this, OperationError.prototype);\n\t\tthis.name = \"OperationError\";\n\t\tthis.stack = Error(message).stack;\n\t}\n\n\tisQuiet() {\n\t\treturn FlaggedError.prototype.isQuiet.call(this);\n\t}\n\n\tisTransient() {\n\t\treturn FlaggedError.prototype.isTransient.call(this);\n\t}\n\n\t/**\n\t * @returns A string representation of the error flags.\n\t */\n\tprivate _flagsToString() {\n\t\tconst flagArray: string[] = [];\n\t\t_.mapValues(FlaggedError.FLAGS, (flagValue, flagName) => {\n\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\tif ((this.flags & flagValue) === flagValue) {\n\t\t\t\tflagArray.push(flagName);\n\t\t\t}\n\t\t});\n\t\treturn `${this.flags} [${flagArray.join(\",\")}]`;\n\t}\n\n\ttoString(): string {\n\t\tconst extendedFieldsArray: string[] = [];\n\t\tif (this.operation !== undefined) {\n\t\t\textendedFieldsArray.push(this.operation);\n\t\t}\n\n\t\tif (this.statusCode !== undefined) {\n\t\t\textendedFieldsArray.push(this.statusCode.toString());\n\t\t}\n\n\t\tif (this.flags) {\n\t\t\textendedFieldsArray.push(this._flagsToString.call(this));\n\t\t}\n\n\t\tlet msg = this.name;\n\n\t\tif (extendedFieldsArray.length > 0) {\n\t\t\tmsg += `[${extendedFieldsArray.join(\", \")}]`;\n\t\t}\n\n\t\tmsg += `: ${this.message}`;\n\n\t\tif (this.stack !== undefined) {\n\t\t\tmsg += `, stack: ${this.stack}`;\n\t\t}\n\n\t\treturn msg;\n\t}\n}\n"]}
|
package/lib/guidUtils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guidUtils.d.ts","sourceRoot":"","sources":["../src/guidUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"guidUtils.d.ts","sourceRoot":"","sources":["../src/guidUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqUH,eAAO,MAAM,SAAS;mCAhLP,WAAW,GAAG,UAAU,GAAG,MAAM,EAAE,WACzC,OAAO,KACb,MAAM;8BA+BC,MAAM,WACP,WAAW,KACjB,WAAW;8BAsBmB,MAAM;8BASN,MAAM;;wCAaS,MAAM;sBAwB7B,MAAM;6BA2DU,MAAM,YAAY,MAAM,uBAAmB,MAAM;qCAhD9E,WAAW,aACX,WAAW,0CAEpB,WAAW;CAqEb,CAAC"}
|
package/lib/guidUtils.js
CHANGED
|
@@ -70,8 +70,8 @@ const guidRNG = {
|
|
|
70
70
|
this.v ^= this.v >>> 13;
|
|
71
71
|
this.v ^= this.v << 17;
|
|
72
72
|
this.v = ((this.v >>> 5) ^ this.v) >>> 0;
|
|
73
|
-
this.w1 = multiply_uint32(33378,
|
|
74
|
-
this.w2 = multiply_uint32(57225,
|
|
73
|
+
this.w1 = multiply_uint32(33378, this.w1 & 0xffff) + (this.w1 >>> 16);
|
|
74
|
+
this.w2 = multiply_uint32(57225, this.w2 & 0xffff) + (this.w2 >>> 16);
|
|
75
75
|
let x = this.u ^ (this.u << 9);
|
|
76
76
|
x ^= x >>> 17;
|
|
77
77
|
x ^= x << 6;
|
|
@@ -102,7 +102,7 @@ function multiply_uint32(a, b) {
|
|
|
102
102
|
n >>>= 0;
|
|
103
103
|
m >>>= 0;
|
|
104
104
|
const nlo = n & 0xffff;
|
|
105
|
-
return (((n - nlo) * m >>> 0) +
|
|
105
|
+
return ((((n - nlo) * m) >>> 0) + nlo * m) >>> 0;
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
108
108
|
* Helper function to convert base64 encoding to url friendly format
|
|
@@ -121,7 +121,7 @@ const toUrlBase64 = (base64) => base64.replace(/\+/g, "-").replace(/\//g, "_").s
|
|
|
121
121
|
*/
|
|
122
122
|
const toPaddedBase64 = function (x) {
|
|
123
123
|
let base64 = x;
|
|
124
|
-
const padLength = 4 - base64.length % 4;
|
|
124
|
+
const padLength = 4 - (base64.length % 4);
|
|
125
125
|
base64 += "=".repeat(padLength);
|
|
126
126
|
return base64;
|
|
127
127
|
};
|
|
@@ -146,9 +146,8 @@ const uint32x4ToGUID = function (in_guidArray, base64 = false) {
|
|
|
146
146
|
let str = "";
|
|
147
147
|
for (let i = 0; i < 4; i++) {
|
|
148
148
|
const hex = in_guidArray[i].toString(16);
|
|
149
|
-
str +=
|
|
149
|
+
str += "0".repeat(8 - hex.length) + hex;
|
|
150
150
|
}
|
|
151
|
-
// eslint-disable-next-line max-len
|
|
152
151
|
return `${str.substr(0, 8)}-${str.substr(8, 4)}-${str.substr(12, 4)}-${str.substr(16, 4)}-${str.substr(20, 12)}`;
|
|
153
152
|
}
|
|
154
153
|
};
|
|
@@ -215,9 +214,9 @@ const generateGUID = function (base64 = false) {
|
|
|
215
214
|
// The last character is checked this way because last 4 bits of 22nd character are ignored
|
|
216
215
|
// by decoder, e.g. "+Q" and "+Z" result in the same decoding.
|
|
217
216
|
// The only characters with last 4 bits set to 0 are A, Q, g, w.
|
|
218
|
-
const reBase64 =
|
|
217
|
+
const reBase64 = /^[\w-]{21}[AQgw]$/;
|
|
219
218
|
// eslint-disable-next-line unicorn/no-unsafe-regex
|
|
220
|
-
const reBase16 =
|
|
219
|
+
const reBase16 = /^[\dA-Fa-f]{8}(?:-[\dA-Fa-f]{4}){3}-[\dA-Fa-f]{12}$/;
|
|
221
220
|
/**
|
|
222
221
|
* Routine used to check whether the given string is a valid GUID
|
|
223
222
|
*
|
|
@@ -281,7 +280,9 @@ const combineGuids = function (in_guid1, in_guid2, base64 = false) {
|
|
|
281
280
|
};
|
|
282
281
|
// Make sure the RNG is initialized
|
|
283
282
|
guidRNG.initialize();
|
|
284
|
-
const initializeGUIDGenerator = (...args) => {
|
|
283
|
+
const initializeGUIDGenerator = (...args) => {
|
|
284
|
+
guidRNG.initialize(...args);
|
|
285
|
+
};
|
|
285
286
|
export const GuidUtils = {
|
|
286
287
|
uint32x4ToGUID,
|
|
287
288
|
guidToUint32x4,
|
package/lib/guidUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guidUtils.js","sourceRoot":"","sources":["../src/guidUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,+BAA+B;AAE/B;;GAEG;AAEH,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAEnC;;;;;;GAMG;AACH,MAAM,OAAO,GAAG;IACZ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,aAAa,EAAE,KAAK;IAEpB;;;;;;;;;;;;OAYG;IACH,UAAU,CAAC,OAAgB,EAAE,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AC;AAC5C,CAAC,CAAC;AAEF,mCAAmC;AACnC,OAAO,CAAC,UAAU,EAAE,CAAC;AAErB,MAAM,uBAAuB,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9E,MAAM,CAAC,MAAM,SAAS,GAAG;IACrB,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,uBAAuB;IACvB,YAAY;IACZ,MAAM;IACN,YAAY;IACZ,mBAAmB;CACtB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable no-bitwise */\n\n/**\n * @fileoverview Utility functions related to handling GUIDs\n */\n\nimport base64js from \"base64-js\";\nimport { generateRandomUInt32Array } from \"../platform-dependent\";\nconst UINT_32HASH_PRIME = 16777619;\n\n/**\n * Fast high quality 32 bit RNG for consistent GUID.\n *\n * Good \"randomness\" (distribution); Period is approximately equal to 3.11*10^37\n * Implementation was take from \"Numerical recipes. The Art of Scientific Computing.\", 3rd edition.\n * Page 357, algorithm name: Ranlim32\n */\nconst guidRNG = {\n u: 0,\n v: 0,\n w1: 0,\n w2: 0,\n isInitialized: false,\n\n /**\n * Initialize RNG.\n * This function need to be called once, before the first GUID gets created.\n *\n * @param in_seed - Optional 32-bit seed for GUID RNG.\n * If no seed is given, a combination of system's local time and `Math.random()` is used.\n * @param in_enforceReInitialization - Optionally enforce re-initialization with another seed.\n *\n * @returns The seed used to initialize the RNG;\n * If re-initialization is not enforced, a zero indicates that the RNG was not re-seeded.\n *\n * @alias property-common.initializeGUIDGenerator\n */\n initialize(in_seed?: number, in_enforceReInitialization: boolean = false): number {\n // Quit if the RNG has already been initialized and we do not\n // want to enforce a re-initialization with a new seed\n if (this.isInitialized && !in_enforceReInitialization) {\n return 0;\n } else {\n this.isInitialized = true;\n\n if (in_seed === undefined) {\n const randomValues = generateRandomUInt32Array(4);\n this.u = randomValues[0];\n this.v = randomValues[1];\n this.w1 = randomValues[2];\n this.w2 = randomValues[3];\n } else {\n this.v = 224461437;\n this.w1 = 521288629;\n this.w2 = 362436069;\n\n this.u = in_seed ^ this.v;\n this.genRandUInt32();\n this.v = this.u;\n this.genRandUInt32();\n }\n return -1;\n }\n },\n\n /**\n * @returns 32-bit random number based on the RNGs internal state\n */\n genRandUInt32(): number {\n this.u = multiply_uint32(this.u, 2891336453) + 1640531513;\n this.v ^= this.v >>> 13;\n this.v ^= this.v << 17;\n this.v = ((this.v >>> 5) ^ this.v) >>> 0;\n\n this.w1 = multiply_uint32(33378, (this.w1 & 0xffff)) + (this.w1 >>> 16);\n this.w2 = multiply_uint32(57225, (this.w2 & 0xffff)) + (this.w2 >>> 16);\n\n let x = this.u ^ (this.u << 9);\n x ^= x >>> 17;\n x ^= x << 6;\n\n let y = this.w1 ^ (this.w1 << 17);\n y ^= y >>> 15;\n y ^= y << 5;\n return (((x >>> 0) + this.v) ^ ((y >>> 0) + this.w2)) >>> 0;\n },\n};\n\n/**\n * Check if GUID is base64 based on the length\n * The length of base16 GUID is 36, base64 - 22\n *\n * @param GUID - Input GUID\n * @returns True if GUID is base64\n */\nconst isBase64 = (GUID: string): boolean => GUID.length === 22;\n\n/**\n * Allows for 32-bit integer multiplication with C-like semantics\n *\n * @param a - unsigned int32 value\n * @param b - unsigned int32 value\n * @returns - result of unsigned integer multiplication\n */\nfunction multiply_uint32(a: number, b: number): number {\n let n = a;\n let m = b;\n\n n >>>= 0;\n m >>>= 0;\n const nlo = n & 0xffff;\n return (((n - nlo) * m >>> 0) + (nlo * m)) >>> 0;\n}\n\n/**\n * Helper function to convert base64 encoding to url friendly format\n *\n * @param base64 - Base64 string\n *\n * @returns Url-friendly base64 encoding.\n */\nconst toUrlBase64 = (base64: string): string => base64.replace(/\\+/g, \"-\").replace(/\\//g, \"_\").split(\"=\")[0];\n\n/**\n * Helper function to recover padding of base64 encoding\n *\n * @param x - Base64 string\n *\n * @returns Padded base64 encoding.\n */\nconst toPaddedBase64 = function(x: string): string {\n let base64 = x;\n const padLength = 4 - base64.length % 4;\n base64 += \"=\".repeat(padLength);\n return base64;\n};\n\n/**\n * Helper function to create a GUID string from an array with 32Bit values\n *\n * @param in_guidArray - Array with the 32 bit values\n * @param base64 - Use base64 encoding instead of standart guids\n *\n * @returns The GUID\n */\nconst uint32x4ToGUID = function(in_guidArray: Uint32Array | Int32Array | number[], base64: boolean = false): string {\n if (base64) {\n const intArray = new Uint32Array(in_guidArray);\n const byteArray = new Uint8Array(intArray.buffer);\n const base64guid = base64js.fromByteArray(byteArray);\n // return url-friendly base64\n return toUrlBase64(base64guid);\n } else {\n // Convert to hexadecimal string\n let str = \"\";\n for (let i = 0; i < 4; i++) {\n const hex = in_guidArray[i].toString(16);\n str += (\"0\".repeat(8 - hex.length) + hex);\n }\n // eslint-disable-next-line max-len\n return `${str.substr(0, 8)}-${str.substr(8, 4)}-${str.substr(12, 4)}-${str.substr(16, 4)}-${str.substr(20, 12)}`;\n }\n};\n\n/**\n * Convert GUID to four 32Bit values.\n *\n * @param in_guid - The GUID to convert\n * @param io_result - An optional array to write the result to.\n * If no array is given, a new one gets created.\n * @returns Four 32-bit values\n *\n */\nconst guidToUint32x4 = function(in_guid: string, result: Uint32Array = new Uint32Array(4)): Uint32Array {\n if (isBase64(in_guid)) {\n const GUID = toPaddedBase64(in_guid);\n const bytes = base64js.toByteArray(GUID);\n const intArray = new Uint32Array(bytes.buffer);\n result.set(intArray);\n } else {\n result[0] = parseInt(`0x${in_guid.substr(0, 8)}`, 16);\n result[1] = parseInt(`0x${in_guid.substr(9, 4)}${in_guid.substr(14, 4)}`, 16);\n result[2] = parseInt(`0x${in_guid.substr(19, 4)}${in_guid.substr(24, 4)}`, 16);\n result[3] = parseInt(`0x${in_guid.substr(28, 8)}`, 16);\n }\n return result;\n};\n\n/**\n * Convert base64 GUID into base16.\n *\n * @param in_guid - Base64 GUID to convert\n * @returns Base16 GUID\n *\n */\nconst base64Tobase16 = (in_guid: string) => uint32x4ToGUID(guidToUint32x4(in_guid));\n\n/**\n * Convert base16 into base64 GUID.\n *\n * @param in_guid - Base16 GUID to convert\n * @returns Base64 GUID\n *\n */\nconst base16ToBase64 = (in_guid: string) => uint32x4ToGUID(guidToUint32x4(in_guid), true);\n\n/**\n * Based on the boolean parameter generate either\n * a 128 bit base16 GUID with the following format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx\n * or url-friendly base64 string GUID of length 22\n *\n * This function is *not* thread safe!\n *\n * @param base64 - Use base64 encoding instead of standart guids\n *\n * @returns The GUID\n */\nconst generateGUID = function(base64 = false): string {\n const rnds = new Uint32Array(4);\n\n // Random numbers for GUID (4x32 bit)\n rnds[0] = guidRNG.genRandUInt32();\n rnds[1] = guidRNG.genRandUInt32();\n rnds[2] = guidRNG.genRandUInt32();\n rnds[3] = guidRNG.genRandUInt32();\n return uint32x4ToGUID(rnds, base64);\n};\n\n// The last character is checked this way because last 4 bits of 22nd character are ignored\n// by decoder, e.g. \"+Q\" and \"+Z\" result in the same decoding.\n// The only characters with last 4 bits set to 0 are A, Q, g, w.\nconst reBase64 = (/^[\\w-]{21}[AQgw]$/);\n// eslint-disable-next-line unicorn/no-unsafe-regex\nconst reBase16 = (/^[\\dA-Fa-f]{8}(?:-[\\dA-Fa-f]{4}){3}-[\\dA-Fa-f]{12}$/);\n\n/**\n * Routine used to check whether the given string is a valid GUID\n *\n * @param in_guid - The GUID to test.\n * @returns True if the parameter is a valid GUID, false otherwise.\n */\nconst isGUID = (in_guid: string) => reBase16.test(in_guid) || reBase64.test(in_guid);\n\n/**\n * Performs a hash combination operation on the two supplied Uint32 arrays of length 4 (using\n * a variant of the algorithm from boost::hash_combine\n *\n * @param in_array1 - First array\n * @param in_array2 - Second array\n * @returns New combined hash\n */\nconst hashCombine4xUint32 = function(\n in_array1: Uint32Array,\n in_array2: Uint32Array,\n io_result?: Uint32Array,\n): Uint32Array {\n let accumulated = io_result;\n if (accumulated === undefined) {\n accumulated = new Uint32Array(in_array2);\n } else {\n accumulated[0] = in_array2[0];\n accumulated[1] = in_array2[1];\n accumulated[2] = in_array2[2];\n accumulated[3] = in_array2[3];\n }\n\n accumulated[0] += 0x9e3779b9;\n accumulated[1] += 0x638f227;\n accumulated[2] += 0x1aff2bad;\n accumulated[3] += 0x3a8f05c5;\n\n accumulated[0] += in_array1[3] << 6;\n accumulated[1] += in_array1[0] << 6;\n accumulated[2] += in_array1[1] << 6;\n accumulated[3] += in_array1[2] << 6;\n\n accumulated[0] += in_array1[2] >> 2;\n accumulated[1] += in_array1[3] >> 2;\n accumulated[2] += in_array1[0] >> 2;\n accumulated[3] += in_array1[1] >> 2;\n\n accumulated[0] = ((accumulated[0] ^ in_array1[1]) * UINT_32HASH_PRIME) >>> 0;\n accumulated[1] = ((accumulated[1] ^ in_array1[2]) * UINT_32HASH_PRIME) >>> 0;\n accumulated[2] = ((accumulated[2] ^ in_array1[3]) * UINT_32HASH_PRIME) >>> 0;\n accumulated[3] = ((accumulated[3] ^ in_array1[0]) * UINT_32HASH_PRIME) >>> 0;\n\n return accumulated;\n};\n\n/**\n * Takes two guids and generates a new derived GUID.\n *\n * @remarks Note: You should only use this helper function when you need only one combination.\n * Otherwise, it is more efficient to work on the uint8 arrays directly.\n *\n * @param in_guid1 - Input GUID\n * @param in_guid2 - Input GUID\n * @param base64 - Use base64 encoding instead of standart GUIDs\n * @returns Combined GUID\n */\nconst combineGuids = function(in_guid1: string, in_guid2: string, base64 = false): string {\n const firstArray = guidToUint32x4(in_guid1);\n const secondArray = guidToUint32x4(in_guid2);\n const combined = hashCombine4xUint32(firstArray, secondArray);\n return uint32x4ToGUID(combined, base64);\n};\n\n// Make sure the RNG is initialized\nguidRNG.initialize();\n\nconst initializeGUIDGenerator = (...args) => { guidRNG.initialize(...args); };\n\nexport const GuidUtils = {\n uint32x4ToGUID,\n guidToUint32x4,\n base64Tobase16,\n base16ToBase64,\n initializeGUIDGenerator,\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AAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAE7E,OAAO,WAAW,CAAC;AACpB,CAAC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,YAAY,GAAG,UAAU,QAAgB,EAAE,QAAgB,EAAE,MAAM,GAAG,KAAK;IAChF,MAAM,UAAU,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,WAAW,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,mBAAmB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;IAC9D,OAAO,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AACzC,CAAC,CAAC;AAEF,mCAAmC;AACnC,OAAO,CAAC,UAAU,EAAE,CAAC;AAErB,MAAM,uBAAuB,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE;IAC3C,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,CAAC;AAC7B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG;IACxB,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,uBAAuB;IACvB,YAAY;IACZ,MAAM;IACN,YAAY;IACZ,mBAAmB;CACnB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable no-bitwise */\n\n/**\n * @fileoverview Utility functions related to handling GUIDs\n */\n\nimport base64js from \"base64-js\";\nimport { generateRandomUInt32Array } from \"../platform-dependent\";\nconst UINT_32HASH_PRIME = 16777619;\n\n/**\n * Fast high quality 32 bit RNG for consistent GUID.\n *\n * Good \"randomness\" (distribution); Period is approximately equal to 3.11*10^37\n * Implementation was take from \"Numerical recipes. The Art of Scientific Computing.\", 3rd edition.\n * Page 357, algorithm name: Ranlim32\n */\nconst guidRNG = {\n\tu: 0,\n\tv: 0,\n\tw1: 0,\n\tw2: 0,\n\tisInitialized: false,\n\n\t/**\n\t * Initialize RNG.\n\t * This function need to be called once, before the first GUID gets created.\n\t *\n\t * @param in_seed - Optional 32-bit seed for GUID RNG.\n\t * If no seed is given, a combination of system's local time and `Math.random()` is used.\n\t * @param in_enforceReInitialization - Optionally enforce re-initialization with another seed.\n\t *\n\t * @returns The seed used to initialize the RNG;\n\t * If re-initialization is not enforced, a zero indicates that the RNG was not re-seeded.\n\t *\n\t * @alias property-common.initializeGUIDGenerator\n\t */\n\tinitialize(in_seed?: number, in_enforceReInitialization: boolean = false): number {\n\t\t// Quit if the RNG has already been initialized and we do not\n\t\t// want to enforce a re-initialization with a new seed\n\t\tif (this.isInitialized && !in_enforceReInitialization) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\tthis.isInitialized = true;\n\n\t\t\tif (in_seed === undefined) {\n\t\t\t\tconst randomValues = generateRandomUInt32Array(4);\n\t\t\t\tthis.u = randomValues[0];\n\t\t\t\tthis.v = randomValues[1];\n\t\t\t\tthis.w1 = randomValues[2];\n\t\t\t\tthis.w2 = randomValues[3];\n\t\t\t} else {\n\t\t\t\tthis.v = 224461437;\n\t\t\t\tthis.w1 = 521288629;\n\t\t\t\tthis.w2 = 362436069;\n\n\t\t\t\tthis.u = in_seed ^ this.v;\n\t\t\t\tthis.genRandUInt32();\n\t\t\t\tthis.v = this.u;\n\t\t\t\tthis.genRandUInt32();\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\t},\n\n\t/**\n\t * @returns 32-bit random number based on the RNGs internal state\n\t */\n\tgenRandUInt32(): number {\n\t\tthis.u = multiply_uint32(this.u, 2891336453) + 1640531513;\n\t\tthis.v ^= this.v >>> 13;\n\t\tthis.v ^= this.v << 17;\n\t\tthis.v = ((this.v >>> 5) ^ this.v) >>> 0;\n\n\t\tthis.w1 = multiply_uint32(33378, this.w1 & 0xffff) + (this.w1 >>> 16);\n\t\tthis.w2 = multiply_uint32(57225, this.w2 & 0xffff) + (this.w2 >>> 16);\n\n\t\tlet x = this.u ^ (this.u << 9);\n\t\tx ^= x >>> 17;\n\t\tx ^= x << 6;\n\n\t\tlet y = this.w1 ^ (this.w1 << 17);\n\t\ty ^= y >>> 15;\n\t\ty ^= y << 5;\n\t\treturn (((x >>> 0) + this.v) ^ ((y >>> 0) + this.w2)) >>> 0;\n\t},\n};\n\n/**\n * Check if GUID is base64 based on the length\n * The length of base16 GUID is 36, base64 - 22\n *\n * @param GUID - Input GUID\n * @returns True if GUID is base64\n */\nconst isBase64 = (GUID: string): boolean => GUID.length === 22;\n\n/**\n * Allows for 32-bit integer multiplication with C-like semantics\n *\n * @param a - unsigned int32 value\n * @param b - unsigned int32 value\n * @returns - result of unsigned integer multiplication\n */\nfunction multiply_uint32(a: number, b: number): number {\n\tlet n = a;\n\tlet m = b;\n\n\tn >>>= 0;\n\tm >>>= 0;\n\tconst nlo = n & 0xffff;\n\treturn ((((n - nlo) * m) >>> 0) + nlo * m) >>> 0;\n}\n\n/**\n * Helper function to convert base64 encoding to url friendly format\n *\n * @param base64 - Base64 string\n *\n * @returns Url-friendly base64 encoding.\n */\nconst toUrlBase64 = (base64: string): string =>\n\tbase64.replace(/\\+/g, \"-\").replace(/\\//g, \"_\").split(\"=\")[0];\n\n/**\n * Helper function to recover padding of base64 encoding\n *\n * @param x - Base64 string\n *\n * @returns Padded base64 encoding.\n */\nconst toPaddedBase64 = function (x: string): string {\n\tlet base64 = x;\n\tconst padLength = 4 - (base64.length % 4);\n\tbase64 += \"=\".repeat(padLength);\n\treturn base64;\n};\n\n/**\n * Helper function to create a GUID string from an array with 32Bit values\n *\n * @param in_guidArray - Array with the 32 bit values\n * @param base64 - Use base64 encoding instead of standart guids\n *\n * @returns The GUID\n */\nconst uint32x4ToGUID = function (\n\tin_guidArray: Uint32Array | Int32Array | number[],\n\tbase64: boolean = false,\n): string {\n\tif (base64) {\n\t\tconst intArray = new Uint32Array(in_guidArray);\n\t\tconst byteArray = new Uint8Array(intArray.buffer);\n\t\tconst base64guid = base64js.fromByteArray(byteArray);\n\t\t// return url-friendly base64\n\t\treturn toUrlBase64(base64guid);\n\t} else {\n\t\t// Convert to hexadecimal string\n\t\tlet str = \"\";\n\t\tfor (let i = 0; i < 4; i++) {\n\t\t\tconst hex = in_guidArray[i].toString(16);\n\t\t\tstr += \"0\".repeat(8 - hex.length) + hex;\n\t\t}\n\t\treturn `${str.substr(0, 8)}-${str.substr(8, 4)}-${str.substr(12, 4)}-${str.substr(\n\t\t\t16,\n\t\t\t4,\n\t\t)}-${str.substr(20, 12)}`;\n\t}\n};\n\n/**\n * Convert GUID to four 32Bit values.\n *\n * @param in_guid - The GUID to convert\n * @param io_result - An optional array to write the result to.\n * If no array is given, a new one gets created.\n * @returns Four 32-bit values\n *\n */\nconst guidToUint32x4 = function (\n\tin_guid: string,\n\tresult: Uint32Array = new Uint32Array(4),\n): Uint32Array {\n\tif (isBase64(in_guid)) {\n\t\tconst GUID = toPaddedBase64(in_guid);\n\t\tconst bytes = base64js.toByteArray(GUID);\n\t\tconst intArray = new Uint32Array(bytes.buffer);\n\t\tresult.set(intArray);\n\t} else {\n\t\tresult[0] = parseInt(`0x${in_guid.substr(0, 8)}`, 16);\n\t\tresult[1] = parseInt(`0x${in_guid.substr(9, 4)}${in_guid.substr(14, 4)}`, 16);\n\t\tresult[2] = parseInt(`0x${in_guid.substr(19, 4)}${in_guid.substr(24, 4)}`, 16);\n\t\tresult[3] = parseInt(`0x${in_guid.substr(28, 8)}`, 16);\n\t}\n\treturn result;\n};\n\n/**\n * Convert base64 GUID into base16.\n *\n * @param in_guid - Base64 GUID to convert\n * @returns Base16 GUID\n *\n */\nconst base64Tobase16 = (in_guid: string) => uint32x4ToGUID(guidToUint32x4(in_guid));\n\n/**\n * Convert base16 into base64 GUID.\n *\n * @param in_guid - Base16 GUID to convert\n * @returns Base64 GUID\n *\n */\nconst base16ToBase64 = (in_guid: string) => uint32x4ToGUID(guidToUint32x4(in_guid), true);\n\n/**\n * Based on the boolean parameter generate either\n * a 128 bit base16 GUID with the following format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx\n * or url-friendly base64 string GUID of length 22\n *\n * This function is *not* thread safe!\n *\n * @param base64 - Use base64 encoding instead of standart guids\n *\n * @returns The GUID\n */\nconst generateGUID = function (base64 = false): string {\n\tconst rnds = new Uint32Array(4);\n\n\t// Random numbers for GUID (4x32 bit)\n\trnds[0] = guidRNG.genRandUInt32();\n\trnds[1] = guidRNG.genRandUInt32();\n\trnds[2] = guidRNG.genRandUInt32();\n\trnds[3] = guidRNG.genRandUInt32();\n\treturn uint32x4ToGUID(rnds, base64);\n};\n\n// The last character is checked this way because last 4 bits of 22nd character are ignored\n// by decoder, e.g. \"+Q\" and \"+Z\" result in the same decoding.\n// The only characters with last 4 bits set to 0 are A, Q, g, w.\nconst reBase64 = /^[\\w-]{21}[AQgw]$/;\n// eslint-disable-next-line unicorn/no-unsafe-regex\nconst reBase16 = /^[\\dA-Fa-f]{8}(?:-[\\dA-Fa-f]{4}){3}-[\\dA-Fa-f]{12}$/;\n\n/**\n * Routine used to check whether the given string is a valid GUID\n *\n * @param in_guid - The GUID to test.\n * @returns True if the parameter is a valid GUID, false otherwise.\n */\nconst isGUID = (in_guid: string) => reBase16.test(in_guid) || reBase64.test(in_guid);\n\n/**\n * Performs a hash combination operation on the two supplied Uint32 arrays of length 4 (using\n * a variant of the algorithm from boost::hash_combine\n *\n * @param in_array1 - First array\n * @param in_array2 - Second array\n * @returns New combined hash\n */\nconst hashCombine4xUint32 = function (\n\tin_array1: Uint32Array,\n\tin_array2: Uint32Array,\n\tio_result?: Uint32Array,\n): Uint32Array {\n\tlet accumulated = io_result;\n\tif (accumulated === undefined) {\n\t\taccumulated = new Uint32Array(in_array2);\n\t} else {\n\t\taccumulated[0] = in_array2[0];\n\t\taccumulated[1] = in_array2[1];\n\t\taccumulated[2] = in_array2[2];\n\t\taccumulated[3] = in_array2[3];\n\t}\n\n\taccumulated[0] += 0x9e3779b9;\n\taccumulated[1] += 0x638f227;\n\taccumulated[2] += 0x1aff2bad;\n\taccumulated[3] += 0x3a8f05c5;\n\n\taccumulated[0] += in_array1[3] << 6;\n\taccumulated[1] += in_array1[0] << 6;\n\taccumulated[2] += in_array1[1] << 6;\n\taccumulated[3] += in_array1[2] << 6;\n\n\taccumulated[0] += in_array1[2] >> 2;\n\taccumulated[1] += in_array1[3] >> 2;\n\taccumulated[2] += in_array1[0] >> 2;\n\taccumulated[3] += in_array1[1] >> 2;\n\n\taccumulated[0] = ((accumulated[0] ^ in_array1[1]) * UINT_32HASH_PRIME) >>> 0;\n\taccumulated[1] = ((accumulated[1] ^ in_array1[2]) * UINT_32HASH_PRIME) >>> 0;\n\taccumulated[2] = ((accumulated[2] ^ in_array1[3]) * UINT_32HASH_PRIME) >>> 0;\n\taccumulated[3] = ((accumulated[3] ^ in_array1[0]) * UINT_32HASH_PRIME) >>> 0;\n\n\treturn accumulated;\n};\n\n/**\n * Takes two guids and generates a new derived GUID.\n *\n * @remarks Note: You should only use this helper function when you need only one combination.\n * Otherwise, it is more efficient to work on the uint8 arrays directly.\n *\n * @param in_guid1 - Input GUID\n * @param in_guid2 - Input GUID\n * @param base64 - Use base64 encoding instead of standart GUIDs\n * @returns Combined GUID\n */\nconst combineGuids = function (in_guid1: string, in_guid2: string, base64 = false): string {\n\tconst firstArray = guidToUint32x4(in_guid1);\n\tconst secondArray = guidToUint32x4(in_guid2);\n\tconst combined = hashCombine4xUint32(firstArray, secondArray);\n\treturn uint32x4ToGUID(combined, base64);\n};\n\n// Make sure the RNG is initialized\nguidRNG.initialize();\n\nconst initializeGUIDGenerator = (...args) => {\n\tguidRNG.initialize(...args);\n};\n\nexport const GuidUtils = {\n\tuint32x4ToGUID,\n\tguidToUint32x4,\n\tbase64Tobase16,\n\tbase16ToBase64,\n\tinitializeGUIDGenerator,\n\tgenerateGUID,\n\tisGUID,\n\tcombineGuids,\n\thashCombine4xUint32,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hashCalculator.d.ts","sourceRoot":"","sources":["../src/hashCalculator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,wBAAgB,aAAa,CAAC,GAAG,KAAA,EAAE,IAAI,SAAI,
|
|
1
|
+
{"version":3,"file":"hashCalculator.d.ts","sourceRoot":"","sources":["../src/hashCalculator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,wBAAgB,aAAa,CAAC,GAAG,KAAA,EAAE,IAAI,SAAI,UAM1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hashCalculator.js","sourceRoot":"","sources":["../src/hashCalculator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AAEH,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,MAAM,UAAU,aAAa,CAAC,GAAG,EAAE,IAAI,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"hashCalculator.js","sourceRoot":"","sources":["../src/hashCalculator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AAEH,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,MAAM,UAAU,aAAa,CAAC,GAAG,EAAE,IAAI,GAAG,CAAC;IAC1C,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC/C,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,CAChF,EAAE,EACF,CAAC,CACD,IAAI,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;AAC3B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Utility class to compute an hash for a given set of variables\n * using the murmur3 hash (see https://code.google.com/p/smhasher/)\n */\n\nimport murmurHash3 from \"murmurhash3js\";\n\nexport function calculateHash(key, seed = 0) {\n\tconst str = murmurHash3.x86.hash128(key, seed);\n\treturn `${str.substr(0, 8)}-${str.substr(8, 4)}-${str.substr(12, 4)}-${str.substr(\n\t\t16,\n\t\t4,\n\t)}-${str.substr(20, 12)}`;\n}\n"]}
|
package/lib/joinPaths.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"joinPaths.d.ts","sourceRoot":"","sources":["../src/joinPaths.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH;;;;;;;;;GASG;AACH,wBAAgB,SAAS,
|
|
1
|
+
{"version":3,"file":"joinPaths.d.ts","sourceRoot":"","sources":["../src/joinPaths.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CACxB,UAAU,GAAE,MAAW,EACvB,UAAU,GAAE,MAAW,EACvB,YAAY,GAAE,MAAY,GACxB,MAAM,CAYR"}
|
package/lib/joinPaths.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"joinPaths.js","sourceRoot":"","sources":["../src/joinPaths.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH;;;;;;;;;GASG;AACH,MAAM,UAAU,SAAS,
|
|
1
|
+
{"version":3,"file":"joinPaths.js","sourceRoot":"","sources":["../src/joinPaths.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH;;;;;;;;;GASG;AACH,MAAM,UAAU,SAAS,CACxB,aAAqB,EAAE,EACvB,aAAqB,EAAE,EACvB,eAAuB,GAAG;IAE1B,IAAI,SAAS,GAAG,YAAY,CAAC;IAE7B,IACC,CAAC,UAAU;QACX,CAAC,UAAU;QACX,UAAU,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,YAAY;QACxD,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,KAAK,YAAY,EACzD;QACD,SAAS,GAAG,EAAE,CAAC;KACf;IACD,OAAO,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;AAC5C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview implements a joinPaths routine to merge two paths.\n */\n\n/**\n * Merges two strings with a separator. If one of the two is empty no separator will be added.\n * No duplicated separators will be joined\n *\n * @param in_string1 - The first string to join\n * @param in_string2 - The second string to join\n * @param in_separator - The path separator\n *\n * @returns The joined path\n */\nexport function joinPaths(\n\tin_string1: string = \"\",\n\tin_string2: string = \"\",\n\tin_separator: string = \"/\",\n): string {\n\tlet separator = in_separator;\n\n\tif (\n\t\t!in_string1 ||\n\t\t!in_string2 ||\n\t\tin_string1.substr(-in_separator.length) === in_separator ||\n\t\tin_string2.substr(0, in_separator.length) === in_separator\n\t) {\n\t\tseparator = \"\";\n\t}\n\treturn in_string1 + separator + in_string2;\n}\n"]}
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluid-experimental/property-common";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-dev.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-dev.4.1.0.148229";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export const pkgName = "@fluid-experimental/property-common";
|
|
8
|
-
export const pkgVersion = "2.0.0-dev.
|
|
8
|
+
export const pkgVersion = "2.0.0-dev.4.1.0.148229";
|
|
9
9
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,qCAAqC,CAAC;AAC7D,MAAM,CAAC,MAAM,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluid-experimental/property-common\";\nexport const pkgVersion = \"2.0.0-dev.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,qCAAqC,CAAC;AAC7D,MAAM,CAAC,MAAM,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluid-experimental/property-common\";\nexport const pkgVersion = \"2.0.0-dev.4.1.0.148229\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-experimental/property-common",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.4.1.0.148229",
|
|
4
4
|
"description": "common functions used in properties",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -13,30 +13,6 @@
|
|
|
13
13
|
"main": "dist/index.js",
|
|
14
14
|
"module": "lib/index.js",
|
|
15
15
|
"types": "dist/index.d.ts",
|
|
16
|
-
"scripts": {
|
|
17
|
-
"build": "npm run build:genver && concurrently npm:build:compile npm:lint && npm run build:docs",
|
|
18
|
-
"build:commonjs": "npm run tsc && npm run build:test",
|
|
19
|
-
"build:compile": "concurrently npm:build:commonjs npm:build:esnext",
|
|
20
|
-
"build:docs": "api-extractor run --local && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../_api-extractor-temp/",
|
|
21
|
-
"build:esnext": "tsc --project ./tsconfig.esnext.json",
|
|
22
|
-
"build:full": "npm run build",
|
|
23
|
-
"build:full:compile": "npm run build:compile",
|
|
24
|
-
"build:genver": "gen-version",
|
|
25
|
-
"build:test": "tsc --project ./src/test/tsconfig.json",
|
|
26
|
-
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
|
|
27
|
-
"eslint": "eslint --format stylish src",
|
|
28
|
-
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
29
|
-
"format": "npm run prettier:fix",
|
|
30
|
-
"lint": "npm run eslint",
|
|
31
|
-
"lint:fix": "npm run eslint:fix",
|
|
32
|
-
"prettier": "prettier --check . --ignore-path ../../../.prettierignore",
|
|
33
|
-
"prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
|
|
34
|
-
"test": "npm run test:mocha",
|
|
35
|
-
"test:coverage": "nyc npm test -- --reporter xunit --reporter-option output=nyc/junit-report.xml",
|
|
36
|
-
"test:mocha": "mocha --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
|
|
37
|
-
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
|
|
38
|
-
"tsc": "tsc"
|
|
39
|
-
},
|
|
40
16
|
"nyc": {
|
|
41
17
|
"all": true,
|
|
42
18
|
"cache-dir": "nyc/.cache",
|
|
@@ -69,33 +45,59 @@
|
|
|
69
45
|
"traverse": "0.6.6"
|
|
70
46
|
},
|
|
71
47
|
"devDependencies": {
|
|
72
|
-
"@fluid-experimental/property-common-previous": "npm:@fluid-experimental/property-common@2.0.0-internal.2.1.0",
|
|
73
48
|
"@fluidframework/build-common": "^1.1.0",
|
|
74
|
-
"@fluidframework/eslint-config-fluid": "^
|
|
75
|
-
"@fluidframework/mocha-test-setup": "
|
|
76
|
-
"@microsoft/api-extractor": "^7.
|
|
77
|
-
"@
|
|
49
|
+
"@fluidframework/eslint-config-fluid": "^2.0.0",
|
|
50
|
+
"@fluidframework/mocha-test-setup": "2.0.0-dev.4.1.0.148229",
|
|
51
|
+
"@microsoft/api-extractor": "^7.34.4",
|
|
52
|
+
"@types/chai": "^4.0.0",
|
|
78
53
|
"@types/debug": "^4.1.5",
|
|
54
|
+
"@types/lodash": "^4.14.118",
|
|
79
55
|
"@types/mocha": "^9.1.1",
|
|
80
|
-
"@types/node": "^14.18.
|
|
56
|
+
"@types/node": "^14.18.38",
|
|
57
|
+
"@types/semver": "^7.3.6",
|
|
81
58
|
"chai": "^4.2.0",
|
|
82
|
-
"concurrently": "^6.
|
|
59
|
+
"concurrently": "^7.6.0",
|
|
83
60
|
"copyfiles": "^2.4.1",
|
|
84
|
-
"cross-env": "^7.0.
|
|
61
|
+
"cross-env": "^7.0.3",
|
|
85
62
|
"eslint": "~8.6.0",
|
|
86
|
-
"mocha": "^10.
|
|
63
|
+
"mocha": "^10.2.0",
|
|
64
|
+
"mocha-json-output-reporter": "^2.0.1",
|
|
65
|
+
"mocha-multi-reporters": "^1.5.1",
|
|
66
|
+
"moment": "^2.21.0",
|
|
87
67
|
"nock": "^10.0.1",
|
|
88
|
-
"nyc": "^15.
|
|
68
|
+
"nyc": "^15.1.0",
|
|
89
69
|
"prettier": "~2.6.2",
|
|
90
|
-
"rimraf": "^
|
|
70
|
+
"rimraf": "^4.4.0",
|
|
91
71
|
"sinon": "^7.4.2",
|
|
92
72
|
"typescript": "~4.5.5"
|
|
93
73
|
},
|
|
94
74
|
"typeValidation": {
|
|
95
75
|
"disabled": true,
|
|
96
|
-
"version": "2.0.0-internal.2.2.0",
|
|
97
|
-
"baselineRange": ">=2.0.0-internal.2.1.0 <2.0.0-internal.2.2.0",
|
|
98
|
-
"baselineVersion": "2.0.0-internal.2.1.0",
|
|
99
76
|
"broken": {}
|
|
77
|
+
},
|
|
78
|
+
"scripts": {
|
|
79
|
+
"build": "npm run build:genver && concurrently npm:build:compile npm:lint && npm run build:docs",
|
|
80
|
+
"build:commonjs": "npm run tsc && npm run build:test",
|
|
81
|
+
"build:compile": "concurrently npm:build:commonjs npm:build:esnext",
|
|
82
|
+
"build:docs": "api-extractor run --local && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../../_api-extractor-temp/",
|
|
83
|
+
"build:esnext": "tsc --project ./tsconfig.esnext.json",
|
|
84
|
+
"build:full": "npm run build",
|
|
85
|
+
"build:full:compile": "npm run build:compile",
|
|
86
|
+
"build:genver": "gen-version",
|
|
87
|
+
"build:test": "tsc --project ./src/test/tsconfig.json",
|
|
88
|
+
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
|
|
89
|
+
"eslint": "eslint --format stylish src",
|
|
90
|
+
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
91
|
+
"format": "npm run prettier:fix",
|
|
92
|
+
"lint": "npm run prettier && npm run eslint",
|
|
93
|
+
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
|
|
94
|
+
"prettier": "prettier --check . --ignore-path ../../../../.prettierignore",
|
|
95
|
+
"prettier:fix": "prettier --write . --ignore-path ../../../../.prettierignore",
|
|
96
|
+
"test": "npm run test:mocha",
|
|
97
|
+
"test:coverage": "nyc npm test -- --reporter xunit --reporter-option output=nyc/junit-report.xml",
|
|
98
|
+
"test:mocha": "mocha --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
|
|
99
|
+
"test:mocha:multireport": "cross-env FLUID_TEST_MULTIREPORT=1 npm run test:mocha",
|
|
100
|
+
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
|
|
101
|
+
"tsc": "tsc"
|
|
100
102
|
}
|
|
101
|
-
}
|
|
103
|
+
}
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
* @return {number[]} - an array with random values
|
|
10
10
|
*/
|
|
11
11
|
function generateRandomUInt32Array(length) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const array = new Uint32Array(length);
|
|
13
|
+
const crypto = window.crypto || window.msCrypto; // IE 11 support
|
|
14
|
+
crypto.getRandomValues(array);
|
|
15
|
+
return array;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
module.exports = {
|
|
19
|
-
|
|
19
|
+
generateRandomUInt32Array,
|
|
20
20
|
};
|