{"id":17681663,"url":"https://github.com/phawk/js-typeof","last_synced_at":"2025-07-01T10:03:50.511Z","repository":{"id":4730398,"uuid":"5879129","full_name":"phawk/js-typeOf","owner":"phawk","description":"A better typeOf method for JavaScript, where null !== \"object\"","archived":false,"fork":false,"pushed_at":"2013-02-07T21:06:49.000Z","size":172,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T19:22:46.022Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phawk.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}},"created_at":"2012-09-19T22:53:59.000Z","updated_at":"2013-10-17T19:31:39.000Z","dependencies_parsed_at":"2022-09-10T18:22:16.466Z","dependency_job_id":null,"html_url":"https://github.com/phawk/js-typeOf","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/phawk/js-typeOf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phawk%2Fjs-typeOf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phawk%2Fjs-typeOf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phawk%2Fjs-typeOf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phawk%2Fjs-typeOf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phawk","download_url":"https://codeload.github.com/phawk/js-typeOf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phawk%2Fjs-typeOf/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262941541,"owners_count":23388148,"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-24T09:11:48.773Z","updated_at":"2025-07-01T10:03:50.487Z","avatar_url":"https://github.com/phawk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# js typeOf\n\n## typeOf(Object)\n\nJavaScripts typeof operator sucks! This aims to provide an extremely simple method to call to check typeof and should be a little more epectable, and reduce boilerplate on your input checking. \n\n```js\n// Rudementary example\nif (objectToTest \u0026\u0026 typeof objectToTest === \"object\" \u0026\u0026 objectToTest instanceof Array)\n\n// Easier\nif (typeOf(objectToTest) === \"array\")\n```\n\n## is(Object, \"Object\")\n\nUsed for shorthand comparisons, returns a boolean.\n\n```js\nvar obj = {};\n\nis(obj, \"object\"); // true\nis(obj, \"string\"); // false\n```\n\n## Changelog\n\n### v0.3.0\n\n* Switched is(\"number\", 5) to is(5, \"number\") for better readability.\n* Added more resiliant check for null and undefined for odd environments, like phantomJS.\n\n### v0.2.0\n\n* Simpler and more accurate calculation using `Object.toString.\n* Now with `is()` method for comparisons\n* typeOf(new Date()) now equals \"date\"\n* typeOf(new Error()) now equals \"error\"\n\n### v0.1.2\n\n* Massively simplify and optimise\n\n### v0.1.1\n\n* Custom constructors return typeof as `object`\n* The only two objects that do return a different typeof are `Array` and `RegExp`\n\n### v0.1.0\n\n* Added support for `null`\n* Add extra tests","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphawk%2Fjs-typeof","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphawk%2Fjs-typeof","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphawk%2Fjs-typeof/lists"}