{"_id":"@se-oss/is","name":"@se-oss/is","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@se-oss/is","version":"1.0.0","description":"Elegant and type-safe value validation library for TypeScript and JavaScript.","keywords":["is","type-check","validation","type-safe","checker","type","predicate"],"homepage":"https://github.com/shahradelahi/is","repository":{"type":"git","url":"git+https://github.com/shahradelahi/is.git"},"license":"MIT","author":{"name":"Shahrad Elahi","email":"shahrad@litehex.com","url":"https://github.com/shahradelahi"},"type":"module","exports":{".":{"import":"./dist/index.js","default":"./dist/index.cjs"}},"main":"dist/index.js","types":"dist/index.d.ts","scripts":{"bench":"vitest bench --run","build":"tsup","clean":"git clean -dfx node_modules dist .tsbuildinfo","dev":"tsup --watch","format":"prettier --write .","format:check":"prettier --check .","lint":"pnpm typecheck && eslint .","lint:fix":"eslint --fix .","prepublishOnly":"pnpm build && pnpm lint && pnpm format:check && pnpm test","test":"vitest --run","typecheck":"tsc --noEmit"},"prettier":"@shahrad/prettier-config","dependencies":{"@se-oss/typeof":"^1.1.0"},"devDependencies":{"@shahrad/eslint-config":"^1.0.1","@shahrad/prettier-config":"^1.2.2","@shahrad/tsconfig":"^1.2.0","@types/jsdom":"^27.0.0","@types/node":"^25.0.3","eslint":"^9.39.2","globals":"^17.0.0","jsdom":"^27.4.0","prettier":"^3.7.4","rxjs":"^7.8.2","tsup":"^8.5.1","typescript":"^5.9.3","vitest":"^4.0.16"},"packageManager":"pnpm@10.27.0+sha512.72d699da16b1179c14ba9e64dc71c9a40988cbdc65c264cb0e489db7de917f20dcf4d64d8723625f2969ba52d4b7e2a1170682d9ac2a5dcaeaab732b7e16f04a","_id":"@se-oss/is@1.0.0","gitHead":"3ffcff6b41a3a004768cd1f16df68ae0ccb368c3","bugs":{"url":"https://github.com/shahradelahi/is/issues"},"_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-rwDp4H6XPsnwe54T+7D9JLkeIL3anEhYMmOcvze+GKW7k5NACF2Bimu/jBMxkEKEAOQqUpGz+sdOEwnOFicX9w==","shasum":"5c637b66afe2261600a760212dc3cfd1bc1f0a86","tarball":"https://registry.npmjs.org/@se-oss/is/-/is-1.0.0.tgz","fileCount":6,"unpackedSize":73007,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@se-oss%2fis@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAn/hG4hDcYPAmDn/jAH9veP8MHsSTJV3tOv6ba56jY0AiBjUkTXLnsTs6Dw6IqEMCnODBA8LLQj41kCj5mBXi+T+w=="}]},"_npmUser":{"name":"shahradelahi","email":"shahrad@litehex.com"},"directories":{},"maintainers":[{"name":"shahradelahi","email":"shahrad@litehex.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/is_1.0.0_1767854672240_0.8171297049245032"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-08T06:44:32.132Z","1.0.0":"2026-01-08T06:44:32.379Z","modified":"2026-01-08T06:44:32.804Z"},"maintainers":[{"name":"shahradelahi","email":"shahrad@litehex.com"}],"description":"Elegant and type-safe value validation library for TypeScript and JavaScript.","homepage":"https://github.com/shahradelahi/is","keywords":["is","type-check","validation","type-safe","checker","type","predicate"],"repository":{"type":"git","url":"git+https://github.com/shahradelahi/is.git"},"author":{"name":"Shahrad Elahi","email":"shahrad@litehex.com","url":"https://github.com/shahradelahi"},"bugs":{"url":"https://github.com/shahradelahi/is/issues"},"license":"MIT","readme":"# @se-oss/is\n\n[![CI](https://github.com/shahradelahi/is/actions/workflows/ci.yml/badge.svg?branch=main&event=push)](https://github.com/shahradelahi/is/actions/workflows/ci.yml)\n[![NPM Version](https://img.shields.io/npm/v/@se-oss/is.svg)](https://www.npmjs.com/package/@se-oss/is)\n[![MIT License](https://img.shields.io/badge/License-MIT-blue.svg?style=flat)](/LICENSE)\n![npm bundle size](https://img.shields.io/bundlephobia/minzip/@se-oss/is)\n[![Install Size](https://packagephobia.com/badge?p=@se-oss/is)](https://packagephobia.com/result?p=@se-oss/is)\n\n_@se-oss/is_ is an elegant and type-safe value validation library for TypeScript and JavaScript.\n\n---\n\n- [Installation](#-installation)\n- [Usage](#-usage)\n- [Documentation](#-documentation)\n- [Contributing](#-contributing)\n- [License](#license)\n\n## 📦 Installation\n\n```bash\nnpm install @se-oss/is\n```\n\n<details>\n<summary>Install using your favorite package manager</summary>\n\n**pnpm**\n\n```bash\npnpm install @se-oss/is\n```\n\n**yarn**\n\n```bash\nyarn add @se-oss/is\n```\n\n</details>\n\n## 📖 Usage\n\n### Basic validation\n\n```typescript\nimport is from '@se-oss/is';\n\nis.string('☕');\n//=> true\n\nis.number(42);\n//=> true\n\nis.array([1, 2, 3]);\n//=> true\n\nis.urlInstance(new URL('https://example.com'));\n//=> true\n```\n\n### Type detection\n\n```typescript\nimport is from '@se-oss/is';\n\nis('hello');\n//=> 'string'\n\nis(new Map());\n//=> 'Map'\n\nis(new Uint8Array());\n//=> 'Uint8Array'\n```\n\n### Type narrowing\n\n```typescript\nimport is from '@se-oss/is';\n\nconst value: unknown = '☕';\n\nif (is.string(value)) {\n  console.log(value.length);\n  //=> 2\n}\n```\n\n### Logical operators\n\n```typescript\nimport is from '@se-oss/is';\n\n// Check if any of the predicates match\nis.any([is.string, is.number], 'hello');\n//=> true\n\n// Check if all of the predicates match\nis.all([is.array, is.nonEmptyArray], [1, 2, 3]);\n//=> true\n\n// Check if a value is optional\nis.optional(undefined, is.string);\n//=> true\n\n// Use as predicate factories\nconst isStringOrNumber = is.any([is.string, is.number]);\nisStringOrNumber('hello');\n//=> true\n```\n\n### Advanced usage\n\n```typescript\nimport is from '@se-oss/is';\n\n// Validate array elements\nis.array([1, 2, 3], is.number);\n//=> true\n\n// Check if a number is in range\nis.inRange(3, [0, 5]);\n//=> true\n\n// Check for plain objects\nis.plainObject({ a: 1 });\n//=> true\n```\n\n### Web & String validation\n\n```typescript\nimport is from '@se-oss/is';\n\nis.json('{\"a\":1}');\n//=> true\n\nis.base64('SGVsbG8gd29ybGQ=');\n//=> true\n\nis.ipv4('127.0.0.1');\n//=> true\n\nis.hexColor('#ffffff');\n//=> true\n```\n\n## 📚 Documentation\n\nFor all configuration options, please see [the API docs](https://www.jsdocs.io/package/@se-oss/is).\n\n## 🤝 Contributing\n\nWant to contribute? Awesome! To show your support is to star the project, or to raise issues on [GitHub](https://github.com/shahradelahi/is)\n\nThanks again for your support, it is much appreciated! 🙏\n\n## License\n\n[MIT](/LICENSE) © [Shahrad Elahi](https://github.com/shahradelahi) and [contributors](https://github.com/shahradelahi/is/graphs/contributors).\n","readmeFilename":"README.md","_rev":"1-001a7ae9f2644bd57a1bf04546c06e49"}