{"id":28332054,"url":"https://github.com/causaly/aint","last_synced_at":"2025-10-11T07:02:37.065Z","repository":{"id":37206697,"uuid":"440527121","full_name":"causaly/aint","owner":"causaly","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-10T15:26:02.000Z","size":440,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-06-03T07:19:31.595Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/causaly.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-21T13:31:09.000Z","updated_at":"2025-03-10T15:26:06.000Z","dependencies_parsed_at":"2024-04-01T18:27:54.323Z","dependency_job_id":"157264fe-4ca7-435a-a245-bde5eb591160","html_url":"https://github.com/causaly/aint","commit_stats":{"total_commits":38,"total_committers":4,"mean_commits":9.5,"dds":"0.21052631578947367","last_synced_commit":"9a0ee940a5b260d6f1f0845a6e585cec7593d24b"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/causaly/aint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/causaly%2Faint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/causaly%2Faint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/causaly%2Faint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/causaly%2Faint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/causaly","download_url":"https://codeload.github.com/causaly/aint/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/causaly%2Faint/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260701566,"owners_count":23049090,"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":"2025-05-26T19:27:00.567Z","updated_at":"2025-10-11T07:02:37.047Z","avatar_url":"https://github.com/causaly.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aint\n\nA collection of common runtime predicates that TypeScript actually understands.\n\n[![Build Status](https://github.com/causaly/aint/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/causaly/aint/actions/workflows/ci.yml) [![npm version](https://badge.fury.io/js/aint.svg)](https://www.npmjs.com/package/aint)\n\n#### Features\n\n- Simple API;\n- Extensive tests;\n- Isomorphic library, works on the browser or Node.js.\n\n## Installation\n\n```bash\nnpm install aint\n```\n\n#### Requirements\n\n- Node.js v.14+\n\n## Quick start\n\n```typescript\nimport { isNotNull } from 'aint';\n\n// given an array containing null and number values\nconst array = [1, 2, null]; // ts infers Array\u003cnull | number\u003e\n\n// ...remove null values by using isNotNull\nconst arrayWithoutNull = array.filter(isNotNull); // ts infers Array\u003cnumber\u003e\n```\n\n## API\n\n- [isNotEmptyArray](./lib/isNotEmptyArray.ts)\n- [isNotEmptyString](./lib/isNotEmptyString.ts)\n- [isNotNull](./lib/isNotNull.ts)\n- [isNotUndefined](./lib/isNotUndefined.ts)\n- [isNotNullish](./lib/isNotNullish.ts)\n\n## Motivation\n\nIt's easy to perform a check using lodash or vanilla JavaScript, e.g.\n\n```javascript\nconst array = [1, 2, null].filter(Boolean);\n```\n\nThe example above will filter out the `null` value as expected (because `null` is considered to be faulty).\n\nHowever, TypeScript will NOT _infer_ the correct type [[playground link](https://www.typescriptlang.org/play?#code/MYewdgzgLgBAhgJwXAnjAvDA2gRgDQwBMBYArgDbkC6AdAGYCW5UApggBQBCII5LcYAJQBuIA)]. It will _understand_ the type of array as being `Array\u003cnull | number\u003e` instead of `Array\u003cnumber\u003e`.\n\n`aint` provides a simple API to test for predicates, while making TypeScript _understand_.\n\n## Contribute\n\nSource code contributions are most welcome, as long as the linter is satisfied.\n\n#### We are hiring\n\nCausaly is building the world's largest biomedical knowledge platform, using technologies such as TypeScript, React and Node.js. Find out more about our openings at https://apply.workable.com/causaly/.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcausaly%2Faint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcausaly%2Faint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcausaly%2Faint/lists"}