{"id":17321771,"url":"https://github.com/avoidwork/tiny-coerce","last_synced_at":"2025-04-14T16:06:20.601Z","repository":{"id":66013707,"uuid":"48695105","full_name":"avoidwork/tiny-coerce","owner":"avoidwork","description":"Tiny coercion library for Client or Server","archived":false,"fork":false,"pushed_at":"2024-10-09T00:57:53.000Z","size":775,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-11T21:31:07.288Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://avoidwork.github.io/tiny-coerce","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/avoidwork.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":["avoidwork"]}},"created_at":"2015-12-28T13:59:14.000Z","updated_at":"2024-10-09T00:57:49.000Z","dependencies_parsed_at":"2023-03-27T12:04:19.031Z","dependency_job_id":"d626d495-160b-4248-ab93-9c8e1674196b","html_url":"https://github.com/avoidwork/tiny-coerce","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avoidwork%2Ftiny-coerce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avoidwork%2Ftiny-coerce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avoidwork%2Ftiny-coerce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avoidwork%2Ftiny-coerce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avoidwork","download_url":"https://codeload.github.com/avoidwork/tiny-coerce/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":220246615,"owners_count":16617713,"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":[],"created_at":"2024-10-15T13:39:32.373Z","updated_at":"2024-10-18T04:52:39.062Z","avatar_url":"https://github.com/avoidwork.png","language":"JavaScript","funding_links":["https://github.com/sponsors/avoidwork"],"categories":[],"sub_categories":[],"readme":"# Tiny Coerce\n\nString to primitive coercion for Client or Server. It's great for DOM data attributes, localStorage,\nand other cases where your need to store a String.\n\n## Using the function\n\n```javascript\nimport {coerce} from \"tiny-coerce\";\n\nconsole.log(coerce(\"true\")); // true\nconsole.log(coerce(\"null\")); // null\nconsole.log(coerce({a: {b: \"50\"}}, true).a.b) // 50\n```\n\n## Testing\n\nTiny Coerce has 100% code coverage with its tests.\n\n```console\n-----------------|---------|----------|---------|---------|-------------------\nFile             | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s\n-----------------|---------|----------|---------|---------|-------------------\nAll files        |     100 |     86.2 |     100 |     100 |                  \n tiny-coerce.cjs |     100 |     86.2 |     100 |     100 | 22-24,36         \n-----------------|---------|----------|---------|---------|-------------------\n```\n\n## API\n\n##### coerce (arg[, deep = false])\nReturns a coercion of `arg`. Deep coercion is optional with the second parameter.\n\nFirst parameter is trimmed before coercion!\n\n## License\nCopyright (c) 2023 Jason Mulligan\nLicensed under the BSD-3 license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favoidwork%2Ftiny-coerce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favoidwork%2Ftiny-coerce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favoidwork%2Ftiny-coerce/lists"}