{"id":22021449,"url":"https://github.com/lamansky/isit","last_synced_at":"2026-05-16T12:31:17.843Z","repository":{"id":57154613,"uuid":"83682995","full_name":"lamansky/isit","owner":"lamansky","description":"[Node.js] Tests a value’s type against a string like 'positive integer' or 'non-empty map'.","archived":false,"fork":false,"pushed_at":"2017-11-27T11:59:31.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T01:28:56.418Z","etag":null,"topics":["javascript","nodejs","type-checking"],"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/lamansky.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-02T13:51:03.000Z","updated_at":"2018-09-19T20:45:35.000Z","dependencies_parsed_at":"2022-09-07T00:41:03.235Z","dependency_job_id":null,"html_url":"https://github.com/lamansky/isit","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/lamansky/isit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamansky%2Fisit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamansky%2Fisit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamansky%2Fisit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamansky%2Fisit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lamansky","download_url":"https://codeload.github.com/lamansky/isit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamansky%2Fisit/sbom","scorecard":{"id":577761,"data":{"date":"2025-08-11","repo":{"name":"github.com/lamansky/isit","commit":"ea38d7bd11fdc29ceb39e0037f0eb979dcef5796"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/4 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license.txt:0","Info: FSF or OSI recognized license: MIT License: license.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-20T18:17:59.995Z","repository_id":57154613,"created_at":"2025-08-20T18:17:59.995Z","updated_at":"2025-08-20T18:17:59.995Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33102730,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["javascript","nodejs","type-checking"],"created_at":"2024-11-30T06:12:06.376Z","updated_at":"2026-05-16T12:31:17.817Z","avatar_url":"https://github.com/lamansky.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# isit\n\nA [Node.js](https://nodejs.org/) module that tests a value’s type against a string like `'positive integer'` or `'non-empty map'`.\n\n## Installation\n\n```bash\nnpm install isit --save\n```\n\n## Usage\n\nWhen calling `isit()`, the first argument is a space-separated string of type tests, and the second argument is the value to be tested. `isit()` returns true only if all tests pass.\n\n```javascript\nconst isit = require('isit')\nisit('non-empty array', [1, 2, 3]) // true\nisit('empty map', new Map()) // true\nisit('positive integer', 1) // true\n```\n\nAvailable tests are listed in the “Type Tests” section below. Anything that does not match one of the available tests will be considered a class name (example: `map` in the above code block).\n\n### Negation\n\nA test can be individually negated by prefixing it with `non-` or `!`, as in:\n\n```javascript\nconst isit = require('isit')\nisit('non-empty array', [1, 2, 3]) // true\nisit('array !empty', [1, 2, 3]) // true\nisit('empty non-array', '') // true\n```\n\n### Create Curried Functions\n\nIf you omit the second argument, a function is returned which runs the test provided in the first argument.\n\n```javascript\nconst isObject = require('isit')('non-array object')\nisObject({}) // true\nisObject([]) // false\n```\n\n### Individual Test Functions\n\nAll tests are also available as member functions of `isit`, allowing you to run a single test like so:\n\n```javascript\nconst isit = require('isit')\nisit.array([]) // true\n\nconst isString = require('isit').string\nisString('test') // true\n```\n\n## Type Tests\n\nHere is the complete list:\n\n* `arguments` / `args`\n* `array`\n* `blank`\n* `boolean` / `bool`\n* `boolish`\n* `buffer`\n* `collection`\n* `empty`\n* `false`\n* `falsey`\n* `float`\n* `finite`\n* `function`\n* `generator`\n* `infinity`\n* `integer` / `int`\n* `iterable`\n* `nan`\n* `negative`\n* `nil`\n* `null`\n* `number`\n* `numberish`\n* `numeric`\n* `object`\n* `objectbased`\n* `plain`\n* `positive`\n* `primitive`\n* `scalar`\n* `string`\n* `stringish`\n* `symbol`\n* `true`\n* `truthy`\n* `typedarray`\n* `undefined` / `undef`\n\n### Undefined \u0026 Null\n\n| Value:      | `undefined`\u003cbr\u003e`undef` | `null` | `nil` |\n| ----------- | :--------------------: | :----: | :---: |\n| `undefined` | ✔                      |        | ✔     |\n| `null`      |                        | ✔      | ✔     |\n\n### Primitives \u0026 Scalars\n\n| Value Type: | `primitive` | `scalar` |\n| ----------- | :---------: | :------: |\n| Undefined   | ✔           |          |\n| Null        | ✔           |          |\n| Boolean     | ✔           | ✔        |\n| Number      | ✔           | ✔        |\n| String      | ✔           | ✔        |\n| Symbol      | ✔           | ✔        |\n| Object      |             |          |\n| Function    |             |          ||\n\n### Booleans\n\n| Value:               | `boolean`\u003cbr\u003e`bool` | `boolish` |\n| -------------------- | :-----------------: | :-------: |\n| `true`               | ✔                   | ✔         |\n| `false`              | ✔                   | ✔         |\n| `'true'` string      |                     | ✔         |\n| `'false'` string     |                     | ✔         |\n| `new Boolean(true)`  |                     | ✔         |\n| `new Boolean(false)` |                     | ✔         |\n\n| Value:              | `true` | `truthy` |\n| ------------------- | :----: | :------: |\n| `true`              | ✔      | ✔        |\n| `new Boolean(true)` | ✔      | ✔        |\n| `'true'` string     | ✔      | ✔        |\n| `'false'` string    |        |          |\n| `1`                 |        | ✔        |\n| `'test'`            |        | ✔        |\n| `[]`                |        | ✔        |\n\n| Value:               | `false` | `falsey` |\n| -------------------- | :-----: | :------: |\n| `false`              | ✔       | ✔        |\n| `new Boolean(false)` | ✔       | ✔        |\n| `'false'` string     | ✔       | ✔        |\n| `0`                  |         | ✔        |\n| `''`                 |         | ✔        |\n\n### Empty Values\n\nEvery empty-checker out there assesses “emptiness” a bit differently. For our purposes, an empty value is one which contains no useful information except the absence of a value. Therefore, unlike many similar functions, the `empty` test does _not_ consider `0`, `false`, or zero-parameter functions to be “empty,” because these can often be intended as actual values.\n\n| Value:        | `empty` |\n| ------------- | :-----: |\n| `undefined`   | ✔       |\n| `null`        | ✔       |\n| `NaN`         | ✔       |\n| `0`           |         |\n| `false`       |         |\n| `''`          | ✔       |\n| `{}`          | ✔       |\n| `[]`          | ✔       |\n| `() =\u003e {}`    |         |\n| `new Error()` |         |\n| `new Map()`   | ✔       |\n| `new Set()`   | ✔       |\n\n#### Blank Values\n\nThe `blank` test is the same as `empty` except it also returns `true` for strings that consist only of whitespace.\n\n### Functions\n\n| Value:              | `function` | `generator` |\n| ------------------- | :--------: | :---------: |\n| `function () {}`    | ✔          |             |\n| `() =\u003e {}`          | ✔          |             |\n| `function* () {}`   | ✔          | ✔           |\n\n### Numbers\n\n| Value:          | `number` | `numberish` | `numeric` |\n| --------------- | :------: | :---------: | :-------: |\n| `0`             | ✔        | ✔           | ✔         |\n| `1.23`          | ✔        | ✔           | ✔         |\n| `new Number(1)` |          | ✔           | ✔         |\n| `'1'`           |          |             | ✔         |\n| `'1e3'`         |          |             | ✔         |\n| `NaN`           |          |             |           ||\n\n| Value:          | `positive` | `negative` |\n| --------------- | :--------: | :--------: |\n| `Infinity`      | ✔          |            |\n| `123.45`        | ✔          |            |\n| `0`             | ✔          |            |\n| `-0`            |            | ✔          |\n| `-123.45`       |            | ✔          |\n| `-Infinity`     |            | ✔          |\n\nJavaScript considers the number zero to be either positively or negatively signed; therefore, `positive` reports `true` for `0`. If you want to exclude zero, consider using a simple `x\u003e0` test instead.\n\nMore Number Tests:\n* `nan`\n* `integer` / `int`\n* `float`\n* `finite`\n* `infinity`\n\n### Objects\n\nAlthough functions are technically objects in JavaScript, they are often considered a separate category because the `typeof` operator gives them their own type. Use `objectbased` if you want to include functions.\n\n| Value:       | `object` | `objectbased` |\n| ------------ | :------: | :-----------: |\n| `{}`         | ✔        | ✔             |\n| `() =\u003e {}`   |          | ✔             |\n\n| Value:       | `object` | `plain` | `array` |\n| ------------ | :------: | :-----: | :-----: |\n| `new Date()` | ✔        |         |         |\n| `{}`         | ✔        | ✔       |         |\n| `[]`         | ✔        |         | ✔       |\n\nThe `object` test returns `true` for arrays, because arrays are objects in JavaScript. If you want to exclude arrays, test against `'non-array object'` instead.\n\n#### Arguments\n\n`arguments` or `args` returns true if the value is an Arguments object.\n\n#### Buffers\n\nThe `buffer` test returns true if the value is a Node.js or Browserify Buffer.\n\n#### Collections\n\nThe `collection` test returns true if the value is an instance of one of:\n* Map\n* Set\n* WeakMap\n* WeakSet\n\n#### Iterables\n\nThe `iterable` test returns true if [`for...of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) can be used to iterate through the value.\n\n#### Typed Arrays\n\nThe `typedarray` test returns true if the value is an instance of one of:\n* Int8Array\n* Uint8Array\n* Uint8ClampedArray\n* Int16Array\n* Uint16Array\n* Int32Array\n* Uint32Array\n* Float32Array\n* Float64Array\n\n### Strings\n\n| Value:               | `string` | `stringish` |\n| -------------------- | :------: | :---------: |\n| `''`                 | ✔        | ✔           |\n| `'test'`             | ✔        | ✔           |\n| `new String('test')` |          | ✔           |\n\n### Symbols\n\nThe `symbol` test returns true if the value is a symbol.\n\n## Class Testing\n\nYou can use `isit.a` or `isit.an` to see if an object is an instance of a given class.\n\nYou can provide the class itself or the class name as a case-insensitive string.\n\n```javascript\nconst isit = require('isit')\n\nisit.a(Date, new Date()) // true\nisit.a('date', new Date()) // true\n\nisit.an(Error, new Error()) // true\nisit.an('error', new Error()) // true\n\n// Returns true because TypeError extends Error\nisit.an(Error, new TypeError()) // true\n```\n\nYou can also check if a given value is an instance of any one of a list of classes:\n\n```javascript\nconst isit = require('isit')\n\nisit.a([TypeError, ReferenceError], new TypeError()) // true\nisit.a('TypeError ReferenceError', new TypeError()) // true\n```\n\n## Advanced Usage\n\n### Adding or Overriding Tests\n\nYou can add new tests, or override existing ones, by requiring `isit/x` and calling it as a function with the additional tests as an object argument. For example:\n\n```javascript\nconst isit = require('isit/x')({\n  zero: value =\u003e value === 0\n})\nisit('negative zero', -0) // true\nisit('non-zero integer', 1) // true\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamansky%2Fisit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flamansky%2Fisit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamansky%2Fisit/lists"}