@fluidframework/core-utils
Advanced tools
Comparing version 2.0.0-rc.5.0.0 to 2.1.0-274160
@@ -25,2 +25,4 @@ "use strict"; | ||
(left.length === right.length && // Trivial rejection: 'left' and 'right' are different lengths | ||
// non null asserting the right array because we know the lengths are the same | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
left.every((leftItem, index) => comparator(leftItem, right[index], index)))); | ||
@@ -27,0 +29,0 @@ }; |
@@ -95,2 +95,4 @@ "use strict"; | ||
if (position !== this.L.length) { | ||
// Non null asserting here since its the removal node's previous position | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
this.update(this.L[position]); | ||
@@ -117,3 +119,4 @@ } | ||
isGreaterThanParent(k) { | ||
// eslint-disable-next-line no-bitwise | ||
// TODO: Document why this non-null assert is safe | ||
// eslint-disable-next-line no-bitwise, @typescript-eslint/no-non-null-assertion | ||
return k > 1 && this.comp.compare(this.L[k >> 1].value, this.L[k].value) > 0; | ||
@@ -127,5 +130,9 @@ } | ||
let j = k << 1; | ||
// TODO: Document why this non-null assert is safe | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
if (j < this.count() && this.comp.compare(this.L[j].value, this.L[j + 1].value) > 0) { | ||
j++; | ||
} | ||
// TODO: Document why this non-null assert is safe | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
if (this.comp.compare(this.L[k].value, this.L[j].value) <= 0) { | ||
@@ -139,7 +146,11 @@ break; | ||
swap(k, j) { | ||
const tmp = this.L[k]; | ||
this.L[k] = this.L[j]; | ||
this.L[k].position = k; | ||
this.L[j] = tmp; | ||
this.L[j].position = j; | ||
// Non null asserting here since array is always filled and indices are within range | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const resultNodeJ = this.L[k]; | ||
// Non null asserting here since this affects perf if we assert | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const resultNodeK = (this.L[k] = this.L[j]); | ||
resultNodeK.position = k; | ||
this.L[j] = resultNodeJ; | ||
resultNodeJ.position = j; | ||
} | ||
@@ -146,0 +157,0 @@ } |
@@ -22,4 +22,6 @@ /*! | ||
(left.length === right.length && // Trivial rejection: 'left' and 'right' are different lengths | ||
// non null asserting the right array because we know the lengths are the same | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
left.every((leftItem, index) => comparator(leftItem, right[index], index)))); | ||
}; | ||
//# sourceMappingURL=compare.js.map |
@@ -92,2 +92,4 @@ /*! | ||
if (position !== this.L.length) { | ||
// Non null asserting here since its the removal node's previous position | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
this.update(this.L[position]); | ||
@@ -114,3 +116,4 @@ } | ||
isGreaterThanParent(k) { | ||
// eslint-disable-next-line no-bitwise | ||
// TODO: Document why this non-null assert is safe | ||
// eslint-disable-next-line no-bitwise, @typescript-eslint/no-non-null-assertion | ||
return k > 1 && this.comp.compare(this.L[k >> 1].value, this.L[k].value) > 0; | ||
@@ -124,5 +127,9 @@ } | ||
let j = k << 1; | ||
// TODO: Document why this non-null assert is safe | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
if (j < this.count() && this.comp.compare(this.L[j].value, this.L[j + 1].value) > 0) { | ||
j++; | ||
} | ||
// TODO: Document why this non-null assert is safe | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
if (this.comp.compare(this.L[k].value, this.L[j].value) <= 0) { | ||
@@ -136,9 +143,13 @@ break; | ||
swap(k, j) { | ||
const tmp = this.L[k]; | ||
this.L[k] = this.L[j]; | ||
this.L[k].position = k; | ||
this.L[j] = tmp; | ||
this.L[j].position = j; | ||
// Non null asserting here since array is always filled and indices are within range | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const resultNodeJ = this.L[k]; | ||
// Non null asserting here since this affects perf if we assert | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const resultNodeK = (this.L[k] = this.L[j]); | ||
resultNodeK.position = k; | ||
this.L[j] = resultNodeJ; | ||
resultNodeJ.position = j; | ||
} | ||
} | ||
//# sourceMappingURL=heap.js.map |
{ | ||
"name": "@fluidframework/core-utils", | ||
"version": "2.0.0-rc.5.0.0", | ||
"version": "2.1.0-274160", | ||
"description": "Not intended for use outside the Fluid client repo.", | ||
@@ -72,3 +72,3 @@ "homepage": "https://fluidframework.com", | ||
"@biomejs/biome": "^1.7.3", | ||
"@fluid-internal/mocha-test-setup": ">=2.0.0-rc.5.0.0 <2.0.0-rc.5.1.0", | ||
"@fluid-internal/mocha-test-setup": "2.1.0-274160", | ||
"@fluid-tools/benchmark": "^0.47.0", | ||
@@ -78,3 +78,3 @@ "@fluid-tools/build-cli": "^0.39.0", | ||
"@fluidframework/build-tools": "^0.39.0", | ||
"@fluidframework/core-utils-previous": "npm:@fluidframework/core-utils@2.0.0-rc.4.0.0", | ||
"@fluidframework/core-utils-previous": "npm:@fluidframework/core-utils@2.0.0-rc.5.0.0", | ||
"@fluidframework/eslint-config-fluid": "^5.3.0", | ||
@@ -112,3 +112,5 @@ "@microsoft/api-extractor": "^7.45.1", | ||
"build:compile": "fluid-build . --task compile", | ||
"build:docs": "api-extractor run --local", | ||
"build:docs": "concurrently \"npm:build:docs:*\"", | ||
"build:docs:current": "api-extractor run --local", | ||
"build:docs:legacy": "api-extractor run --local --config api-extractor/api-extractor.legacy.json", | ||
"build:esnext": "tsc --project ./tsconfig.json", | ||
@@ -128,3 +130,5 @@ "build:test": "npm run build:test:esm && npm run build:test:cjs", | ||
"check:prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore", | ||
"ci:build:docs": "api-extractor run", | ||
"ci:build:docs": "concurrently \"npm:ci:build:docs:*\"", | ||
"ci:build:docs:current": "api-extractor run", | ||
"ci:build:docs:legacy": "api-extractor run --config api-extractor/api-extractor.legacy.json", | ||
"clean": "rimraf --glob dist lib \"*.d.ts\" \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc", | ||
@@ -146,5 +150,5 @@ "eslint": "eslint --format stylish src", | ||
"tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist", | ||
"typetests:gen": "flub generate typetests --dir . -v --publicFallback", | ||
"typetests:gen": "flub generate typetests --dir . -v", | ||
"typetests:prepare": "flub typetests --dir . --reset --previous --normalize" | ||
} | ||
} |
@@ -31,4 +31,6 @@ /*! | ||
(left.length === right.length && // Trivial rejection: 'left' and 'right' are different lengths | ||
left.every((leftItem, index) => comparator(leftItem, right[index], index))) | ||
// non null asserting the right array because we know the lengths are the same | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
left.every((leftItem, index) => comparator(leftItem, right[index]!, index))) | ||
); | ||
}; |
@@ -130,3 +130,5 @@ /*! | ||
if (position !== this.L.length) { | ||
this.update(this.L[position]); | ||
// Non null asserting here since its the removal node's previous position | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
this.update(this.L[position]!); | ||
} | ||
@@ -155,4 +157,5 @@ } | ||
private isGreaterThanParent(k: number): boolean { | ||
// eslint-disable-next-line no-bitwise | ||
return k > 1 && this.comp.compare(this.L[k >> 1].value, this.L[k].value) > 0; | ||
// TODO: Document why this non-null assert is safe | ||
// eslint-disable-next-line no-bitwise, @typescript-eslint/no-non-null-assertion | ||
return k > 1 && this.comp.compare(this.L[k >> 1]!.value, this.L[k]!.value) > 0; | ||
} | ||
@@ -166,6 +169,10 @@ | ||
let j = k << 1; | ||
if (j < this.count() && this.comp.compare(this.L[j].value, this.L[j + 1].value) > 0) { | ||
// TODO: Document why this non-null assert is safe | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
if (j < this.count() && this.comp.compare(this.L[j]!.value, this.L[j + 1]!.value) > 0) { | ||
j++; | ||
} | ||
if (this.comp.compare(this.L[k].value, this.L[j].value) <= 0) { | ||
// TODO: Document why this non-null assert is safe | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
if (this.comp.compare(this.L[k]!.value, this.L[j]!.value) <= 0) { | ||
break; | ||
@@ -179,8 +186,12 @@ } | ||
private swap(k: number, j: number): void { | ||
const tmp = this.L[k]; | ||
this.L[k] = this.L[j]; | ||
this.L[k].position = k; | ||
this.L[j] = tmp; | ||
this.L[j].position = j; | ||
// Non null asserting here since array is always filled and indices are within range | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const resultNodeJ = this.L[k]!; | ||
// Non null asserting here since this affects perf if we assert | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const resultNodeK = (this.L[k] = this.L[j]!); | ||
resultNodeK.position = k; | ||
this.L[j] = resultNodeJ; | ||
resultNodeJ.position = j; | ||
} | ||
} |
@@ -8,5 +8,4 @@ { | ||
"outDir": "./lib", | ||
"noUncheckedIndexedAccess": false, | ||
"exactOptionalPropertyTypes": false, | ||
}, | ||
} |
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
251940
129
3542