You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
33 KiB

{"version":3,"sources":["../../node_modules/tslib/tslib.es6.js","../../projects/utils/src/lib/linked-list.ts"],"names":["__generator","thisArg","body","f","y","t","g","_","label","sent","trys","ops","next","verb","throw","return","Symbol","iterator","this","n","v","op","TypeError","call","done","value","pop","length","push","e","step","Object","create","__read","o","m","r","i","ar","error","__spread","arguments","concat","LinkedList","size","defineProperty","prototype","first","last","attach","previousNode","nextNode","addHead","addTail","node","ListNode","previous","attachMany","values","addManyHead","addManyTail","list","toNodeArray","detach","dropTail","dropHead","add","_this","after","params","_i","_a","addAfter","apply","before","addBefore","byIndex","position","addByIndex","head","tail","addMany","addManyAfter","addManyBefore","addManyByIndex","previousValue","compareFn","compare","find","nextValue","get","reduceRight","nodes","unshift","map","drop","dropByIndex","byValue","dropByValue","byValueAll","dropByValueAll","dropMany","count","dropManyByIndex","dropManyHead","dropManyTail","current","undefined","findIndex","dropped","Math","max","min","predicate","forEach","iteratorFn","index","indexOf","toArray","array","Array","toString","mapperFn","JSON","stringify","join"],"mappings":"wYA6EgBA,EAAYC,EAASC,GACjC,IAAsGC,EAAGC,EAAGC,EAAGC,EAA3GC,EAAI,CAAEC,MAAO,EAAGC,KAAM,WAAa,GAAW,EAAPJ,EAAE,GAAQ,MAAMA,EAAE,GAAI,OAAOA,EAAE,IAAOK,KAAM,GAAIC,IAAK,IAChG,OAAOL,EAAI,CAAEM,KAAMC,EAAK,GAAIC,MAASD,EAAK,GAAIE,OAAUF,EAAK,IAAwB,mBAAXG,SAA0BV,EAAEU,OAAOC,UAAY,WAAa,OAAOC,OAAUZ,EACvJ,SAASO,EAAKM,GAAK,OAAO,SAAUC,GAAK,OACzC,SAAcC,GACV,GAAIlB,EAAG,MAAM,IAAImB,UAAU,mCAC3B,KAAOf,GAAG,IACN,GAAIJ,EAAI,EAAGC,IAAMC,EAAY,EAARgB,EAAG,GAASjB,EAAU,OAAIi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K1C,KACtEuG,EAAW7D,EAAMuB,EAAU3D,OAI/ByB,EAAAG,UAAA4C,IAAA,SAAIb,GACF,OAAO3D,KAAKsE,MAAK,SAACjF,EAAG6G,GAAU,OAAAvC,IAAauC,MAK9CzE,EAAAG,UAAAuE,QAAA,SAAQ5F,EAAY6D,GAClB,YADkB,IAAAA,IAAAA,EAAAC,GACXrE,KAAK0F,WAAU,SAAAtD,GAAQ,OAAAgC,EAAUhC,EAAK7B,MAAOA,OAGtDkB,EAAAG,UAAAwE,QAAA,WACE,IAAMC,EAAQ,IAAIC,MAAMtG,KAAK0B,MAI7B,OAFA1B,KAAKgG,SAAQ,SAAC5D,EAAM8D,GAAU,OAACG,EAAMH,GAAU9D,EAAK7B,SAE7C8F,GAGT5E,EAAAG,UAAAgB,YAAA,WACE,IAAMyD,EAAQ,IAAIC,MAAMtG,KAAK0B,MAI7B,OAFA1B,KAAKgG,SAAQ,SAAC5D,EAAM8D,GAAU,OAACG,EAAMH,GAAU9D,KAExCiE,GAGT5E,EAAAG,UAAA2E,SAAA,SAASC,GACP,YADO,IAAAA,IAAAA,EAA4BC,KAAKC,WACjC1G,KAAKoG,UACTxB,KAAI,SAAArE,GAAS,OAAAiG,EAASjG,MACtBoG,KAAK,UAITlF,EAAAG,UAAC9B,OAAOC,UAAT,mEACWqC,EAAOpC,KAAK6B,MAAkB,0BAAGO,EACxC,CAAA,EAAMA,EAAK7B,OADiC,CAAA,EAAA,UAC5C8C,EAAA9D,+BAD0D6C,EAAOA,EAAK1C","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/* tslint:disable:no-non-null-assertion */\n\nimport compare from 'just-compare';\n\nexport class ListNode<T = any> {\n next: ListNode | undefined;\n previous: ListNode | undefined;\n constructor(public readonly value: T) {}\n}\n\nexport class LinkedList<T = any> {\n private first: ListNode<T> | undefined;\n private last: ListNode<T> | undefined;\n private size = 0;\n\n get head(): ListNode<T> | undefined {\n return this.first;\n }\n get tail(): ListNode<T> | undefined {\n return this.last;\n }\n get length(): number {\n return this.size;\n }\n\n private attach(\n value: T,\n previousNode: ListNode<T> | undefined,\n nextNode: ListNode<T> | undefined,\n ): ListNode<T> {\n if (!previousNode) return this.addHead(value);\n\n if (!nextNode) return this.addTail(value);\n\n const node = new ListNode(value);\n node.previous = previousNode;\n previousNode.next = node;\n node.next = nextNode;\n nextNode.previous = node;\n\n this.size++;\n\n return node;\n }\n\n private attachMany(\n values: T[],\n previousNode: ListNode<T> | undefined,\n nextNode: ListNode<T> | undefined,\n ): ListNode<T>[] {\n if (!values.length) return [];\n\n if (!previousNode) return this.addManyHead(values);\n\n if (!nextNode) return this.addManyTail(values);\n\n const list = new LinkedList<T>();\n list.addManyTail(values);\n list.first!.previous = previousNode;\n previousNode.next = list.first;\n list.last!.next = nextNode;\n nextNode.previous = list.last;\n\n this.size += values.length;\n\n return list.toNodeArray();\n }\n\n private detach(node: ListNode<T>) {\n if (!node.previous) return this.dropHead();\n\n if (!node.next) return this.dropTail();\n\n node.previous.next = node.next;\n node.next.previous = node.previous;\n\n this.size--;\n\n return node;\n }\n\n add(value: T) {\n return {\n after: (...params: [T] | [any, ListComparisonFn<T>]) =>\n this.addAfter.call(this, value, ...params),\n before: (...params: [T] | [any, ListComparisonFn<T>]) =>\n this.addBefore.call(this, value, ...params),\n byIndex: (position: number) => this.addByIndex(value, position),\n head: () => this.addHead(value),\n tail: () => this.addTail(value),\n };\n }\n\n addMany(values: T[]) {\n return {\n after: (...params: [T] | [any, ListComparisonFn<T>]) =>\n this.addManyAfter.call(this, values, ...params),\n before: (...params: [T] | [any, ListComparisonFn<T>]) =>\n this.addManyBefore.call(this, values, ...params),\n byIndex: (position: number) => this.addManyByIndex(values, position),\n head: () => this.addManyHead(values),\n tail: () => this.addManyTail(values),\n };\n }\n\n addAfter(value: T, previousValue: T): ListNode<T>;\n addAfter(value: T, previousValue: any, compareFn: ListComparisonFn<T>): ListNode<T>;\n addAfter(value: T, previousValue: any, compareFn: ListComparisonFn<T> = compare): ListNode<T> {\n const previous = this.find(node => compareFn(node.value, previousValue));\n\n return previous ? this.attach(value, previous, previous.next) : this.addTail(value);\n }\n\n addBefore(value: T, nextValue: T): ListNode<T>;\n addBefore(value: T, nextValue: any, compareFn: ListComparisonFn<T>): ListNode<T>;\n addBefore(value: T, nextValue: any, compareFn: ListComparisonFn<T> = compare): ListNode<T> {\n const next = this.find(node => compareFn(node.value, nextValue));\n\n return next ? this.attach(value, next.previous, next) : this.addHead(value);\n }\n\n addByIndex(value: T, position: number): ListNode<T> {\n if (position < 0) position += this.size;\n else if (position >= this.size) return this.addTail(value);\n\n if (position <= 0) return this.addHead(value);\n\n const next = this.get(position)!;\n\n return this.attach(value, next.previous, next);\n }\n\n addHead(value: T): ListNode<T> {\n const node = new ListNode(value);\n\n node.next = this.first;\n\n if (this.first) this.first.previous = node;\n else this.last = node;\n\n this.first = node;\n this.size++;\n\n return node;\n }\n\n addTail(value: T): ListNode<T> {\n const node = new ListNode(value);\n\n if (this.first) {\n node.previous = this.last;\n this.last!.next = node;\n this.last = node;\n } else {\n this.first = node;\n this.last = node;\n }\n\n this.size++;\n\n return node;\n }\n\n addManyAfter(values: T[], previousValue: T): ListNode<T>[];\n addManyAfter(values: T[], previousValue: any, compareFn: ListComparisonFn<T>): ListNode<T>[];\n addManyAfter(\n values: T[],\n previousValue: any,\n compareFn: ListComparisonFn<T> = compare,\n ): ListNode<T>[] {\n const previous = this.find(node => compareFn(node.value, previousValue));\n\n return previous ? this.attachMany(values, previous, previous.next) : this.addManyTail(values);\n }\n\n addManyBefore(values: T[], nextValue: T): ListNode<T>[];\n addManyBefore(values: T[], nextValue: any, compareFn: ListComparisonFn<T>): ListNode<T>[];\n addManyBefore(\n values: T[],\n nextValue: any,\n compareFn: ListComparisonFn<T> = compare,\n ): ListNode<T>[] {\n const next = this.find(node => compareFn(node.value, nextValue));\n\n return next ? this.attachMany(values, next.previous, next) : this.addManyHead(values);\n }\n\n addManyByIndex(values: T[], position: number): ListNode<T>[] {\n if (position < 0) position += this.size;\n\n if (position <= 0) return this.addManyHead(values);\n\n if (position >= this.size) return this.addManyTail(values);\n\n const next = this.get(position)!;\n\n return this.attachMany(values, next.previous, next);\n }\n\n addManyHead(values: T[]): ListNode<T>[] {\n return values.reduceRight<ListNode<T>[]>((nodes, value) => {\n nodes.unshift(this.addHead(value));\n return nodes;\n }, []);\n }\n\n addManyTail(values: T[]): ListNode<T>[] {\n return values.map(value => this.addTail(value));\n }\n\n drop() {\n return {\n byIndex: (position: number) => this.dropByIndex(position),\n byValue: (...params: [T] | [any, ListComparisonFn<T>]) =>\n this.dropByValue.apply(this, params),\n byValueAll: (...params: [T] | [any, ListComparisonFn<T>]) =>\n this.dropByValueAll.apply(this, params),\n head: () => this.dropHead(),\n tail: () => this.dropTail(),\n };\n }\n\n dropMany(count: number) {\n return {\n byIndex: (position: number) => this.dropManyByIndex(count, position),\n head: () => this.dropManyHead(count),\n tail: () => this.dropManyTail(count),\n };\n }\n\n dropByIndex(position: number): ListNode<T> | undefined {\n if (position < 0) position += this.size;\n\n const current = this.get(position);\n\n return current ? this.detach(current) : undefined;\n }\n\n dropByValue(value: T): ListNode<T> | undefined;\n dropByValue(value: any, compareFn: ListComparisonFn<T>): ListNode<T> | undefined;\n dropByValue(value: any, compareFn: ListComparisonFn<T> = compare): ListNode<T> | undefined {\n const position = this.findIndex(node => compareFn(node.value, value));\n\n return position < 0 ? undefined : this.dropByIndex(position);\n }\n\n dropByValueAll(value: T): ListNode<T>[];\n dropByValueAll(value: any, compareFn: ListComparisonFn<T>): ListNode<T>[];\n dropByValueAll(value: any, compareFn: ListComparisonFn<T> = compare): ListNode<T>[] {\n const dropped: ListNode<T>[] = [];\n\n for (let current = this.first, position = 0; current; position++, current = current.next) {\n if (compareFn(current.value, value)) {\n dropped.push(this.dropByIndex(position - dropped.length)!);\n }\n }\n\n return dropped;\n }\n\n dropHead(): ListNode<T> | undefined {\n const head = this.first;\n\n if (head) {\n this.first = head.next;\n\n if (this.first) this.first.previous = undefined;\n else this.last = undefined;\n\n this.size--;\n\n return head;\n }\n\n return undefined;\n }\n\n dropTail(): ListNode<T> | undefined {\n const tail = this.last;\n\n if (tail) {\n this.last = tail.previous;\n\n if (this.last) this.last.next = undefined;\n else this.first = undefined;\n\n this.size--;\n\n return tail;\n }\n\n return undefined;\n }\n\n dropManyByIndex(count: number, position: number): ListNode<T>[] {\n if (count <= 0) return [];\n\n if (position < 0) position = Math.max(position + this.size, 0);\n else if (position >= this.size) return [];\n\n count = Math.min(count, this.size - position);\n\n const dropped: ListNode<T>[] = [];\n\n while (count--) {\n const current = this.get(position);\n dropped.push(this.detach(current!)!);\n }\n\n return dropped;\n }\n\n dropManyHead(count: Exclude<number, 0>): ListNode<T>[] {\n if (count <= 0) return [];\n\n count = Math.min(count, this.size);\n\n const dropped: ListNode<T>[] = [];\n\n while (count--) dropped.unshift(this.dropHead()!);\n\n return dropped;\n }\n\n dropManyTail(count: Exclude<number, 0>): ListNode<T>[] {\n if (count <= 0) return [];\n\n count = Math.min(count, this.size);\n\n const dropped: ListNode<T>[] = [];\n\n while (count--) dropped.push(this.dropTail()!);\n\n return dropped;\n }\n\n find(predicate: ListIteratorFn<T>): ListNode<T> | undefined {\n for (let current = this.first, position = 0; current; position++, current = current.next) {\n if (predicate(current, position, this)) return current;\n }\n\n return undefined;\n }\n\n findIndex(predicate: ListIteratorFn<T>): number {\n for (let current = this.first, position = 0; current; position++, current = current.next) {\n if (predicate(current, position, this)) return position;\n }\n\n return -1;\n }\n\n forEach<R = boolean>(iteratorFn: ListIteratorFn<T, R>) {\n for (let node = this.first, position = 0; node; position++, node = node.next) {\n iteratorFn(node, position, this);\n }\n }\n\n get(position: number): ListNode<T> | undefined {\n return this.find((_, index) => position === index);\n }\n\n indexOf(value: T): number;\n indexOf(value: any, compareFn: ListComparisonFn<T>): number;\n indexOf(value: any, compareFn: ListComparisonFn<T> = compare): number {\n return this.findIndex(node => compareFn(node.value, value));\n }\n\n toArray(): T[] {\n const array = new Array(this.size);\n\n this.forEach((node, index) => (array[index!] = node.value));\n\n return array;\n }\n\n toNodeArray(): ListNode<T>[] {\n const array = new Array(this.size);\n\n this.forEach((node, index) => (array[index!] = node));\n\n return array;\n }\n\n toString(mapperFn: ListMapperFn<T> = JSON.stringify): string {\n return this.toArray()\n .map(value => mapperFn(value))\n .join(' <-> ');\n }\n\n // Cannot use Generator type because of ng-packagr\n *[Symbol.iterator](): any {\n for (let node = this.first, position = 0; node; position++, node = node.next) {\n yield node.value;\n }\n }\n}\n\nexport type ListMapperFn<T = any> = (value: T) => any;\n\nexport type ListComparisonFn<T = any> = (value1: T, value2: any) => boolean;\n\nexport type ListIteratorFn<T = any, R = boolean> = (\n node: ListNode<T>,\n index?: number,\n list?: LinkedList,\n) => R;\n"]}