client-run-queue
Advanced tools
Comparing version 1.1.9 to 1.1.10
export declare class DoubleLinkedList<ItemT> { | ||
/** This is set to `undefined` on any list mutations and rebuilt when `toArray` is called if needed */ | ||
private allValues; | ||
private firstNode; | ||
@@ -13,3 +15,3 @@ private lastNode; | ||
readonly getTail: () => Readonly<DoubleLinkedListNode<ItemT>> | undefined; | ||
readonly toArray: () => ItemT[]; | ||
readonly toArray: () => Readonly<ItemT[]>; | ||
readonly remove: (node: DoubleLinkedListNode<ItemT>) => boolean; | ||
@@ -19,3 +21,3 @@ } | ||
list: DoubleLinkedList<ItemT> | undefined; | ||
value: ItemT; | ||
readonly value: ItemT; | ||
previousNode?: DoubleLinkedListNode<ItemT> | undefined; | ||
@@ -22,0 +24,0 @@ nextNode?: DoubleLinkedListNode<ItemT> | undefined; |
@@ -20,2 +20,3 @@ "use strict"; | ||
} | ||
this.allValues = undefined; | ||
this.length += 1; | ||
@@ -35,2 +36,3 @@ return newNode; | ||
} | ||
this.allValues = undefined; | ||
this.length += 1; | ||
@@ -47,2 +49,5 @@ return newNode; | ||
this.toArray = () => { | ||
if (this.allValues !== undefined) { | ||
return this.allValues; | ||
} | ||
const output = []; | ||
@@ -54,2 +59,3 @@ let cursor = this.firstNode; | ||
} | ||
this.allValues = Object.freeze(output); | ||
return output; | ||
@@ -89,2 +95,3 @@ }; | ||
node.list = undefined; | ||
this.allValues = undefined; | ||
this.length -= 1; | ||
@@ -91,0 +98,0 @@ return true; |
{ | ||
"name": "client-run-queue", | ||
"version": "1.1.9", | ||
"version": "1.1.10", | ||
"description": "A client-friendly run queue", | ||
@@ -24,3 +24,4 @@ "keywords": [ | ||
"build": "tsc -p tsconfig.build.json", | ||
"clean": "trash coverage docs lib", | ||
"build:dev": "trash dev-build && yarn build && mkdir dev-build && cp -r lib dev-build && cp package.json dev-build && (cd dev-build && echo 'package' `pwd`)", | ||
"clean": "trash coverage dev-build docs lib", | ||
"generate:docs": "npx typedoc src/index.ts", | ||
@@ -40,8 +41,8 @@ "lint": "eslint 'src/**/*.ts?(x)' --max-warnings 0", | ||
"@types/heap": "^0.2.31", | ||
"@types/jest": "^28.1.6", | ||
"@typescript-eslint/eslint-plugin": "^5.31.0", | ||
"@typescript-eslint/parser": "^5.31.0", | ||
"eslint": "8.21.0", | ||
"@types/jest": "^28.1.7", | ||
"@typescript-eslint/eslint-plugin": "^5.34.0", | ||
"@typescript-eslint/parser": "^5.34.0", | ||
"eslint": "8.22.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-import-resolver-typescript": "^3.3.0", | ||
"eslint-import-resolver-typescript": "^3.5.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
@@ -57,3 +58,3 @@ "eslint-plugin-prefer-arrow": "^1.2.3", | ||
"trash-cli": "5.0.0", | ||
"ts-jest": "^28.0.7", | ||
"ts-jest": "^28.0.8", | ||
"typedoc": "^0.23.10", | ||
@@ -60,0 +61,0 @@ "typescript": "4.7.4" |
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
60793
798