{"id":15686823,"url":"https://github.com/ljharb/unbox-primitive","last_synced_at":"2025-04-07T07:18:32.628Z","repository":{"id":53536335,"uuid":"201684901","full_name":"ljharb/unbox-primitive","owner":"ljharb","description":"Unbox a boxed JS primitive value.","archived":false,"fork":false,"pushed_at":"2024-12-16T06:44:59.000Z","size":84,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-31T06:06:42.241Z","etag":null,"topics":["boxed","ecmascript","javascript","object","primitive","unbox"],"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/ljharb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["ljharb"],"patreon":null,"open_collective":null,"ko_fi":"ljharb","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":"ljharb","custom":null}},"created_at":"2019-08-10T21:30:04.000Z","updated_at":"2025-02-06T20:18:17.000Z","dependencies_parsed_at":"2025-01-16T14:15:22.751Z","dependency_job_id":"3e570452-371d-4c8e-8953-091416ee9345","html_url":"https://github.com/ljharb/unbox-primitive","commit_stats":{"total_commits":46,"total_committers":2,"mean_commits":23.0,"dds":"0.021739130434782594","last_synced_commit":"dd0e3733bb9db65d254492d6c1d1b710005b932f"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ljharb%2Funbox-primitive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ljharb%2Funbox-primitive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ljharb%2Funbox-primitive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ljharb%2Funbox-primitive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ljharb","download_url":"https://codeload.github.com/ljharb/unbox-primitive/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247608160,"owners_count":20965953,"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":["boxed","ecmascript","javascript","object","primitive","unbox"],"created_at":"2024-10-03T17:41:28.924Z","updated_at":"2025-04-07T07:18:32.605Z","avatar_url":"https://github.com/ljharb.png","language":"JavaScript","funding_links":["https://github.com/sponsors/ljharb","https://ko-fi.com/ljharb","https://thanks.dev/ljharb"],"categories":[],"sub_categories":[],"readme":"# unbox-primitive \u003csup\u003e[![Version Badge][npm-version-svg]][package-url]\u003c/sup\u003e\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![dependency status][deps-svg]][deps-url]\n[![dev dependency status][dev-deps-svg]][dev-deps-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nUnbox a boxed JS primitive value. This module works cross-realm/iframe, does not depend on `instanceof` or mutable properties, and works despite ES6 Symbol.toStringTag.\n\n## Example\n\n```js\nvar unboxPrimitive = require('unbox-primitive');\nvar assert = require('assert');\n\nassert.equal(unboxPrimitive(new Boolean(false)), false);\nassert.equal(unboxPrimitive(new String('f')), 'f');\nassert.equal(unboxPrimitive(new Number(42)), 42);\nconst s = Symbol();\nassert.equal(unboxPrimitive(Object(s)), s);\nassert.equal(unboxPrimitive(new BigInt(42)), 42n);\n\n// any primitive, or non-boxed-primitive object, will throw\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.org/package/unbox-primitive\n[npm-version-svg]: https://versionbadg.es/ljharb/unbox-primitive.svg\n[deps-svg]: https://david-dm.org/ljharb/unbox-primitive.svg\n[deps-url]: https://david-dm.org/ljharb/unbox-primitive\n[dev-deps-svg]: https://david-dm.org/ljharb/unbox-primitive/dev-status.svg\n[dev-deps-url]: https://david-dm.org/ljharb/unbox-primitive#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/unbox-primitive.png?downloads=true\u0026stars=true\n[license-image]: https://img.shields.io/npm/l/unbox-primitive.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/unbox-primitive.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=unbox-primitive\n[codecov-image]: https://codecov.io/gh/ljharb/unbox-primitive/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/ljharb/unbox-primitive/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/unbox-primitive\n[actions-url]: https://github.com/ljharb/unbox-primitive/actions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fljharb%2Funbox-primitive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fljharb%2Funbox-primitive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fljharb%2Funbox-primitive/lists"}