{"bugs":{"url":"https://github.com/altostra/type-validations/issues"},"dist":{"shasum":"c656ea6e3a0fabdb233cccc3b2c7d6b80359ec1d","tarball":"https://registry.npmjs.org/@altostra/type-validations/-/type-validations-2.6.1-0.tgz","fileCount":47,"integrity":"sha512-Ba32M7GiN3wsJ+ZnHZMjpv/3YFogSbIrMfwnhmnwAlXSzMGUH8VKV4YLqQPvPEkmkRpyVEERmcIEeXW3miHodg==","signatures":[{"sig":"MEYCIQDN5d611xCMHy3WJaTXZJoQA0yMu1JN28mGI5YbFiOr6gIhAJsMB5LnWjCZl8BuGLhPq4qDVOksOPu2zXq2SDqcAVDR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78925,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiUwEyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpiUg/+Irm94tkyyOmEdYdUbOckECaHXb6XDbjrsr6YKEw9z0fnKjwU\r\nf9EGS1s/2P/eXh48beoLl1IJ9myZNSJ4bP0BuU3h7DtLziOkkATRNMUNm/y0\r\n0p0UlWCX8p99VFjy+2yGYegbnVy+cQG027tmTpfCBHbFH0f3OjDqXM4qaHPE\r\ndWxcNPRxvbPuDQOUBI85YHqLiNYwZAYD2bizS5lSO7INCz7kHC0Ojnhmih++\r\n46CvxU6S+z29ADbMYZpyBiWIVEj9II6sLXVbhMySed5U2qu4Y4QocNBPVnFA\r\nKgPiz7zHbCuzOn/rLbZog17DUWHbu7So28N6piyA0S+5sTPcuNWOquTb5IQd\r\nPIGJo8Z1A9VbCktet1iYfHDvpr8myialcMSMJignzUdedjnUkS3VplKZcvSQ\r\nxGfi2OniceZzGTT4SVqH4V6GpYEfbdUfts+5usXFSVOsKMkAwOXXbMpCfH4Q\r\nFqu0OHKwkSNUoJsimoLSMlzRMpM8cXmGbgbTKETQuR2hRM+ZjYskSVhXdVn6\r\nFkxKRz6TH65Qg17wHmQsSoWyrEoKyRtSh7lZpE5QrfhbhO1q4bH6O6/73dlZ\r\nvEXFsuHbCDLS+FKarj4GPD9tLCFwi05p5gvgrJ45etFrsWlHMq6liXqS3+V/\r\njv/oOeqGsncz4dMDESfOnfTi2HlH5d0nckE=\r\n=TBil\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":"89c396106d754e860da3b490208002434f6762e6","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-0_1649606961967_0.7089092353961262","host":"s3://npm-registry-packages"},"_id":"@altostra/type-validations@2.6.1-0","version":"2.6.1-0"}