{"id":30512808,"url":"https://github.com/akanshgulati/are","last_synced_at":"2025-10-30T21:40:31.471Z","repository":{"id":47938824,"uuid":"201125931","full_name":"akanshgulati/are","owner":"akanshgulati","description":"Library for type checking elements of array","archived":false,"fork":false,"pushed_at":"2023-01-05T01:09:02.000Z","size":957,"stargazers_count":4,"open_issues_count":12,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-10T17:18:42.305Z","etag":null,"topics":["array","boolean","hacktoberfest","hacktoberfest2021","npm","npm-package","number","string","util","utility"],"latest_commit_sha":null,"homepage":"http://bit.ly/akanshgulati-are","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/akanshgulati.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":"2019-08-07T20:50:00.000Z","updated_at":"2021-10-05T18:34:47.000Z","dependencies_parsed_at":"2023-02-03T03:17:40.570Z","dependency_job_id":null,"html_url":"https://github.com/akanshgulati/are","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/akanshgulati/are","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akanshgulati%2Fare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akanshgulati%2Fare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akanshgulati%2Fare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akanshgulati%2Fare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akanshgulati","download_url":"https://codeload.github.com/akanshgulati/are/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akanshgulati%2Fare/sbom","scorecard":{"id":175380,"data":{"date":"2025-08-11","repo":{"name":"github.com/akanshgulati/are","commit":"96f823bd877bbebcc85ca17a66adf1f39b124a6c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"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":"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/15 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":"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":"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":"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":"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":"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":"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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"35 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-6chw-6frg-f759","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-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-px4h-xg32-q955","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"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-16T17:35:28.533Z","repository_id":47938824,"created_at":"2025-08-16T17:35:28.533Z","updated_at":"2025-08-16T17:35:28.533Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272174834,"owners_count":24886296,"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","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["array","boolean","hacktoberfest","hacktoberfest2021","npm","npm-package","number","string","util","utility"],"created_at":"2025-08-26T05:09:56.687Z","updated_at":"2025-10-30T21:40:26.434Z","avatar_url":"https://github.com/akanshgulati.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp\u003e\n    \u003ch1 hidden\u003eAre\u003c/h1\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"docs/banner.jpg\" alt=\"Are NPM package for type check array\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    A type checking utility for element(s) of an Array based on \u003cstrong\u003echaining\u003c/strong\u003e flow to combine multiple operations.\n\u003c/p\u003e\n \n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://img.shields.io/travis/akanshgulati/are?color=green\u0026style=flat-square\" alt=\"Build Status\"/\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/@akanshgulati/are?style=flat-square\u0026color=red\" alt=\"NPM Version\"/\u003e\n    \u003ca href=\"https://twitter.com/akanshgulati\"\u003e\n        \u003cimg src=\"https://img.shields.io/twitter/follow/akanshgulati?label=Twitter%20%40akanshgulati\u0026style=flat-square\u0026color=blue\" alt=\"Twitter followers\"/\u003e\n    \u003c/a\u003e\n\n\u003c/p\u003e\n\n\u003chr/\u003e\n\n\u003cbr\u003e\n\n## 🚀 Installation  \n  \nNPM  \n```shell  \n$ npm install @akanshgulati/are  \n```  \n  \nYARN  \n```shell  \n$ yarn add @akanshgulati/are  \n```\n\n\u003cbr\u003e\n\n## 🎉 Usage   \n```js  \nconst Are = require('@akanshgulati/are');  \n  \nAre([1,2,3,4]).of.number();  \n//=\u003e true  \n  \nAre([\"🎉\",\"🎁\",\"🔆\" ]).of.type('string');  \n//=\u003e true'  \n  \nAre([\"a\", \"b\", \"c\"]).of.not.type('string');  \n//=\u003e false  \n  \nAre([[[[[[[[[1]]]]]]]]]).flat.of.number();  \n//=\u003e true  \n```    \n\n\u003cbr\u003e\n\n##  📙 API  \n\n### Helpers\nHelps in selected a particular set of an array and negative of the current type-check\n```  \n.all - checks for all elements (default)  \n.any - checks for any one element\n.first - check for first element  \n.last - check for last element  \n.middle - check for middle element(s)\n.flat - check for type in flatten array\n.not - checks for opposite, e.g. (.not.any =\u003e .all)  \n```  \n\n### Types \n\n#### .type(\\\u003cvalue\u003e)\nThe value needs to be in Pascal case (e.g. NaturalNumber) or Underscore separated (e.g. natural_number)\n\n**Primitive types**\n```\nString\nNumber\nObject\nArray\nBoolean\nDate\nArrayBuffer\n```\n\n**Array types**\n```\nInt8Array\nUint8Array  \nUint8ClampedArray  \nInt16Array  \nUint16Array  \nInt32Array  \nUint32Array  \nFloat32Array  \nFloat64Array  \nBigInt64Array  \nBigUint64Array  \nArrayBuffer  \nSharedArrayBuffer  \nDataView\n```\n**Number types**\n```\nInteger  \nSafeInteger  \nDecimal  \nFloat  \nFinite  \nInfinite  \nNaturalNumber  \nWholeNumber  \nPositiveNumber  \nNegativeNumber  \nZero  \n```\n\n**Boolean types**\n```\nFalsy  \nTruthy\n```\n\n### Built-in methods\n\n#### .string()  \n#### .number()  \n#### .array()  \n#### .boolean()  \n#### .null()  \n#### .undefined()  \n#### .date()  \n#### .int8Array()  \n#### .uint8Array()  \n#### .uint8ClampedArray()  \n#### .int16Array()  \n#### .uint16Array()  \n#### .int32Array()  \n#### .uint32Array()  \n#### .float32Array()  \n#### .float64Array()  \n#### .bigInt64Array()  \n#### .bigUint64Array()  \n#### .dateView()  \n#### .arrayBuffer()  \n#### .sharedArrayBuffer()  \n#### .integer()  \n#### .safeInteger()  \n#### .finite()  \n#### .infinite()  \n#### .wholeNumber()  \n#### .positiveNumber()  \n#### .negativeNumber()  \n#### .zero()  \n#### .decimal()  \n#### .float()  \n#### .truthy()  \n#### .falsy()\n  \n  \n### Check all elements (default)  \n  \n - `Are(ARRAY).of.type(value)` // custom('string', 'number', 'object', 'boolean', 'array')  \n - `Are(ARRAY).of.number()` or `Are(ARRAY).of.number()` or `Are(ARRAY).all.of.number()`  \n - `Are(ARRAY).of.object()` or - `Are(ARRAY).of.object()` or - `Are(ARRAY).all.of.object()`  \n - `Are(ARRAY).of.string()` or - `Are(ARRAY).of.string()` or - `Are(ARRAY).all.of.string()`  \n - `Are(ARRAY).of.boolean()` or - `Are(ARRAY).of.boolean()` or - `Are(ARRAY).all.of.boolean()`  \n  \n### Check one element  \n  \n- `Are(ARRAY).any.of.type(value)` // custom('string', 'number', 'object', 'boolean', 'array')  \n- `Are(ARRAY).any.of.number()`  \n- `Are(ARRAY).any.of.object()`  \n- `Are(ARRAY).any.of.string()`  \n- `Are(ARRAY).any.of.boolean()`  \n  \n### Check at particular index  \n  \n- `Are(ARRAY).middle.of.type(value)` // checks for (n-1)/2 index in case of odd and (n-1)/2 and n/2 indexes in case even  \n- `Are(ARRAY).first.of.type(value)` // checks for 0th index for type value  \n- `Are(ARRAY).last.of.type(value)` // checks last element for type value  \n- `Are(ARRAY).middle.of.not.type(value)` // returns true if `neither` of middle index(s) is of a type value  \n- `Are(ARRAY).first.of.not.type(value)` // checks only for 0th index for `not` to be of type value  \n  \n  \n### Check in nested array  \n- `Are(ARRAY).flat.of.type(value)` // flatten array to same root and then checks for all elements for type value  \n  \n### Negation  \n- `Are(ARRAY).of.not.type(value)` // checks if all the elements are of not type value  \n\n\u003cbr\u003e\n\n## 🍺 Inspiration\nNo package available online which checks for an array of elements\n\n1. It checks not only for a single element, instead, checks for an array of data\n2. **Chaining** technique to add multiple operations in one go\n3. **Performant** while type checking an array of elements.\n4. Provides selection **helpers** for type checking a particular element of an array\n5. Supports **negation** for checking opposite to current type checking.\n\n\u003cbr\u003e\n\n## 🗜️ Examples \nYou can refer to test file for various examples on above types, [see examples](https://github.com/akanshgulati/are/blob/57fce5c60e9ff226bc1edd48868c6d179167e661/test/index-test.js).\n\n\u003cbr\u003e\n\n## 🔗 Related  \nCurrently there are multiple libraries which check for a single element but not for an array of elements.   \n- [is](https://www.npmjs.com/package/is) - Package which checks single element  \n- [expect](https://www.npmjs.com/package/expect.js) - Chaining of operations for testing assertions  \n- [@sindresorhus/is](https://github.com/sindresorhus/is) - Advanced type checking of over 100 types.\n\n\u003cbr\u003e\n\n## ✔️ To-do  \n- [ ] Check for an empty array `isEmpty()`  \n- [ ] Add support for TypeScript type gaurds  \n- [x] More type checking like `.int16Array()`, `.float32Array()`  \n- [x] Check for truthy elements if no element is undefined or null, `.isTruthy()`  \n- [x] Check for integers, float values under type number, '`integers()`, `decimals()`  \n\n\u003cbr\u003e\n\n## 👨‍💻 Maintainers  \n- [Akansh Gulati](https://akansh.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakanshgulati%2Fare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakanshgulati%2Fare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakanshgulati%2Fare/lists"}