{"id":17862860,"url":"https://github.com/dheavy/struqt","last_synced_at":"2025-04-02T21:15:38.881Z","repository":{"id":143801804,"uuid":"71776638","full_name":"dheavy/struqt","owner":"dheavy","description":"Implementation of several common data structures in Javascript.","archived":false,"fork":false,"pushed_at":"2017-01-03T12:16:35.000Z","size":144,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-10T09:45:43.329Z","etag":null,"topics":["data-structures","datastructures","javascript","linked-list"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dheavy.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-24T10:09:18.000Z","updated_at":"2017-05-04T09:10:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"15913b9f-4f51-4353-9605-1b98cdfd9a9d","html_url":"https://github.com/dheavy/struqt","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dheavy%2Fstruqt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dheavy%2Fstruqt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dheavy%2Fstruqt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dheavy%2Fstruqt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dheavy","download_url":"https://codeload.github.com/dheavy/struqt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246892848,"owners_count":20850850,"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","datastructures","javascript","linked-list"],"created_at":"2024-10-28T08:56:35.667Z","updated_at":"2025-04-02T21:15:38.857Z","avatar_url":"https://github.com/dheavy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Struqt\n\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com)\n[![Build Status](https://travis-ci.org/dheavy/struqt.svg?branch=master)](https://travis-ci.org/dheavy/struqt)\n[![Coverage Status](https://coveralls.io/repos/github/dheavy/struqt/badge.svg?branch=master)](https://coveralls.io/github/dheavy/struqt?branch=master)\n\n  *Struqt* is a JavaScript (ES2015) library implementing commonly used data structures.\n  Its sole dependency is [`lodash.isequal`](https://www.npmjs.com/package/lodash.isequal), used for deep equality comparison of JavaScript objects.\n\n### Installation\n\n  Install via **npm** with the following command.\n\n  `npm install --save struqt`\n\n### Usage\n\n##### API\n\n  `SinglyLinkedList` and `DoublyLinkedList`.\n  - `list.add(element)` adds a new `element` (of any type) as a node to the list.\n  - `list.addAll(elements)` inserts each members of an `elements` array into list.\n  - `list.get(index)` returns the node at the given `index`.\n  - `list.remove(index)` removes and return the node at a given `index`.\n  - `list.removeFirstOccurrence(element)` scans list from left to right and remove and returns the first node holding the given `element` as data; returns null if none was found.\n  - `list.removeLastOccurrence(element)` scans list from left to right and remove and returns the last node holding the given `element` as data; returns null if none was found.\n  - `list.addAtIndex(index, element)` adds a new `element` in place of the given `index` in the list.\n  - `list.addAllAtIndex(index, elements)` inserts each members of an `elements` array into list, starting from the given `index` in it.\n  - `list.contains(data)` returns a boolean value stating whether or not the list contains a node holding the specified `data` (uses deep equality comparison).\n  - `list.shift()` returns and removes the `head` of the list.\n  - `list.pop()` returns and removes the `tail` of the list.\n  - `list.set(index, element)` replaces the data held by the node at a given `ìndex` with the given `element`.\n  - `list.clone()` returns a shallow copy of the list.\n  - `list.toArray()` returns an array of data compiled from the nodes in the list.\n  - `list.clear()` resets the list.\n\n##### Documentation\nDocumentation for the library can be generated using [JSDoc](http://usejsdoc.org/).\nRun the following command to dump a small HTML-based documentation in a `docs` directory.\n\n`npm run doc`\n\n### Tests\n\n  Run **Mocha/Chai** tests with the following command.\n\n  `npm test`\n\n### Contributing\n\n  TBA\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdheavy%2Fstruqt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdheavy%2Fstruqt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdheavy%2Fstruqt/lists"}