{"id":16720311,"url":"https://github.com/tomokimiyauci/seqtools","last_synced_at":"2026-07-25T00:32:31.512Z","repository":{"id":177525266,"uuid":"660234680","full_name":"TomokiMiyauci/seqtools","owner":"TomokiMiyauci","description":"Efficient utilities for sequence","archived":false,"fork":false,"pushed_at":"2023-07-01T06:00:34.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-29T01:26:03.635Z","etag":null,"topics":["at","indexable","sequence","slice","sliceable","tools","utilities"],"latest_commit_sha":null,"homepage":"https://deno.land/x/seqtools","language":"TypeScript","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/TomokiMiyauci.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-06-29T14:43:05.000Z","updated_at":"2023-07-01T05:41:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"7604e1b9-49be-4640-b377-bcb8484c2d95","html_url":"https://github.com/TomokiMiyauci/seqtools","commit_stats":null,"previous_names":["tomokimiyauci/seqtools"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/TomokiMiyauci/seqtools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomokiMiyauci%2Fseqtools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomokiMiyauci%2Fseqtools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomokiMiyauci%2Fseqtools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomokiMiyauci%2Fseqtools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TomokiMiyauci","download_url":"https://codeload.github.com/TomokiMiyauci/seqtools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomokiMiyauci%2Fseqtools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35861393,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-24T02:00:07.870Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["at","indexable","sequence","slice","sliceable","tools","utilities"],"created_at":"2024-10-12T22:06:33.162Z","updated_at":"2026-07-25T00:32:31.507Z","avatar_url":"https://github.com/TomokiMiyauci.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# seqtools\n\n[![deno land](http://img.shields.io/badge/available%20on-deno.land/x-lightgrey.svg?logo=deno)](https://deno.land/x/seqtools)\n[![deno doc](https://doc.deno.land/badge.svg)](https://deno.land/x/seqtools?doc)\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/TomokiMiyauci/seqtools)](https://github.com/TomokiMiyauci/seqtools/releases)\n[![codecov](https://codecov.io/github/TomokiMiyauci/seqtools/branch/main/graph/badge.svg)](https://codecov.io/gh/TomokiMiyauci/seqtools)\n[![License](https://img.shields.io/github/license/TomokiMiyauci/seqtools)](LICENSE)\n\n[![test](https://github.com/TomokiMiyauci/seqtools/actions/workflows/test.yaml/badge.svg)](https://github.com/TomokiMiyauci/seqtools/actions/workflows/test.yaml)\n[![NPM](https://nodei.co/npm/@miyauci/seqtools.png?mini=true)](https://nodei.co/npm/@miyauci/seqtools/)\n[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg)](https://github.com/RichardLitt/standard-readme)\n[![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)\n\nEfficient utilities for sequence.\n\n## Table of Contents \u003c!-- omit in toc --\u003e\n\n- [Background](#background)\n- [Install](#install)\n- [Usage](#usage)\n  - [head](#head)\n  - [tail](#tail)\n  - [init](#init)\n  - [last](#last)\n  - [headTail](#headtail)\n  - [initLast](#initlast)\n- [API](#api)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Background\n\nThis project is a sequence version of\n[itertools](https://github.com/nvie/itertools).\n\nIt provides the most efficient solution for sequence.\n\nA sequence is an \"indexable, sliceable data structure\". See\n[`Sequence`](types.ts#L4) for the specific interface.\n\nStandard data structures that satisfy this are string and array.\n\nThese data structures encompass multiple data and require efficient data\nprocessing. However, in many cases, multiple alternatives exist to accomplish\nthe same thing.\n\nIf you do something similar, you can **always** use this project. In general,\nindex access and slicing are performance optimal.\n\n## Install\n\ndeno.land:\n\n```ts\nimport * as mod from \"https://deno.land/x/seqtools/[snake_case].ts\";\n```\n\nnpm:\n\n```bash\nnpm i @miyauci/seqtools\n```\n\n## Usage\n\n`mod.ts` does not exist.\n\n### head\n\nExtract the first element of a sequence.\n\n```ts\nimport { head } from \"https://deno.land/x/seqtools/head.ts\";\nimport { assertEquals } from \"https://deno.land/std/testing/asserts.ts\";\n\nassertEquals(head([1, 2, 3]), 1);\nassertEquals(head(\"abc\"), \"a\");\nassertEquals(head([]), undefined);\n```\n\n### tail\n\nExtract the elements after the head of a sequence.\n\n```ts\nimport { tail } from \"https://deno.land/x/seqtools/tail.ts\";\nimport { assertEquals } from \"https://deno.land/std/testing/asserts.ts\";\n\nassertEquals(tail([1, 2, 3]), [2, 3]);\nassertEquals(tail(\"abc\"), \"bc\");\nassertEquals(tail([0]), []);\nassertEquals(tail([]), []);\n```\n\n### init\n\nExtract the elements before the last of a sequence.\n\n```ts\nimport { init } from \"https://deno.land/x/seqtools/init.ts\";\nimport { assertEquals } from \"https://deno.land/std/testing/asserts.ts\";\n\nassertEquals(init([1, 2, 3]), [1, 2]);\nassertEquals(init(\"abc\"), \"ab\");\nassertEquals(init([0]), []);\nassertEquals(init([]), []);\n```\n\n### last\n\nExtract the last element of a sequence.\n\n```ts\nimport { last } from \"https://deno.land/x/seqtools/last.ts\";\nimport { assertEquals } from \"https://deno.land/std/testing/asserts.ts\";\n\nassertEquals(last([1, 2, 3]), 3);\nassertEquals(last(\"abc\"), \"c\");\nassertEquals(last([]), undefined);\n```\n\n### headTail\n\nSplit the sequence into head and tail.\n\n```ts\nimport { headTail } from \"https://deno.land/x/seqtools/head_tail.ts\";\nimport { assertEquals } from \"https://deno.land/std/testing/asserts.ts\";\n\nassertEquals(headTail([1, 2, 3]), [1, [2, 3]]);\nassertEquals(headTail(\"abc\"), [\"a\", \"bc\"]);\nassertEquals(headTail([]), [undefined, []]);\n```\n\n### initLast\n\nSplit the sequence into init and last.\n\n```ts\nimport { initLast } from \"https://deno.land/x/seqtools/init_last.ts\";\nimport { assertEquals } from \"https://deno.land/std/testing/asserts.ts\";\n\nassertEquals(initLast([1, 2, 3]), [[1, 2], 3]);\nassertEquals(initLast(\"abc\"), [\"ab\", \"c\"]);\nassertEquals(initLast([]), [[], undefined]);\n```\n\n## API\n\nSee [deno doc](https://deno.land/x/seqtools?doc) for all APIs.\n\n## Contributing\n\nSee [contribution](CONTRIBUTING.md).\n\n## License\n\n[MIT](LICENSE) © 2023 Tomoki Miyauchi\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomokimiyauci%2Fseqtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomokimiyauci%2Fseqtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomokimiyauci%2Fseqtools/lists"}