{"id":13683406,"url":"https://github.com/sniptt-official/guards","last_synced_at":"2026-01-27T11:01:35.136Z","repository":{"id":40702400,"uuid":"269128394","full_name":"sniptt-official/guards","owner":"sniptt-official","description":"🛡 Comprehensive collection of type guards for JavaScript and TypeScript; Inspired by Elixir","archived":false,"fork":false,"pushed_at":"2023-03-04T22:04:17.000Z","size":824,"stargazers_count":180,"open_issues_count":5,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-08T10:28:44.469Z","etag":null,"topics":["deno","elixir","erlang","javascript","nodejs","type-guards","type-safety","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/sniptt-official.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"patreon":"sniptt"}},"created_at":"2020-06-03T15:41:22.000Z","updated_at":"2025-07-29T15:27:18.000Z","dependencies_parsed_at":"2024-01-07T21:06:11.987Z","dependency_job_id":"3df154dd-31bd-4627-9080-b49e3e43314d","html_url":"https://github.com/sniptt-official/guards","commit_stats":{"total_commits":36,"total_committers":2,"mean_commits":18.0,"dds":0.02777777777777779,"last_synced_commit":"76ff862ed0eb2d3bcc622552e255426cf274a67b"},"previous_names":["hqoss/guards"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/sniptt-official/guards","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sniptt-official%2Fguards","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sniptt-official%2Fguards/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sniptt-official%2Fguards/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sniptt-official%2Fguards/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sniptt-official","download_url":"https://codeload.github.com/sniptt-official/guards/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sniptt-official%2Fguards/sbom","scorecard":{"id":470325,"data":{"date":"2025-08-11","repo":{"name":"github.com/sniptt-official/guards","commit":"76ff862ed0eb2d3bcc622552e255426cf274a67b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.3,"checks":[{"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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"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":"Code-Review","score":0,"reason":"Found 0/30 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":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"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":"SAST","score":10,"reason":"SAST tool detected: CodeQL","details":["Info: SAST configuration detected: CodeQL","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":"Pinned-Dependencies","score":2,"reason":"dependency not pinned by hash detected -- score normalized to 2","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/sniptt-official/guards/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/sniptt-official/guards/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/sniptt-official/guards/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/sniptt-official/guards/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/sniptt-official/guards/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:71: update your workflow using https://app.stepsecurity.io/secureworkflow/sniptt-official/guards/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yaml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/sniptt-official/guards/publish.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yaml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/sniptt-official/guards/publish.yaml/main?enable=pin","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   2 out of   2 npmCommand dependencies pinned"],"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29","Warn: no topLevel permission defined: .github/workflows/ci.yaml:1","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/publish.yaml:1","Info: no jobLevel write permissions found"],"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":"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":"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:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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"}},{"name":"Vulnerabilities","score":0,"reason":"20 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-h5c3-5r3r-rr8q","Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj","Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T13:44:14.728Z","repository_id":40702400,"created_at":"2025-08-19T13:44:14.728Z","updated_at":"2025-08-19T13:44:14.728Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28812367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T07:41:26.337Z","status":"ssl_error","status_checked_at":"2026-01-27T07:41:08.776Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["deno","elixir","erlang","javascript","nodejs","type-guards","type-safety","typescript"],"created_at":"2024-08-02T13:02:10.182Z","updated_at":"2026-01-27T11:01:35.105Z","avatar_url":"https://github.com/sniptt-official.png","language":"TypeScript","funding_links":["https://patreon.com/sniptt"],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://sniptt.com\"\u003e\n    \u003cimg src=\".github/assets/guards-social-cover.svg\" alt=\"Guards Logo\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"right\"\u003e\n  \u003ci\u003eIf you use this repo, star it ✨\u003c/i\u003e\n\u003c/p\u003e\n\n***\n\n\u003cp align=\"center\"\u003e👻 \u003cb\u003eComprehensive collection of type guards for JavaScript and TypeScript\u003c/b\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  Inspired by \u003ca href=\"https://hexdocs.pm/elixir/guards.html\" target=\"_blank\"\u003eElixir guards\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eZero dependencies\u003c/b\u003e 💪\n\u003c/p\u003e\n\n***\n\n## Install\n\n### Node.js and the browser\n\n```sh\nnpm install @sniptt/guards\n```\n\n### Deno\n\n```typescript\nimport { ... } from 'https://deno.land/x/guards/mod.ts'\n\n// TODO\n```\n\n## Usage\n\n### Foreword on JavaScript data types and data structures\n\nThe latest ECMAScript standard defines nine types:\n\n*   Six **Data Types** that are primitives, checked by `typeof` operator:\n    *   `undefined`: `typeof instance === \"undefined\"`\n    *   `Boolean`: `typeof instance === \"boolean\"`\n    *   `Number`: `typeof instance === \"number\"`\n    *   `String`: `typeof instance === \"string\"`\n    *   `BigInt`: `typeof instance === \"bigint\"`\n    *   `Symbol`: `typeof instance === \"symbol\"`\n*   **Structural Types**:\n    *   `Object`: `typeof instance === \"object\"`. Special non-data but structural type for any constructed object instance also used as data structures: new `Object`, new `Array`, new `Map`, new `Set`, new `WeakMap`, new `WeakSet`, new `Date` and almost everything made with `new` keyword;\n    *   `Function` non data structure, though it also answers for `typeof` operator: `typeof instance === \"function\"`. This answer is done as a special shorthand for `Function`s, though every `Function` constructor is derived from `Object` constructor.\n*   **Structural Root** Primitive\n    *   `null`: `typeof instance === \"object\"`. Special primitive type having additional usage for it's value: if object is not inherited, then `null` is shown;\n\nSource: \u003chttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures\u003e\n\n### Type coercion\n\n![Type coercion example](.github/assets/type-coercion.png)\n\n### Primitives\n\nSample usage:\n\n```typescript\nimport { primitives } from '@sniptt/guards';\n\nprimitives.isNumber(val);\n```\n\nor\n\n```typescript\nimport { isNumber } from '@sniptt/guards';\n\nisNumber(val);\n```\n\n#### `isBigInt`\n\n```typescript\nimport { isBigInt } from '@sniptt/guards';\n\nlet val: bigint | number;\n\nif (isBigInt(val)) {\n  // TypeScript will infer val: bigint\n} else {\n  // TypeScript will infer val: number\n}\n```\n\n#### `isBoolean`\n\n```typescript\nimport { isBoolean } from '@sniptt/guards';\n\nlet val: boolean | number;\n\nif (isBoolean(val)) {\n  // TypeScript will infer val: boolean\n} else {\n  // TypeScript will infer val: number\n}\n```\n\n#### `isNumber`\n\nAnswers `false` to `NaN`!\n\nSee also:\n\n*   [isNumberOrNaN](#isnumberornan)\n*   [isInteger](#isinteger)\n*   [isBigInt](#isbigint)\n\n```typescript\nimport { isNumber } from '@sniptt/guards';\n\nlet val: number | string;\n\nif (isNumber(val)) {\n  // TypeScript will infer val: number\n} else {\n  // TypeScript will infer val: string\n}\n```\n\n#### `isString`\n\n```typescript\nimport { isString } from '@sniptt/guards';\n\nlet val: string | number;\n\nif (isString(val)) {\n  // TypeScript will infer val: string\n} else {\n  // TypeScript will infer val: number\n}\n```\n\n#### `isSymbol`\n\n```typescript\nimport { isSymbol } from '@sniptt/guards';\n\nlet val: symbol | string;\n\nif (isSymbol(val)) {\n  // TypeScript will infer val: symbol\n} else {\n  // TypeScript will infer val: string\n}\n```\n\n#### `isUndefined`\n\n```typescript\nimport { isUndefined } from '@sniptt/guards';\n\nlet val: undefined | null;\n\nif (isUndefined(val)) {\n  // TypeScript will infer val: undefined\n} else {\n  // TypeScript will infer val: null\n}\n```\n\n### Structural\n\nSample usage:\n\n```typescript\nimport { structural } from '@sniptt/guards';\n\nstructural.isMap(val);\n```\n\nor\n\n```typescript\nimport { isMap } from '@sniptt/guards';\n\nisMap(val);\n```\n\n#### `isNull`\n\nAnswers `true` if and only if `value === null`.\n\n#### `isFunction`\n\nAnswers `true` if and only if `typeof value === \"function\"`.\n\n#### `isObject`\n\nAnswers `false` to `null`!\n\nTo check for array:\n\n```typescript\nisArray(term)\n```\n\nTo check for object *or* null:\n\n```typescript\nisObjectOrNull(term)\n```\n\n#### `isArray`\n\nAnswers `true` if and only if `Array.isArray(value) === true`.\n\n#### `isMap`\n\nAnswers `true` if and only if `(value instanceof Map) === true`.\n\n#### `isSet`\n\nAnswers `true` if and only if `(value instanceof Set) === true`.\n\n#### `isWeakMap`\n\nAnswers `true` if and only if `(value instanceof WeakMap) === true`.\n\n#### `isWeakSet`\n\nAnswers `true` if and only if `(value instanceof WeakSet) === true`.\n\n#### `isDate`\n\nAnswers `true` if and only if `(value instanceof Date) === true`.\n\n### Convenience\n\nSample usage:\n\n```typescript\nimport { convenience } from '@sniptt/guards';\n\nconvenience.isNonEmptyArray(val);\n```\n\nor\n\n```typescript\nimport { isNonEmptyArray } from '@sniptt/guards';\n\nisNonEmptyArray(val);\n```\n\n#### `isObjectOrNull`\n\n```typescript\ntest(\"isObjectOrNull\", (t) =\u003e {\n  t.is(convenience.isObjectOrNull({}), true);\n  t.is(convenience.isObjectOrNull(null), true);\n  t.is(convenience.isObjectOrNull(new Set()), true);\n});\n```\n\n#### `isNonEmptyArray`\n\n```typescript\ntest(\"isNonEmptyArray\", (t) =\u003e {\n  t.is(convenience.isNonEmptyArray([1, 2]), true);\n  t.is(convenience.isNonEmptyArray([1]), true);\n  t.is(convenience.isNonEmptyArray([]), false);\n});\n```\n\n#### `isNonEmptyString`\n\n```typescript\ntest(\"isNonEmptyString\", (t) =\u003e {\n  t.is(convenience.isNonEmptyString(\"a\"), true);\n  t.is(convenience.isNonEmptyString(\"\"), false);\n});\n```\n\n#### `isNumberOrNaN`\n\n```typescript\ntest(\"isNumberOrNaN\", (t) =\u003e {\n  t.is(convenience.isNumberOrNaN(0), true);\n  t.is(convenience.isNumberOrNaN(42), true);\n  t.is(convenience.isNumberOrNaN(-42), true);\n  t.is(convenience.isNumberOrNaN(3.14), true);\n  t.is(convenience.isNumberOrNaN(-3.14), true);\n  t.is(convenience.isNumberOrNaN(Infinity), true);\n  t.is(convenience.isNumberOrNaN(-Infinity), true);\n  t.is(convenience.isNumberOrNaN(Number.MAX_SAFE_INTEGER), true);\n  t.is(convenience.isNumberOrNaN(-Number.MAX_SAFE_INTEGER), true);\n  t.is(convenience.isNumberOrNaN(NaN), true);\n  t.is(convenience.isNumberOrNaN(BigInt(0)), false);\n});\n```\n\n#### `isInteger`\n\n```typescript\ntest(\"isInteger\", (t) =\u003e {\n  t.is(convenience.isInteger(0), true);\n  t.is(convenience.isInteger(42), true);\n  t.is(convenience.isInteger(-42), true);\n  t.is(convenience.isInteger(3.14), false);\n  t.is(convenience.isInteger(-3.14), false);\n  t.is(convenience.isInteger(Infinity), false);\n  t.is(convenience.isInteger(-Infinity), false);\n  t.is(convenience.isInteger(Number.MAX_SAFE_INTEGER), true);\n  t.is(convenience.isInteger(-Number.MAX_SAFE_INTEGER), true);\n  t.is(convenience.isInteger(NaN), false);\n});\n```\n\n#### `isPositiveInteger`\n\n```typescript\ntest(\"isPositiveInteger\", (t) =\u003e {\n  t.is(convenience.isPositiveInteger(0), false);\n  t.is(convenience.isPositiveInteger(42), true);\n  t.is(convenience.isPositiveInteger(-42), false);\n  t.is(convenience.isPositiveInteger(3.14), false);\n  t.is(convenience.isPositiveInteger(-3.14), false);\n  t.is(convenience.isPositiveInteger(Infinity), false);\n  t.is(convenience.isPositiveInteger(-Infinity), false);\n  t.is(convenience.isPositiveInteger(Number.MAX_SAFE_INTEGER), true);\n  t.is(convenience.isPositiveInteger(-Number.MAX_SAFE_INTEGER), false);\n  t.is(convenience.isPositiveInteger(NaN), false);\n});\n```\n\n#### `isNonNegativeInteger`\n\n```typescript\ntest(\"isNonNegativeInteger\", (t) =\u003e {\n  t.is(convenience.isNonNegativeInteger(0), true);\n  t.is(convenience.isNonNegativeInteger(42), true);\n  t.is(convenience.isNonNegativeInteger(-42), false);\n  t.is(convenience.isNonNegativeInteger(3.14), false);\n  t.is(convenience.isNonNegativeInteger(-3.14), false);\n  t.is(convenience.isNonNegativeInteger(Infinity), false);\n  t.is(convenience.isNonNegativeInteger(-Infinity), false);\n  t.is(convenience.isNonNegativeInteger(Number.MAX_SAFE_INTEGER), true);\n  t.is(convenience.isNonNegativeInteger(-Number.MAX_SAFE_INTEGER), false);\n  t.is(convenience.isNonNegativeInteger(NaN), false);\n});\n```\n\n#### `isNegativeInteger`\n\n```typescript\ntest(\"isNegativeInteger\", (t) =\u003e {\n  t.is(convenience.isNegativeInteger(0), false);\n  t.is(convenience.isNegativeInteger(42), false);\n  t.is(convenience.isNegativeInteger(-42), true);\n  t.is(convenience.isNegativeInteger(3.14), false);\n  t.is(convenience.isNegativeInteger(-3.14), false);\n  t.is(convenience.isNegativeInteger(Infinity), false);\n  t.is(convenience.isNegativeInteger(-Infinity), false);\n  t.is(convenience.isNegativeInteger(Number.MAX_SAFE_INTEGER), false);\n  t.is(convenience.isNegativeInteger(-Number.MAX_SAFE_INTEGER), true);\n  t.is(convenience.isNegativeInteger(NaN), false);\n});\n```\n\n## API Docs\n\n[Full API Documentation](docs/README.md).\n\n## License\n\nSee [LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsniptt-official%2Fguards","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsniptt-official%2Fguards","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsniptt-official%2Fguards/lists"}