@fluidframework/common-utils
Advanced tools
Comparing version 0.29.0-19979 to 0.29.0
@@ -17,3 +17,3 @@ "use strict"; | ||
if (!condition) { | ||
throw new Error(typeof message === "number" ? message.toString(16) : message); | ||
throw new Error(typeof message === "number" ? `0x${message.toString(16).padStart(3, "0")}` : message); | ||
} | ||
@@ -20,0 +20,0 @@ } |
@@ -114,4 +114,4 @@ "use strict"; | ||
// Support currently for full array, no view ports! (though it can be added in future) | ||
assert_1.assert(value.byteOffset === 0, "nonzero isobuffer byte offset"); | ||
assert_1.assert(value.byteLength === value.buffer.byteLength, "unexpected isobuffer byte length"); | ||
assert_1.assert(value.byteOffset === 0, 0x000 /* "nonzero isobuffer byte offset" */); | ||
assert_1.assert(value.byteLength === value.buffer.byteLength, 0x001 /* "unexpected isobuffer byte length" */); | ||
return IsoBuffer.fromArrayBuffer(value.buffer, encodingOrOffset, length); | ||
@@ -118,0 +118,0 @@ } |
@@ -34,3 +34,3 @@ "use strict"; | ||
if (insecureContextHashFn !== undefined) { | ||
assert_1.assert(crypto.subtle === undefined, "Both crypto.subtle and insecureContextHashFn are defined!"); | ||
assert_1.assert(crypto.subtle === undefined, 0x002 /* "Both crypto.subtle and insecureContextHashFn are defined!" */); | ||
return insecureContextHashFn(file); | ||
@@ -37,0 +37,0 @@ } |
@@ -8,3 +8,3 @@ /*! | ||
export declare const pkgName = "@fluidframework/common-utils"; | ||
export declare const pkgVersion = "0.29.0-19979"; | ||
export declare const pkgVersion = "0.29.0"; | ||
//# sourceMappingURL=packageVersion.d.ts.map |
@@ -11,3 +11,3 @@ "use strict"; | ||
exports.pkgName = "@fluidframework/common-utils"; | ||
exports.pkgVersion = "0.29.0-19979"; | ||
exports.pkgVersion = "0.29.0"; | ||
//# sourceMappingURL=packageVersion.js.map |
@@ -72,5 +72,5 @@ "use strict"; | ||
// below to check invariants | ||
assert_1.assert(primary >= this.lastPrimary, "Primary to add to range < last primary!"); | ||
assert_1.assert(primary >= this.lastPrimary, 0x003 /* "Primary to add to range < last primary!" */); | ||
if (this.lastSecondary !== undefined) { | ||
assert_1.assert(secondary >= this.lastSecondary, "Secondary to add to range < last secondary!"); | ||
assert_1.assert(secondary >= this.lastSecondary, 0x004 /* "Secondary to add to range < last secondary!" */); | ||
} | ||
@@ -119,3 +119,3 @@ this.lastPrimary = primary; | ||
get(primary) { | ||
assert_1.assert(primary >= this.ranges[0].primary, "Target primary to retrieve < first range's primary!"); | ||
assert_1.assert(primary >= this.ranges[0].primary, 0x005 /* "Target primary to retrieve < first range's primary!" */); | ||
// Find the first range where the starting position is greater than the primary. Our target range is | ||
@@ -129,3 +129,3 @@ // the one before it. | ||
} | ||
assert_1.assert(primary >= this.ranges[index - 1].primary, "Target primary to retrieve < last range's primary!"); | ||
assert_1.assert(primary >= this.ranges[index - 1].primary, 0x006 /* "Target primary to retrieve < last range's primary!" */); | ||
// If the difference is within the stored range use it - otherwise add in the length - 1 as the highest | ||
@@ -142,3 +142,3 @@ // stored secondary value to use. | ||
updateBase(primary) { | ||
assert_1.assert(primary >= this.ranges[0].primary, "Target primary to update < first range's primary!"); | ||
assert_1.assert(primary >= this.ranges[0].primary, 0x007 /* "Target primary to update < first range's primary!" */); | ||
// Walk the ranges looking for the first one that is greater than the primary. Primary is then within the | ||
@@ -153,3 +153,3 @@ // previous index by definition (since it's less than the current index's primary but greather than the | ||
} | ||
assert_1.assert(primary >= this.ranges[index - 1].primary, "Target primary to update < last range's primary!"); | ||
assert_1.assert(primary >= this.ranges[index - 1].primary, 0x008 /* "Target primary to update < last range's primary!" */); | ||
// Update the last range values | ||
@@ -164,3 +164,3 @@ const range = this.ranges[index - 1]; | ||
// Assert that the lowest value is now the input to this method | ||
assert_1.assert(primary === this.ranges[0].primary, "After update, target primary is not first range's primary!"); | ||
assert_1.assert(primary === this.ranges[0].primary, 0x009 /* "After update, target primary is not first range's primary!" */); | ||
} | ||
@@ -167,0 +167,0 @@ } |
@@ -97,3 +97,3 @@ "use strict"; | ||
handler() { | ||
assert_1.assert(!!this.runningState, "Running timer missing handler"); | ||
assert_1.assert(!!this.runningState, 0x00a /* "Running timer missing handler" */); | ||
const restart = this.runningState.restart; | ||
@@ -146,3 +146,3 @@ if (restart !== undefined) { | ||
handler(); | ||
assert_1.assert(!!this.deferred, "Handler executed without deferred"); | ||
assert_1.assert(!!this.deferred, 0x00b /* "Handler executed without deferred" */); | ||
this.deferred.resolve({ timerResult: "timeout" }); | ||
@@ -149,0 +149,0 @@ this.deferred = undefined; |
@@ -14,5 +14,5 @@ /*! | ||
if (!condition) { | ||
throw new Error(typeof message === "number" ? message.toString(16) : message); | ||
throw new Error(typeof message === "number" ? `0x${message.toString(16).padStart(3, "0")}` : message); | ||
} | ||
} | ||
//# sourceMappingURL=assert.js.map |
@@ -88,4 +88,4 @@ /*! | ||
// Support currently for full array, no view ports! (though it can be added in future) | ||
assert(value.byteOffset === 0, "nonzero isobuffer byte offset"); | ||
assert(value.byteLength === value.buffer.byteLength, "unexpected isobuffer byte length"); | ||
assert(value.byteOffset === 0, 0x000 /* "nonzero isobuffer byte offset" */); | ||
assert(value.byteLength === value.buffer.byteLength, 0x001 /* "unexpected isobuffer byte length" */); | ||
return IsoBuffer.fromArrayBuffer(value.buffer, encodingOrOffset, length); | ||
@@ -92,0 +92,0 @@ } |
@@ -30,3 +30,3 @@ /*! | ||
if (insecureContextHashFn !== undefined) { | ||
assert(crypto.subtle === undefined, "Both crypto.subtle and insecureContextHashFn are defined!"); | ||
assert(crypto.subtle === undefined, 0x002 /* "Both crypto.subtle and insecureContextHashFn are defined!" */); | ||
return insecureContextHashFn(file); | ||
@@ -33,0 +33,0 @@ } |
@@ -8,3 +8,3 @@ /*! | ||
export declare const pkgName = "@fluidframework/common-utils"; | ||
export declare const pkgVersion = "0.29.0-19979"; | ||
export declare const pkgVersion = "0.29.0"; | ||
//# sourceMappingURL=packageVersion.d.ts.map |
@@ -8,3 +8,3 @@ /*! | ||
export const pkgName = "@fluidframework/common-utils"; | ||
export const pkgVersion = "0.29.0-19979"; | ||
export const pkgVersion = "0.29.0"; | ||
//# sourceMappingURL=packageVersion.js.map |
@@ -66,5 +66,5 @@ /*! | ||
// below to check invariants | ||
assert(primary >= this.lastPrimary, "Primary to add to range < last primary!"); | ||
assert(primary >= this.lastPrimary, 0x003 /* "Primary to add to range < last primary!" */); | ||
if (this.lastSecondary !== undefined) { | ||
assert(secondary >= this.lastSecondary, "Secondary to add to range < last secondary!"); | ||
assert(secondary >= this.lastSecondary, 0x004 /* "Secondary to add to range < last secondary!" */); | ||
} | ||
@@ -113,3 +113,3 @@ this.lastPrimary = primary; | ||
get(primary) { | ||
assert(primary >= this.ranges[0].primary, "Target primary to retrieve < first range's primary!"); | ||
assert(primary >= this.ranges[0].primary, 0x005 /* "Target primary to retrieve < first range's primary!" */); | ||
// Find the first range where the starting position is greater than the primary. Our target range is | ||
@@ -123,3 +123,3 @@ // the one before it. | ||
} | ||
assert(primary >= this.ranges[index - 1].primary, "Target primary to retrieve < last range's primary!"); | ||
assert(primary >= this.ranges[index - 1].primary, 0x006 /* "Target primary to retrieve < last range's primary!" */); | ||
// If the difference is within the stored range use it - otherwise add in the length - 1 as the highest | ||
@@ -136,3 +136,3 @@ // stored secondary value to use. | ||
updateBase(primary) { | ||
assert(primary >= this.ranges[0].primary, "Target primary to update < first range's primary!"); | ||
assert(primary >= this.ranges[0].primary, 0x007 /* "Target primary to update < first range's primary!" */); | ||
// Walk the ranges looking for the first one that is greater than the primary. Primary is then within the | ||
@@ -147,3 +147,3 @@ // previous index by definition (since it's less than the current index's primary but greather than the | ||
} | ||
assert(primary >= this.ranges[index - 1].primary, "Target primary to update < last range's primary!"); | ||
assert(primary >= this.ranges[index - 1].primary, 0x008 /* "Target primary to update < last range's primary!" */); | ||
// Update the last range values | ||
@@ -158,5 +158,5 @@ const range = this.ranges[index - 1]; | ||
// Assert that the lowest value is now the input to this method | ||
assert(primary === this.ranges[0].primary, "After update, target primary is not first range's primary!"); | ||
assert(primary === this.ranges[0].primary, 0x009 /* "After update, target primary is not first range's primary!" */); | ||
} | ||
} | ||
//# sourceMappingURL=rangeTracker.js.map |
@@ -94,3 +94,3 @@ /*! | ||
handler() { | ||
assert(!!this.runningState, "Running timer missing handler"); | ||
assert(!!this.runningState, 0x00a /* "Running timer missing handler" */); | ||
const restart = this.runningState.restart; | ||
@@ -142,3 +142,3 @@ if (restart !== undefined) { | ||
handler(); | ||
assert(!!this.deferred, "Handler executed without deferred"); | ||
assert(!!this.deferred, 0x00b /* "Handler executed without deferred" */); | ||
this.deferred.resolve({ timerResult: "timeout" }); | ||
@@ -145,0 +145,0 @@ this.deferred = undefined; |
{ | ||
"name": "@fluidframework/common-utils", | ||
"version": "0.29.0-19979", | ||
"version": "0.29.0", | ||
"description": "Collection of utility functions for Fluid", | ||
@@ -5,0 +5,0 @@ "homepage": "https://fluidframework.com", |
@@ -15,4 +15,4 @@ /*! | ||
if (!condition) { | ||
throw new Error(typeof message === "number" ? message.toString(16) : message); | ||
throw new Error(typeof message === "number" ? `0x${message.toString(16).padStart(3,"0")}` : message); | ||
} | ||
} |
@@ -96,4 +96,4 @@ /*! | ||
// Support currently for full array, no view ports! (though it can be added in future) | ||
assert(value.byteOffset === 0, "nonzero isobuffer byte offset"); | ||
assert(value.byteLength === value.buffer.byteLength, "unexpected isobuffer byte length"); | ||
assert(value.byteOffset === 0, 0x000 /* "nonzero isobuffer byte offset" */); | ||
assert(value.byteLength === value.buffer.byteLength, 0x001 /* "unexpected isobuffer byte length" */); | ||
return IsoBuffer.fromArrayBuffer(value.buffer, encodingOrOffset as number | undefined, length); | ||
@@ -100,0 +100,0 @@ } else if (isArrayBuffer(value)) { |
@@ -34,3 +34,3 @@ /*! | ||
if (insecureContextHashFn !== undefined) { | ||
assert(crypto.subtle === undefined, "Both crypto.subtle and insecureContextHashFn are defined!"); | ||
assert(crypto.subtle === undefined, 0x002 /* "Both crypto.subtle and insecureContextHashFn are defined!" */); | ||
return insecureContextHashFn(file); | ||
@@ -37,0 +37,0 @@ } |
@@ -9,2 +9,2 @@ /*! | ||
export const pkgName = "@fluidframework/common-utils"; | ||
export const pkgVersion = "0.29.0-19979"; | ||
export const pkgVersion = "0.29.0"; |
@@ -96,5 +96,5 @@ /*! | ||
// below to check invariants | ||
assert(primary >= this.lastPrimary, "Primary to add to range < last primary!"); | ||
assert(primary >= this.lastPrimary, 0x003 /* "Primary to add to range < last primary!" */); | ||
if (this.lastSecondary !== undefined) { | ||
assert(secondary >= this.lastSecondary, "Secondary to add to range < last secondary!"); | ||
assert(secondary >= this.lastSecondary, 0x004 /* "Secondary to add to range < last secondary!" */); | ||
} | ||
@@ -144,3 +144,3 @@ this.lastPrimary = primary; | ||
public get(primary: number): number { | ||
assert(primary >= this.ranges[0].primary, "Target primary to retrieve < first range's primary!"); | ||
assert(primary >= this.ranges[0].primary, 0x005 /* "Target primary to retrieve < first range's primary!" */); | ||
@@ -155,3 +155,4 @@ // Find the first range where the starting position is greater than the primary. Our target range is | ||
} | ||
assert(primary >= this.ranges[index - 1].primary, "Target primary to retrieve < last range's primary!"); | ||
assert(primary >= this.ranges[index - 1].primary, | ||
0x006 /* "Target primary to retrieve < last range's primary!" */); | ||
@@ -170,3 +171,3 @@ // If the difference is within the stored range use it - otherwise add in the length - 1 as the highest | ||
public updateBase(primary: number) { | ||
assert(primary >= this.ranges[0].primary, "Target primary to update < first range's primary!"); | ||
assert(primary >= this.ranges[0].primary, 0x007 /* "Target primary to update < first range's primary!" */); | ||
@@ -182,3 +183,4 @@ // Walk the ranges looking for the first one that is greater than the primary. Primary is then within the | ||
} | ||
assert(primary >= this.ranges[index - 1].primary, "Target primary to update < last range's primary!"); | ||
assert(primary >= this.ranges[index - 1].primary, | ||
0x008 /* "Target primary to update < last range's primary!" */); | ||
@@ -196,4 +198,5 @@ // Update the last range values | ||
// Assert that the lowest value is now the input to this method | ||
assert(primary === this.ranges[0].primary, "After update, target primary is not first range's primary!"); | ||
assert(primary === this.ranges[0].primary, | ||
0x009 /* "After update, target primary is not first range's primary!" */); | ||
} | ||
} |
@@ -151,3 +151,3 @@ /*! | ||
private handler() { | ||
assert(!!this.runningState, "Running timer missing handler"); | ||
assert(!!this.runningState, 0x00a /* "Running timer missing handler" */); | ||
const restart = this.runningState.restart; | ||
@@ -226,3 +226,3 @@ if (restart !== undefined) { | ||
handler(); | ||
assert(!!this.deferred, "Handler executed without deferred"); | ||
assert(!!this.deferred, 0x00b /* "Handler executed without deferred" */); | ||
this.deferred.resolve({ timerResult: "timeout" }); | ||
@@ -229,0 +229,0 @@ this.deferred = undefined; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
465905
6453