{"id":15979111,"url":"https://github.com/perry-mitchell/to-bool","last_synced_at":"2025-05-07T06:43:47.377Z","repository":{"id":74696492,"uuid":"39375913","full_name":"perry-mitchell/to-bool","owner":"perry-mitchell","description":"Convert types to boolean.","archived":false,"fork":false,"pushed_at":"2015-07-20T10:27:58.000Z","size":132,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T07:22:32.622Z","etag":null,"topics":["bool","boolean","convert-data","convert-types"],"latest_commit_sha":null,"homepage":null,"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/perry-mitchell.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}},"created_at":"2015-07-20T09:47:43.000Z","updated_at":"2023-03-21T08:15:12.000Z","dependencies_parsed_at":"2023-02-24T14:40:54.747Z","dependency_job_id":null,"html_url":"https://github.com/perry-mitchell/to-bool","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/perry-mitchell%2Fto-bool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Fto-bool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Fto-bool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perry-mitchell%2Fto-bool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/perry-mitchell","download_url":"https://codeload.github.com/perry-mitchell/to-bool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252831176,"owners_count":21810779,"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":["bool","boolean","convert-data","convert-types"],"created_at":"2024-10-07T23:41:13.691Z","updated_at":"2025-05-07T06:43:47.355Z","avatar_url":"https://github.com/perry-mitchell.png","language":"JavaScript","readme":"# To-Bool\nConvert data types to boolean.\n\n## About\nThis is a very basic utility library to help convert the basic JS data types to boolean. Each type is treated differently:\n\n * *Boolean* is returned as-is\n * *Function* is assumed to be true\n * *Number* is true for greater-or-less-than 0\n * *Object* is just cast to boolean (`!!`), which works for `null` (as `typeof null === \"object\"`)\n * *String* is converted to lower-case and compared to `\"true\"` or `\"1\"`\n * *Symbol* is currently treated as always-true\n * *Undefined* is always false\n\nIf none of these types match the passed item, a `TypeError` is thrown.\n\n## Usage\n\nUsage is super easy:\n\n```\nvar toBool = require(\"to-bool\");\n\nif (toBool(someVariable)) {\n\tconsole.log(\"It's true.\");\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperry-mitchell%2Fto-bool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperry-mitchell%2Fto-bool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperry-mitchell%2Fto-bool/lists"}