{"bugs":{"url":"https://github.com/altostra/type-validations/issues"},"dist":{"shasum":"6188980f54273e65a0ca7a73288321d95974f92d","tarball":"https://registry.npmjs.org/@altostra/type-validations/-/type-validations-2.6.1-1.tgz","fileCount":47,"integrity":"sha512-qxt88rDRbT3BZZIqc+DUSNDD62AISdBOgxLW24B1d1bcOHwjSlM1d4nMGRJdto/tHoMBB1PX3NsmjionNbOehw==","signatures":[{"sig":"MEUCIQDbHSvHSs44S9d2jMosc7wgD4mt7Z626SwponY6/I9bIgIgJk7X3fqKxMfJAVinHz91+RmU0U2RF3WVJauZFRfB01g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78929,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiUwUYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrezw//Spm488qJQiUydXcLp90Ob+excOvL7bD79wEL5cABOD0x7Q9O\r\n405l3VwQMwVxWNY/96K5kdhBdusDbp0tAzSnIivZVo/YEvpsltwvJ9Q9qxG5\r\njIwv4bgrQ7B4DPKupOpDVfikuy2fqOmkKGzGywUPOPcALF/87QDHk1sjWkKz\r\nWyvpK31gtslyheccffRR9yRGN2FpGL7jTDjwR65DR8j2J8EK/XcLWbCUD9Vw\r\n2KWaxGjcwXA+YRp1wKCd+YhxVFLMw5+//hzEvvitZGZHAGA7ZoR6hR58cfTR\r\naVIEe6yTip4JboQftIt0EDJmRSxmBysW5h8dVlQDUrZurir7krG+AEXjNJwT\r\n4u494rsXY3A0a6SEeG41EEnJqAYzfTG0d782s4iaBq3sTjdpmkWEGzRa3iBC\r\nBrk4cXIQbqRqVsgmG9TrmgSeDwSH0Mpv7gjOlemRM3NR1iqZe6VS8HrRagi+\r\nTw7qRbBviZuR4Aj4xVbTTBFRiQmsI77TYCRk5l0o1C+yfF4KtYVClNadtjuq\r\nhOns25BSEqKuesxaFH5w4WQRkO9iblI7E5X20d5JQALgVjs1FhbnfcIZXPpA\r\nsh0ttT37ubNBbJIg/vPlyRgt3IY684OK2sXMSxa9HKekW+hWodo4UU5uy0wX\r\n+0gmJjMYww+sUPgKsL7wM2yRPMJUHc/WRRs=\r\n=EWbm\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":"669217f475eeab3eb4ca380cc549e3949c5427d7","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.6.1-1_1649607960008_0.9043104608792598","host":"s3://npm-registry-packages"},"_id":"@altostra/type-validations@2.6.1-1","version":"2.6.1-1"}