{"id":21762862,"url":"https://github.com/lccodder/linkedlist-ts","last_synced_at":"2025-03-21T04:43:16.146Z","repository":{"id":205674338,"uuid":"703233892","full_name":"LCcodder/LinkedList-ts","owner":"LCcodder","description":"Default linked list implementation written on TypeScript","archived":false,"fork":false,"pushed_at":"2023-11-05T21:39:41.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T01:25:11.701Z","etag":null,"topics":["data-structures","linked-list","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LCcodder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-10T21:16:26.000Z","updated_at":"2024-03-13T12:51:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"471920ff-a96e-4b71-b74f-97f0498e081d","html_url":"https://github.com/LCcodder/LinkedList-ts","commit_stats":null,"previous_names":["lccodder/linkedlist-ts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LCcodder%2FLinkedList-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LCcodder%2FLinkedList-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LCcodder%2FLinkedList-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LCcodder%2FLinkedList-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LCcodder","download_url":"https://codeload.github.com/LCcodder/LinkedList-ts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244739940,"owners_count":20501990,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-structures","linked-list","typescript"],"created_at":"2024-11-26T12:13:22.315Z","updated_at":"2025-03-21T04:43:16.122Z","avatar_url":"https://github.com/LCcodder.png","language":"TypeScript","readme":"# Static/dynamic typed Linked List realization on TypeScript\n### **Simple D/S realization made with TS. Includes only base Linked List methods such as `append`, `prepend`, `to array`, etc**\n___\n## *Node structure:*\n```Typescript\ninterface ListNode \u003cTVal extends Exclude\u003cany, undefined | never | null\u003e\u003e {\n    value: TVal,\n    next: ListNode\u003cTVal\u003e | null\n}\n```\n* Generic type completion `TVal` extends `any` type w/o `undefined`, `never` and `null` in order to avoid unrealistic value use cases\n##  `IList` *interface:*\n```TypeScript\ninterface IList\u003cTVal\u003e {\n    getHead(): ListNode\u003cTVal\u003e | null,\n    getTail(): ListNode\u003cTVal\u003e | null,\n    addToTail(dataset: TVal): void,\n    addToHead(dataset: TVal): void,\n    toArray(callback?: (array: Array\u003cTVal\u003e) =\u003e void): Array\u003cTVal\u003e,\n    replace(oldValue: TVal, newValue: TVal, instancesCount?: number, callback?: (replacedNode: ListNode\u003cTVal\u003e) =\u003e void ): number,\n    remove(value: TVal, instancesCount?: number, callback?: (removedNode: ListNode\u003cTVal\u003e) =\u003e void ): number\n}\n```\n\n## **Can be used with fixed type of value or each-node-changing type:**\n### Dynamic implementation:\n```TypeScript\nlet ll = new LinkedList.List()\nll.addToTail({prop: \"str\"})\nll.addToTail(10)\nll.addToHead(\"string\")\n```\n### Static implementation:\n```TypeScript\nlet ll = new LinkedList.List\u003cnumber\u003e()\nll.addToTail(1)\nll.addToTail(10)\nll.addToHead(100)\n```\n---\n## Dependencies: \n+ `typescript` (save-dev): `^5.2.2`\n+ `node`: `v18.17.1`","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flccodder%2Flinkedlist-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flccodder%2Flinkedlist-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flccodder%2Flinkedlist-ts/lists"}