{"id":20129359,"url":"https://github.com/ryanmorr/typed","last_synced_at":"2026-06-12T14:31:41.759Z","repository":{"id":31547785,"uuid":"35112406","full_name":"ryanmorr/typed","owner":"ryanmorr","description":"Statically typed properties for object literals","archived":false,"fork":false,"pushed_at":"2024-01-22T18:25:29.000Z","size":64,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-02T21:32:27.655Z","etag":null,"topics":["data","javascript","object","properties","statically-typed"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryanmorr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2015-05-05T16:55:25.000Z","updated_at":"2024-01-21T20:27:40.000Z","dependencies_parsed_at":"2024-11-13T20:35:31.236Z","dependency_job_id":"e7d5d628-2222-4524-bd62-3a5cd9aab8df","html_url":"https://github.com/ryanmorr/typed","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ryanmorr/typed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Ftyped","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Ftyped/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Ftyped/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Ftyped/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanmorr","download_url":"https://codeload.github.com/ryanmorr/typed/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Ftyped/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34249560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"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":["data","javascript","object","properties","statically-typed"],"created_at":"2024-11-13T20:33:52.674Z","updated_at":"2026-06-12T14:31:41.740Z","avatar_url":"https://github.com/ryanmorr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# typed\n\n[![Version Badge][version-image]][project-url]\n[![License][license-image]][license-url]\n[![Build Status][build-image]][build-url]\n\n\u003e Statically typed properties for object literals\n\n## Install\n\nDownload the [CJS](https://github.com/ryanmorr/typed/raw/master/dist/cjs/typed.js), [ESM](https://github.com/ryanmorr/typed/raw/master/dist/esm/typed.js), [UMD](https://github.com/ryanmorr/typed/raw/master/dist/umd/typed.js) versions or install via NPM:\n\n```sh\nnpm install @ryanmorr/typed\n```\n\n## Usage\n\nRestrict properties to a native data type:\n\n```javascript\nimport typed from '@ryanmorr/typed';\n\nconst object = typed({\n    foo: String,\n    bar: Number \n});\n\nobject.foo = 'foo';\nobject.bar = 123;\n```\n\nConstrain a property to a user-defined constructor:\n\n```javascript\nfunction Foo() {}\n\nconst object = typed({\n    foo: Foo\n});\n\nobject.foo = new Foo();\n```\n\nIf a value of the wrong type is assigned to a property, a `TypeError` will be thrown:\n\n```javascript\nconst object = typed({\n    foo: String\n});\n\nobject.foo = 123 // throws: Invalid value assignment on \"foo\", expected: String, actual: Number\n```\n\n## License\n\nThis project is dedicated to the public domain as described by the [Unlicense](http://unlicense.org/).\n\n[project-url]: https://github.com/ryanmorr/typed\n[version-image]: https://img.shields.io/github/package-json/v/ryanmorr/typed?color=blue\u0026style=flat-square\n[build-url]: https://github.com/ryanmorr/typed/actions\n[build-image]: https://img.shields.io/github/actions/workflow/status/ryanmorr/typed/node.js.yml?style=flat-square\n[license-image]: https://img.shields.io/github/license/ryanmorr/typed?color=blue\u0026style=flat-square\n[license-url]: UNLICENSE","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanmorr%2Ftyped","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanmorr%2Ftyped","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanmorr%2Ftyped/lists"}