{"id":21739429,"url":"https://github.com/minofrk/msf-io-ts","last_synced_at":"2025-04-13T03:29:02.002Z","repository":{"id":34917668,"uuid":"189621991","full_name":"minofrk/msf-io-ts","owner":"minofrk","description":"Type utilities with io-ts for MSF format.","archived":false,"fork":false,"pushed_at":"2025-04-11T15:45:57.000Z","size":311,"stargazers_count":0,"open_issues_count":35,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T16:55:46.782Z","etag":null,"topics":["io-ts","msf","typescript","xelto"],"latest_commit_sha":null,"homepage":null,"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/minofrk.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":"2019-05-31T16:00:29.000Z","updated_at":"2021-10-22T19:02:16.000Z","dependencies_parsed_at":"2023-10-15T03:45:02.869Z","dependency_job_id":"209e15d3-2d2b-4ef9-8822-ce0044ed0578","html_url":"https://github.com/minofrk/msf-io-ts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minofrk%2Fmsf-io-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minofrk%2Fmsf-io-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minofrk%2Fmsf-io-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minofrk%2Fmsf-io-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minofrk","download_url":"https://codeload.github.com/minofrk/msf-io-ts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248447548,"owners_count":21105137,"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":["io-ts","msf","typescript","xelto"],"created_at":"2024-11-26T06:08:56.502Z","updated_at":"2025-04-13T03:29:01.981Z","avatar_url":"https://github.com/minofrk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"@minofrk/msf-io-ts\n===============================================================================\n\n[![NPM Version](https://img.shields.io/npm/v/@minofrk/msf-io-ts.svg?style=flat-square)](https://www.npmjs.com/package/@minofrk/msf-io-ts)\n[![License](https://img.shields.io/github/license/minofrk/msf-io-ts.svg?style=flat-square)](LICENSE)\n[![Build Status](https://img.shields.io/travis/com/minofrk/msf-io-ts/master.svg?style=flat-square)](https://travis-ci.com/minofrk/msf-io-ts)\n[![codecov](https://img.shields.io/codecov/c/github/minofrk/msf-io-ts.svg?style=flat-square)](https://codecov.io/gh/minofrk/msf-io-ts)\n\n[MSF 形式](https://github.com/minofrk/mino-seslax-format)を TypeScript で取り扱う上で有用そうな型を [io-ts](https://github.com/gcanti/io-ts) のコーデックとして用意しています。\n\n```typescript\nimport { Move } from '@minofrk/msf-io-ts';\n\n// ...\n\nconst something = JSON.parse(json);\n\nif (!Move.is(something)) {\n    throw new TypeError();\n}\n\nconst move: Move = something;\n```\n\nその他、有用そうな型エイリアスと関数も用意されています（下記参照）\n\nInstall\n-------------------------------------------------------------------------------\n\n```\nnpm install @minofrk/msf-io-ts\n```\n\n加えて [io-ts](https://github.com/gcanti/io-ts) と [fp-ts](https://github.com/gcanti/fp-ts) もインストールします（既にあれば不要です）\n\n```\nnpm install io-ts fp-ts\n```\n\nCodecs\n-------------------------------------------------------------------------------\n\n### 局面、指し手、棋譜\n\n- `State`\n- `Move`\n    - `LeimMove`\n    - `OkkeMove`\n    - `KorMove`\n    - `EvMove`\n    - `SedMove`\n- `MSFType`\n\n### 駒\n\n- `Arxe`\n- `Sorn`\n- `Piece`\n- `Teems`\n- `TurnablePiece`\n\n### その他\n\n- `FalaType` ... 0 以上 2147483647 以下の整数\n- `DateTimeString` ... RFC 3339 に準拠した文字列\n- `Player`\n- `Coordinate` ... 0 以上 6 以下の整数\n- `Position`\n- `FromTo`\n\nType aliases\n-------------------------------------------------------------------------------\n\n上述したコーデックはそのまま型エイリアスとしても使用できます。\n\n加えて以下の型が用意されています。\n\n- `ReadonlyState`\n- `ReadonlyMove`\n    - `ReadonlyLeimMove`\n    - `ReadonlyOkkeMove`\n    - `ReadonlyKorMove`\n    - `ReadonlyEvMove`\n    - `ReadonlySedMove`\n- `ReadonlyMSFType`\n- `ReadonlyPosition`\n- `ReadonlyFromTo`\n\nStrict validators\n-------------------------------------------------------------------------------\n\n仕様への準拠を完全に検査するための関数です。指し手の検査は `Move.is()` で既に完全なので `isSpecCompliantMove()` はありません。\n\n- `isSpecCompliantState()`\n- `isSpecCompliantMSFType()`\n\nLicense\n-------------------------------------------------------------------------------\n\nSee [LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminofrk%2Fmsf-io-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminofrk%2Fmsf-io-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminofrk%2Fmsf-io-ts/lists"}