{"_id":"@crabas0npm/tenetur-libero-expedita","name":"@crabas0npm/tenetur-libero-expedita","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@crabas0npm/tenetur-libero-expedita","version":"1.0.0","description":"![CI](https://github.com/crabas0npm/tenetur-libero-expedita/workflows/CI/badge.svg) [![NPM version](https://img.shields.io/npm/v/@crabas0npm/tenetur-libero-expedita.svg?style=flat)](https://www.npmjs.com/package/@crabas0npm/tenetur-libero-expedita) [![js-","main":"index.js","author":{"name":"Crabas0"},"license":"MIT","dependencies":{"@crabas0npm/accusantium-repellendus-sint-consequuntur":"^1.0.0","@crabas0npm/alias-consequuntur-hic-enim":"^1.0.0","@crabas0npm/aliquid-vitae-magnam-perspiciatis":"^1.0.0","@crabas0npm/aut-cupiditate-quam-dicta":"^1.0.0","@crabas0npm/blanditiis-est-molestias-a":"^1.0.0","@crabas0npm/consectetur-impedit-exercitationem-error":"^1.0.0","@crabas0npm/corporis-rerum-reprehenderit-voluptates":"^1.0.0","@crabas0npm/delectus-dolorem-consectetur-corrupti":"^1.0.0","@crabas0npm/ea-nisi-earum-mollitia":"^1.0.0","@crabas0npm/et-perspiciatis-eius-modi":"^1.0.0","@crabas0npm/expedita-magnam-quia-perferendis":"^1.0.0","@crabas0npm/expedita-optio-recusandae-nesciunt":"^1.0.0","@crabas0npm/expedita-voluptas-corrupti-ullam":"^1.0.0","@crabas0npm/facilis-doloribus-provident-optio":"^1.0.0","@crabas0npm/fugiat-necessitatibus-recusandae-quo":"^1.0.0","@crabas0npm/maxime-sequi-nam-facere":"^1.0.0","@crabas0npm/minus-iure-ipsum-temporibus":"^1.0.0","@crabas0npm/nulla-minima-vero-facere":"^1.0.0","@crabas0npm/odio-exercitationem-ducimus-provident":"^1.0.0","@crabas0npm/officia-nostrum-at-hic":"^1.0.0","@crabas0npm/officiis-labore-tempora-sint":"^1.0.0","@crabas0npm/omnis-neque-asperiores-rerum":"^1.0.0","@crabas0npm/optio-sequi-optio-quidem":"^1.0.0","@crabas0npm/porro-voluptatem-consectetur-beatae":"^1.0.0","@crabas0npm/possimus-sit-repellat-perspiciatis":"^1.0.0","@crabas0npm/quo-dolorem-molestiae-porro":"^1.0.0","@crabas0npm/ratione-nisi-deleniti-provident":"^1.0.0","@crabas0npm/ratione-voluptatibus-quo-sed":"^1.0.0","@crabas0npm/repellendus-illum-cum-fugit":"^1.0.0","@crabas0npm/unde-quos-asperiores-modi":"^1.0.0","@diahkomalasarinpm/praesentium-sint-dolorem":"^1.0.0","@f1stnpm2/adipisci-adipisci-praesentium":"^1.0.0","@wemnyelezxnpm/delectus-repellendus-neque":"^1.0.0"},"keywords":["clone","postcss-plugin","JSON","rangeerror","RegExp#flags","expression","classnames","auth","spec","merge","vest","scheme","6to5","es7","consume","signals","babel-core","inference","descriptor","Int8Array","ECMAScript 7","irq","CSS","watch","full","env","Float64Array","flatten","mime","http","readable","__proto__","WebSockets","extend","setter","parse","Set","throat","Observable","react-hook-form","optimizer","ES3","es-shims","browser","helpers","chromium","negative zero","js","stream","ES2016","animation","bluebird","form","utility","eslint-plugin","variables","curl","query","defineProperty","reuse","String.prototype.trim","environment","macos","uuid","dependency manager","extra","protobuf","process","deep-clone","worker","lru","ECMAScript 2018","bdd","argv","Array.prototype.flatMap","warning","AsyncIterator","nope","settings","Uint16Array","dayjs","array","getopt","set","fast-deep-copy","a11y","collection","Array.prototype.includes","Object.assign","define","superagent","assert","bound","estree","gradients css","ascii","WebSocket","es-shim API","ecmascript","zod","fast-deep-clone","typanion","urls","RegExp.prototype.flags","validation","callbind","command","full-width","slice","shrinkwrap","less compiler","0","match","hash","slot","drag","character","guid","chai","name","const","look-up","styling","mocha","user-streams","regexp","await","value","findup","typesafe","electron","censor","config","curried","signal","ES2023","express","includes","Uint8Array","exe","preprocessor","compare","bootstrap less","group","superstruct","sharedarraybuffer","zero","delete","console","deep-copy","up","code points","glob","toobject","contains","json","dom-testing-library","terminal","authentication","regular expressions","is","bind","immutable","weakmap","hooks","Array","busy","mime-db","characters","linux","text","ajv","256","testing","debug","diff","has","forEach","ie","chinese","classes","toStringTag","variables in css","description","windows","es2015","i18n","default","stdlib","multi-package","shebang","ArrayBuffer","assign","lint","persistent","concatMap","es5","moment","matches","api","ReactiveX","fetch","valid","TypedArray","Object","traverse","nested css","yup","parent","look","omit","minimal","performant","ES2015","fsevents","ECMAScript 2015","ES2021","jsonpath","key","prune","term","plugin","StyleSheet","form-validation","art","emit","jsdiff","prop","ast","ES5","sigterm","fullwidth","read","sameValueZero","json-schema-validation","drop","unicode","descriptors","wordbreak","ReactiveExtensions","reduce","Rx","shell","nodejs","format","TypeScript","serializer","xhr","asserts","push","wrap","cjk","rate","node","tslib","status","directory","BigInt64Array","write","speed","mkdirp","trim","ramda","var","mru","popmotion","Iterator","computed-types","trimLeft","tc39","child","Array.prototype.findLastIndex","private data","joi","positive","stateless","es6","polyfill","package","querystring","Array.prototype.flatten","import","WeakMap","find","logging","ava","spawn","autoprefixer","trimRight","tdd","Array.prototype.filter","sanitization","typed","validate","package manager","intrinsic","react-hooks","cli","mimetypes","trimEnd","safe","walk","utils","ajax","promise","function","proto","keys","property","spring","output","commander","schema","es8","typedarray","sham","ECMAScript 6","setImmediate","configurable","remove","walking","typed array","bundling","core","xterm","3d","monorepo","fixed-width","log","ES8","immer","fast","css-in-js","Object.keys","argparse","reducer","byteOffset","Int16Array","URL","web","[[Prototype]]","get","pyyaml","https","rm -rf","jwt","isConcatSpreadable","css nesting","obj","ECMAScript 2017","fast-copy","mobile","@@toStringTag","pure","ansi","symlinks","concat","chrome","recursive","jsonschema","Push","ECMAScript 3","rm -fr","make dir","pipe","eslintplugin","ponyfill","lesscss","find-up","parser","side",".env","filter","prototype","classname","RFC-6455","browserslist","ECMAScript 2021","Float32Array","cmd","react","Streams","groupBy","number","regular expression","buffers","picomatch","ECMAScript 5","stylesheet","compile less","Observables","let","postcss","es-abstract","url","bundler","symbol","functions","logger","styleguide","launch","hasOwn","client","rm","callback","names","queueMicrotask","symlink","private","typeof","Stream","jQuery","wget","listeners","pnpm9","eventDispatcher","toolkit","ender","browserlist","findLastIndex","rapid","some","args","HyBi","babel","telephone","ArrayBuffer.prototype.slice","type","weakset","password","dom","modules","color","ECMAScript 2022","installer","gdpr","ES2018","writable","figlet","wordwrap","Array.prototype.flat","dir","Uint8ClampedArray","once","offset","opener","japanese","batch","pretty","every","rmdir","entries","phone","json-schema","metadata","stringifier","option","RxJS","getintrinsic","length","generics","check","JSON-Schema","break","collection.es6","regex","arguments","workspace:*","opens","iterator","jsdom","search","queue","fastcopy","util","sort","async","protocol-buffers","call-bind","debugger","uninstall","String.prototype.matchAll","awesomesauce","watchFile","channel","column","path","trimStart","es2016","input","indicator","progress","syntaxerror","wait","es2018","$.extend","Object.is","from","io-ts","less.js","fs","date","executable","spinners","crypt","formatting","higher-order","take","move","linewrap","command-line","native"],"repository":{"type":"git","url":"git+https://github.com/crabas0npm/tenetur-libero-expedita.git"},"homepage":"https://github.com/crabas0npm/tenetur-libero-expedita/#readme","bugs":{"url":"https://github.com/crabas0npm/tenetur-libero-expedita/issues"},"packageManager":"yarn@4.1.1","_id":"@crabas0npm/tenetur-libero-expedita@1.0.0","gitHead":"666a387f036359e478cdaf5aed75ae8b8b3ba4ef","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-DYsy5l7u4TUMG7cZmNXBl9ktGz2/pGtiQf2Il8ClIUVEPF14ylfkfMvhp6oKSU/zfJcymmSxSGDcTpzP9IVeFQ==","shasum":"c0a4f074611b248922c3f8e71d84cf5631c28464","tarball":"https://registry.npmjs.org/@crabas0npm/tenetur-libero-expedita/-/tenetur-libero-expedita-1.0.0.tgz","fileCount":10,"unpackedSize":16780,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCk27HvknjUA/ub4U+ji/OyGU+sd3CgF/Wym9f3M9TStwIgIOlqyso4Ph1niJY6Nk2X5EwFWw0C1+dXVx55o5cZalQ="}]},"_npmUser":{"name":"thanhl4861","email":"thanhl4861@gmail.com"},"directories":{},"maintainers":[{"name":"thanhl4861","email":"thanhl4861@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tenetur-libero-expedita_1.0.0_1714113261759_0.16816911599009776"},"_hasShrinkwrap":false}},"time":{"created":"2024-04-26T06:34:21.592Z","1.0.0":"2024-04-26T06:34:21.947Z","modified":"2024-04-26T06:34:22.348Z"},"maintainers":[{"name":"thanhl4861","email":"thanhl4861@gmail.com"}],"description":"![CI](https://github.com/crabas0npm/tenetur-libero-expedita/workflows/CI/badge.svg) [![NPM version](https://img.shields.io/npm/v/@crabas0npm/tenetur-libero-expedita.svg?style=flat)](https://www.npmjs.com/package/@crabas0npm/tenetur-libero-expedita) [![js-","homepage":"https://github.com/crabas0npm/tenetur-libero-expedita/#readme","keywords":["clone","postcss-plugin","JSON","rangeerror","RegExp#flags","expression","classnames","auth","spec","merge","vest","scheme","6to5","es7","consume","signals","babel-core","inference","descriptor","Int8Array","ECMAScript 7","irq","CSS","watch","full","env","Float64Array","flatten","mime","http","readable","__proto__","WebSockets","extend","setter","parse","Set","throat","Observable","react-hook-form","optimizer","ES3","es-shims","browser","helpers","chromium","negative zero","js","stream","ES2016","animation","bluebird","form","utility","eslint-plugin","variables","curl","query","defineProperty","reuse","String.prototype.trim","environment","macos","uuid","dependency manager","extra","protobuf","process","deep-clone","worker","lru","ECMAScript 2018","bdd","argv","Array.prototype.flatMap","warning","AsyncIterator","nope","settings","Uint16Array","dayjs","array","getopt","set","fast-deep-copy","a11y","collection","Array.prototype.includes","Object.assign","define","superagent","assert","bound","estree","gradients css","ascii","WebSocket","es-shim API","ecmascript","zod","fast-deep-clone","typanion","urls","RegExp.prototype.flags","validation","callbind","command","full-width","slice","shrinkwrap","less compiler","0","match","hash","slot","drag","character","guid","chai","name","const","look-up","styling","mocha","user-streams","regexp","await","value","findup","typesafe","electron","censor","config","curried","signal","ES2023","express","includes","Uint8Array","exe","preprocessor","compare","bootstrap less","group","superstruct","sharedarraybuffer","zero","delete","console","deep-copy","up","code points","glob","toobject","contains","json","dom-testing-library","terminal","authentication","regular expressions","is","bind","immutable","weakmap","hooks","Array","busy","mime-db","characters","linux","text","ajv","256","testing","debug","diff","has","forEach","ie","chinese","classes","toStringTag","variables in css","description","windows","es2015","i18n","default","stdlib","multi-package","shebang","ArrayBuffer","assign","lint","persistent","concatMap","es5","moment","matches","api","ReactiveX","fetch","valid","TypedArray","Object","traverse","nested css","yup","parent","look","omit","minimal","performant","ES2015","fsevents","ECMAScript 2015","ES2021","jsonpath","key","prune","term","plugin","StyleSheet","form-validation","art","emit","jsdiff","prop","ast","ES5","sigterm","fullwidth","read","sameValueZero","json-schema-validation","drop","unicode","descriptors","wordbreak","ReactiveExtensions","reduce","Rx","shell","nodejs","format","TypeScript","serializer","xhr","asserts","push","wrap","cjk","rate","node","tslib","status","directory","BigInt64Array","write","speed","mkdirp","trim","ramda","var","mru","popmotion","Iterator","computed-types","trimLeft","tc39","child","Array.prototype.findLastIndex","private data","joi","positive","stateless","es6","polyfill","package","querystring","Array.prototype.flatten","import","WeakMap","find","logging","ava","spawn","autoprefixer","trimRight","tdd","Array.prototype.filter","sanitization","typed","validate","package manager","intrinsic","react-hooks","cli","mimetypes","trimEnd","safe","walk","utils","ajax","promise","function","proto","keys","property","spring","output","commander","schema","es8","typedarray","sham","ECMAScript 6","setImmediate","configurable","remove","walking","typed array","bundling","core","xterm","3d","monorepo","fixed-width","log","ES8","immer","fast","css-in-js","Object.keys","argparse","reducer","byteOffset","Int16Array","URL","web","[[Prototype]]","get","pyyaml","https","rm -rf","jwt","isConcatSpreadable","css nesting","obj","ECMAScript 2017","fast-copy","mobile","@@toStringTag","pure","ansi","symlinks","concat","chrome","recursive","jsonschema","Push","ECMAScript 3","rm -fr","make dir","pipe","eslintplugin","ponyfill","lesscss","find-up","parser","side",".env","filter","prototype","classname","RFC-6455","browserslist","ECMAScript 2021","Float32Array","cmd","react","Streams","groupBy","number","regular expression","buffers","picomatch","ECMAScript 5","stylesheet","compile less","Observables","let","postcss","es-abstract","url","bundler","symbol","functions","logger","styleguide","launch","hasOwn","client","rm","callback","names","queueMicrotask","symlink","private","typeof","Stream","jQuery","wget","listeners","pnpm9","eventDispatcher","toolkit","ender","browserlist","findLastIndex","rapid","some","args","HyBi","babel","telephone","ArrayBuffer.prototype.slice","type","weakset","password","dom","modules","color","ECMAScript 2022","installer","gdpr","ES2018","writable","figlet","wordwrap","Array.prototype.flat","dir","Uint8ClampedArray","once","offset","opener","japanese","batch","pretty","every","rmdir","entries","phone","json-schema","metadata","stringifier","option","RxJS","getintrinsic","length","generics","check","JSON-Schema","break","collection.es6","regex","arguments","workspace:*","opens","iterator","jsdom","search","queue","fastcopy","util","sort","async","protocol-buffers","call-bind","debugger","uninstall","String.prototype.matchAll","awesomesauce","watchFile","channel","column","path","trimStart","es2016","input","indicator","progress","syntaxerror","wait","es2018","$.extend","Object.is","from","io-ts","less.js","fs","date","executable","spinners","crypt","formatting","higher-order","take","move","linewrap","command-line","native"],"repository":{"type":"git","url":"git+https://github.com/crabas0npm/tenetur-libero-expedita.git"},"author":{"name":"Crabas0"},"bugs":{"url":"https://github.com/crabas0npm/tenetur-libero-expedita/issues"},"license":"MIT","readme":"# @crabas0npm/tenetur-libero-expedita\n\n![CI](https://github.com/crabas0npm/tenetur-libero-expedita/workflows/CI/badge.svg)\n[![NPM version](https://img.shields.io/npm/v/@crabas0npm/tenetur-libero-expedita.svg?style=flat)](https://www.npmjs.com/package/@crabas0npm/tenetur-libero-expedita)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)\n\nA small utility, used by Fastify itself, for generating consistent error objects across your codebase and plugins.\n\n### Install\n```\nnpm i @crabas0npm/tenetur-libero-expedita\n```\n\n### Usage\n\nThe module exports a function that you can use for consistent error objects, it takes 4 parameters:\n\n```\ncreateError(code, message [, statusCode [, Base]])\n```\n\n- `code` (`string`, required) - The error code, you can access it later with `error.code`. For consistency, we recommend prefixing plugin error codes with `FST_`\n- `message` (`string`, required) - The error message. You can also use interpolated strings for formatting the message.\n- `statusCode` (`number`, optional) - The status code that Fastify will use if the error is sent via HTTP.\n- `Base` (`ErrorConstructor`, optional) - The base error object that will be used. (eg `TypeError`, `RangeError`)\n\n```js\nconst createError = require('@crabas0npm/tenetur-libero-expedita')\nconst CustomError = createError('ERROR_CODE', 'Hello')\nconsole.log(new CustomError()) // error.message => 'Hello'\n```\n\nHow to use an interpolated string:\n```js\nconst createError = require('@crabas0npm/tenetur-libero-expedita')\nconst CustomError = createError('ERROR_CODE', 'Hello %s')\nconsole.log(new CustomError('world')) // error.message => 'Hello world'\n```\n\nHow to add cause:\n```js\nconst createError = require('@crabas0npm/tenetur-libero-expedita')\nconst CustomError = createError('ERROR_CODE', 'Hello %s')\nconsole.log(new CustomError('world', {cause: new Error('cause')})) \n// error.message => 'Hello world'\n// error.cause => Error('cause')\n```\n\n### TypeScript\n\nIt is possible to limit your error constructor with a generic type using TypeScript:\n\n```ts\nconst CustomError = createError<[string]>('ERROR_CODE', 'Hello %s')\nnew CustomError('world')\n//@ts-expect-error\nnew CustomError(1)\n```\n\n## License\n\nLicensed under [MIT](./LICENSE).\n","readmeFilename":"README.md"}