{"bugs":{"url":"https://github.com/altostra/type-validations/issues"},"dist":{"shasum":"57a14b1d36774e1189c79d862669e4f5c1459e3d","tarball":"https://registry.npmjs.org/@altostra/type-validations/-/type-validations-2.5.2-0.tgz","fileCount":45,"integrity":"sha512-xmg54dJgGOMWgNUbV5XXLvW/Nji+H44m8fJtgZ7ZyhxNNROrkys7WuJsmfGr23g2GH5fipcJPVAyLZd1a1anhg==","signatures":[{"sig":"MEYCIQDmfm5DXYFP1jdvDz+Aim31tRZw6r3d5ZcZu8UxivpHRwIhANIpsz9/eMqFs7QVEHbjfzg1kMm6YhJg1cg70vPKGjrK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":72798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKNoUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq91Q//X5tH1749oJ/Irdp81Ym2NUWyYShTdACl0YB8XcWtVjIFh1E2\r\nODrT2s8PKpF7fXkyh85URmX5YotDeJOCMe1wdesqWwRcFfHGtuPE0MJtuXC5\r\n46hgCOQAboHchAkWWGONhLENtwe18iQh2mVabcLoO7S5XopNsrQCzqx9kg1B\r\nhxiiR7kk/MoIbYIeB1a6AVWpLEDLHeQ6l7PJdowbPjW/eLrXDRBLKLwS0ebb\r\n59QY/ASw/um45B8VRz5abmM2Y0rqpBaNJVEAl21PN8liy5UVCQL19z6Iq7kO\r\na5xRcdjDtJMLwBZjuH1sSymXTTDEB2yFHO/8EV5cqmGm2pFbfUdo5yS9NMi5\r\n8lt98KIJ/TMkoWK8mzcrWkDN37YyMlADI+d4Ekb3hP9obGyWRe6eZAiqHba/\r\nSGxewy2ONJNx12IwA18l2uSKmYHsYxyQyICgXzki/cP3Gn+E0LlqtnA9pIFI\r\necvhg1cF//G8OkvY9abuUtkix3BOSGKh+jiqLak9z58qHAoo/63A5cN4MW7Y\r\n4DF/D8OIfzHxn9NygDyTXSrW6zSFvdTRad/KYVEG7maOkXgYZSFDpm1QQCQn\r\n8meB6oOSQRveBuk4mDyGpEf9sOd0YV1agDIPzKggMxd5MNucdKumeD8sRzTA\r\nYh/BEV+5XiRrl9/ZCvmXFhqtg7HYmQYP36g=\r\n=eSEi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","name":"@altostra/type-validations","types":"lib/index.d.ts","author":{"name":"Altostra Inc."},"readme":"# Type validations\n\n[![Open in Visual Studio Code](https://open.vscode.dev/badges/open-in-vscode.svg)](https://open.vscode.dev/altostra/type-validations)\n![CI](https://github.com/altostra/type-validations/workflows/CI/badge.svg)\n[![npm version](https://badge.fury.io/js/%40altostra%2Ftype-validations.svg)](https://badge.fury.io/js/%40altostra%2Ftype-validations)\n\nType validations is a library for creating *type-validator*s: augmented \n[*type-guard*](https://www.typescriptlang.org/docs/handbook/2/narrowing.html)s \nthat perform full runtime type-validation and let TypeScript type checker know what a \ntype may be in a certain context.\n\n## Installation\n\n```sh\n$ npm install @altostra/type-validations\n```\n\n## Reference\n\nA full reference can be found [here](./docs/reference/index.md).\n\n### [`allOf`](./docs/reference/docs/reference/allOf.md)\n\nCreates *type-validator*s for an\n[*intersections-type*](https://www.typescriptlang.org/docs/handbook/2/objects.html#intersection-types)\nfrom a list of *type-validator*s.\n\n### [`anyOf`](./docs/reference/anyOf.md)\n\nCreates *type-validator*s for a\n[*union-type*](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)\nfrom a list of *type-validator*s.\n\n### [`arrayOf`](./docs/reference/arrayOf.md)\n\nGiven *type-guard* for type `T`, creates a *type-validator* for `T[]`.\n\n### [`assertBy`](./docs/reference/assertions.md)\n\nCreate *assertion-functions* from *type-validation* and an error-factory.\n\n### [`enumOf`](./docs/reference/enumOf.md)\n\nCreates a *type-validation* that checks if a value is one of the specified values\n(using strict equality).\n\n### [`is`](./docs/reference/is.md)\n\nCreates a *type-validation* that only allows values that are strictly equal to \nthe provided value.\n\n### [`isEmptyArray`](./docs/reference/isEmptyArray.md)\n\nA *type-validation* that checks if a value is an empty array.\n\n### [`isEmptyObject`](./docs/reference/isEmptyObject.md)\n\nA *type-validation* that checks if a value is an empty object.\n\n### [`isFunction`](./docs/reference/isFunction.md)\n\nCreates a *type-validation* that checks if a value is a function with a specified length.\n\n### [`maybe`](./docs/reference/maybe.md)\n\nCreates a *type-validation* that checks if a value is of validated type, `undefined`, \nand optionally `null`.\n\n### [`objectOf`](./docs/reference/objectOf.md)\n\nCreates *type-validation* that checks if a value is an object that all its properties\nare validated with the provided validations.\n\n### [`recordOf`](./docs/reference/recordOf.md)\n\nCreates *type-validator* that checks that a given value is an object and that\nall its own-enumerable properties are of a specified type.\n\n### [`singleOrArray`](./docs/reference/singleOrArray.md)\n\nCreates a *type-validation* that checks if a value is either a specific type or an\narray of that type.\n\n### [`taggedUnionOf`](./docs/reference/taggedUnionOf.md)\n\nCreates *type-validator*s for a\n[*union-type*](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)\nfrom a mapping between specified tag property values and validators, when the *union-type* \nis in fact a [*discriminated union*](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions).\n\n### [`tupleOf`](./docs/reference/tupleOf.md)\n\nCreates a *type-validation* that checks that an object is an array with a specific length,\nand has all the provided indices validated.\n\n### [Primitives](./docs/reference/primitives.md)\n\n#### *Type-validations*\n- `string`\n- `maybeString`\n- `number`\n- `maybeNumber`\n- `boolean`\n- `maybeBoolean`\n- `nullValidation`\n- `nullOrUndefined`\n- `undefinedValidation`\n- `symbol`\n- `maybeSymbol`\n- `bigint`\n- `maybeBigint`\n- `any`\n- `unknown`\n- `never`\n\n#### *Type-assertions*\n\n- `stringAssertion`\n- `maybeStringAssertion`\n- `numberAssertion`\n- `maybeNumberAssertion`\n- `booleanAssertion`\n- `maybeBooleanAssertion`\n- `nullAssertion`\n- `nullOrUndefinedAssertion`\n- `undefinedAssertion`\n- `symbolAssertion`\n- `maybeSymbolAssertion`\n- `bigintAssertion`\n- `maybeBigintAssertion`\n- `anyAssertion`\n- `unknownAssertion`\n- `assert`\n","gitHead":"e164f920258d498e0ab2938c409007aa07cb908c","license":"MIT","scripts":{"test":"mocha \"src/**/*.spec.ts\" --recursive","build":"npm run build:clean && tsc -p \"${TSCONFIG:-./tsconfig.build.json}\"","build:clean":"rimraf lib","build:debug":"TSCONFIG=. npm run build","build:watch":"npm run build:debug -- -- -w","build:minify":"node scripts/minify-lib.js","prepublishOnly":"npm ci && npm test && npm run build:production && npm ci --production","build:production":"npm run build && npm run build:minify"},"_npmUser":{"name":"altostra-npm","email":"npm@altostra.com"},"homepage":"https://github.com/altostra/type-validations#readme","keywords":["type","validation","type","guards","assertions","input","validation"],"repository":{"url":"git+ssh://git@github.com/altostra/type-validations.git","type":"git"},"_npmVersion":"7.24.2","description":"Utility functions to create type-guards and assertions.","directories":{},"maintainers":[{"name":"altostra-npm","email":"npm@altostra.com"}],"_nodeVersion":"12.22.1","dependencies":{"@reactivex/ix-es2015-cjs":"~3.0.2"},"_hasShrinkwrap":false,"readmeFilename":"readme.md","devDependencies":{"chai":"^4.2.0","mocha":"~9.2.1","sinon":"^9.0.2","rimraf":"^3.0.2","terser":"^4.6.13","ts-node":"^8.10.1","typescript":"~4.6.2","@types/chai":"^4.2.11","@types/node":"^12.12.39","@types/mocha":"^7.0.2","@types/sinon":"^9.0.0","tsconfig-paths":"^3.9.0"},"_npmOperationalInternal":{"tmp":"tmp/type-validations_2.5.2-0_1646844436131_0.44332951384750197","host":"s3://npm-registry-packages"},"_id":"@altostra/type-validations@2.5.2-0","version":"2.5.2-0"}