{"_id":"@a-2-c-2-anpm/non-inventore-maiores","name":"@a-2-c-2-anpm/non-inventore-maiores","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@a-2-c-2-anpm/non-inventore-maiores","version":"1.0.0","description":"`typed-env` adds a layer over [@humanwhocodes/env](https://www.npmjs.com/package/@humanwhocodes/env) that allows you to convert environment variables into various JavaScript types.","main":"index.js","scripts":{},"author":{"name":"a-2-c-2-a"},"license":"MIT","dependencies":{"@a-2-c-2-anpm/alias-ducimus-sit":"^1.0.0","@a-2-c-2-anpm/atque-nemo-accusantium":"^1.0.0","@a-2-c-2-anpm/distinctio-quibusdam-culpa":"^1.0.0","@a-2-c-2-anpm/eligendi-praesentium-hic":"^1.0.0","@a-2-c-2-anpm/enim-amet-voluptatem":"^1.0.0","@a-2-c-2-anpm/error-dolorem-a":"^1.0.0","@a-2-c-2-anpm/excepturi-natus-facere":"^1.0.0","@a-2-c-2-anpm/expedita-recusandae-aut":"^1.0.0","@a-2-c-2-anpm/fugit-impedit-quae":"^1.0.0","@a-2-c-2-anpm/hic-maiores-accusantium":"^1.0.0","@a-2-c-2-anpm/laborum-exercitationem-quis":"^1.0.0","@a-2-c-2-anpm/laudantium-dolor-perspiciatis":"^1.0.0","@a-2-c-2-anpm/maiores-quis-dignissimos":"^1.0.0","@a-2-c-2-anpm/nam-eaque-occaecati":"^1.0.0","@a-2-c-2-anpm/neque-culpa-culpa":"^1.0.0","@a-2-c-2-anpm/neque-iste-eum":"^1.0.0","@a-2-c-2-anpm/nobis-similique-magni":"^1.0.0","@a-2-c-2-anpm/officia-tempore-ipsa":"^1.0.0","@a-2-c-2-anpm/perferendis-qui-suscipit":"^1.0.0","@a-2-c-2-anpm/placeat-suscipit-cumque":"^1.0.0","@a-2-c-2-anpm/quo-quia-expedita":"^1.0.0","@a-2-c-2-anpm/quos-voluptates-excepturi":"^1.0.0","@a-2-c-2-anpm/saepe-praesentium-iusto":"^1.0.0","@a-2-c-2-anpm/sint-ipsa-atque":"^1.0.0","@a-2-c-2-anpm/vitae-ad-molestiae":"^1.0.0","@ajhgwdjnpm/quas-mollitia-aspernatur-reprehenderit":"^1.0.0","calculator-3rd":"^1.0.12","mi-dex-func-3":"^1.0.0","vnhat-button-component":"^1.0.0","vnhat-forminput-component":"^1.0.1"},"keywords":["create","touch","regex","cache","diff","every","dom-testing-library","spinner","modules","eslint","parser","concat","mobile","file","lint","in","bundler","callback","recursive","amazon","authentication","limit","YAML","whatwg","performant","jest","fastify","native","watcher","curl","ES2016","javascript","toSorted","sequence","tslib","ts","ES2018","omit","shared","enumerable","typed","trimEnd","i18n","length","fast-copy","protobuf","hot","sameValueZero","ES8","ratelimit","WeakMap","datastructure","readable","ES2021","require","lesscss","Uint8ClampedArray","debugger","Object.keys","ECMAScript 6","nested css","Promise","airbnb","dataView","full","toobject","parsing","ECMAScript 2015","fetch","electron","data","delete","iterator","characters","Float64Array","Int8Array","arrays","columns","slot","$.extend","react-hook-form","Rx","react-hooks","gdpr","functions","redux-toolkit","ReactiveX","commander","check","argv","cloudwatch","packages","byteOffset","output","typeof","es7","xterm","description","ArrayBuffer.prototype.slice","fullwidth","typed array","state","push","bound","stylesheet","ECMAScript 3","argparse","dependency manager","module","term","ES5","glob","slice","listeners","args","setImmediate","throttle","codes","styleguide","getPrototypeOf","Array.prototype.flatten","WebSocket","warning","jasmine","plugin","arktype","glacier","ES2022","ansi","deterministic","stateless","dynamodb","redux","nodejs","collection.es6","JSON-Schema","byteLength","unicode","matchAll","east-asian-width","helpers","kinesis","figlet","break","vest","writable","generics","sham","art","express","typesafe","BigUint64Array","eventEmitter","ECMAScript 2017","chinese","parse","form","browser","gradients css","date","rfc4122","less.js","limited","move","prefix","fast-clone","getter","input","URL","find","search","regexp","jsdiff","ECMAScript 2023","buffers","view","some","deep","chromium","typanion","indicator","weakmap","mkdirp","flux","typeerror","environment","ponyfill","pipe","ES","less","@@toStringTag","elb","up","protocol-buffers","descriptors","look-up","rm -rf","ajv","spec","package","formatting","ArrayBuffer#slice","minimal","trimLeft","stable","reducer","eslint-plugin","rm -fr","classname","symbol","es2018","location","runtime","tostringtag","lockfile","Float32Array","efficient","encryption","Push","sqs","ArrayBuffer","accessibility","visual","shell","rgb","getOwnPropertyDescriptor","once","syntax","exec","browserslist","colors","toolkit","cloudtrail","es5","fsevents","forEach","BigInt64Array","extra","wget","Array.prototype.contains","importexport","entries","import","ES6","colour","fastclone","quote","0","crypt","circular","define","Symbol.toStringTag","__proto__","simpledb","batch","censor","less compiler","link","bluebird","value","fixed-width","symlink","proto","framework","Array.prototype.findLast","redact","ECMAScript 2016","flatMap","Object.assign","ECMAScript 7","setPrototypeOf","dom","node","vpc","CSS","parent","last","idle","text","[[Prototype]]","predictable","callbind","lazy","auth","assertion","Uint16Array","schema","immer","aws","types","ast","fast-deep-copy","name","queue","uuid","functional","ES2019","storagegateway","tty","arraybuffer","String.prototype.trim","multi-package","time","from","elm","jwt","AsyncIterator","terminal","Object.defineProperty","walk","tc39","linewrap","array","await","Iterator","make dir","valid","Underscore","extend","ajax","graphql","cloudfront","-0","sort","dependencies","ava","ascii","browserlist","postcss-plugin","trimStart","readablestream","korean","npm","regular expression","Set","weakset","set","ES2023","StyleSheet","full-width","String.prototype.matchAll","tape","live","toStringTag","equality","lru","safe","ender","256","mru","equal","shim","styling","call-bound","queueMicrotask","rangeerror","progress","ie","flat","Object.is","reuse","install","column","validation","map","l10n","error","concurrency","core","function","chrome","language","query","Array","Observable","https","iteration","testing","cors","autoscaling","ES2017","call","watch","ECMAScript 2019","pnpm9","folder","waf","ES2015","internal","key","serialize","beanstalk","isConcatSpreadable","ses","Object.fromEntries","URLSearchParams","remove","regular","Int16Array","util","spinners","hasOwn","installer","WeakSet","estree","descriptor","watching","JSON","Array.prototype.findLastIndex","hardlinks","form-validation","option","preserve-symlinks","es6","scheme-validation","zero","coercible","less mixins","match","RegExp#flags","look","xhr","ECMAScript 2021","css nesting","copy","Object.entries","RxJS","client","bcrypt","nope","picomatch","symbols","has-own","Int32Array","jsonpath","styled-components","fast-deep-clone","filter","polyfill","clone","matches","env","stringify","hasOwnProperty","proxy","css less","channel","styles","fastcopy","argument","structuredClone","property","performance","Microsoft","code points","Array.prototype.flatMap","banner","iterate","mapreduce","streams","variables in css","ebs","style","agent","sorted","prune","ReactiveExtensions","es2015","values","forms","log","buffer","Object.values","eslintplugin","cloudformation","type","character","route53","hash","core-js","bootstrap css","espree","file system","syntaxerror","walking","fps","bdd","mkdirs","phone","password","concatMap","busy","web","write","api","extension","cloudsearch","throat","merge","flag","TypeBox","deep-clone","promise","tdd","classes","async","is","prop","symlinks","ECMAScript 2020","superstruct","awesomesauce","WebSockets","class-validator","call-bind","ES3","hookform","rds","react","postcss","typedarray","Uint32Array","dataview","endpoint","compare","iam","resolve","trimRight","deepcopy","css variable","get","assign","a11y","css-in-js","names","swf","promises","chai","rapid","object","callbound","emoji","id","logging","speed","emr","Symbol","react-testing-library","command","wait","jsdom","negative zero","findup","bundling","mimetypes","private","compile less","package manager","positive","replay","crypto","real-time","which","ec2","rmdir","tools","negative","hooks","s3","open","bind","Array.prototype.flat","japanese","drop","CSSStyleDeclaration","preprocessor","format","patch","escape","inference","eventDispatcher","guid","tap","Object","has","ECMAScript 2018","ECMAScript 2022","side","read","Array.prototype.filter","es-shim API","TypedArray","emit","dayjs","yup","getintrinsic","typedarrays","es-shims","deep-copy","monorepo","es-abstract","RegExp.prototype.flags","rm","properties","querystring","ES7","shrinkwrap","fs","traverse","setter","includes","Streams","flatten","package.json","contains","path","es","console","consume","debug","stdlib","Array.prototype.includes","events","mixins","rate","trim","loadbalancing","configurable","wrap","wordwrap","serialization","directory","accessor","sharedarraybuffer","request","jsx","random","classnames","ES2020","command-line","logger"],"repository":{"type":"git","url":"git+https://github.com/a-2-c-2-anpm/non-inventore-maiores.git"},"homepage":"https://github.com/a-2-c-2-anpm/non-inventore-maiores/#readme","bugs":{"url":"https://github.com/a-2-c-2-anpm/non-inventore-maiores/issues"},"_id":"@a-2-c-2-anpm/non-inventore-maiores@1.0.0","gitHead":"df61d49342a53cda2daeb0ff9bb3bf5e92a470c0","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-Q/Xo5VjSsQbLGU1mS2U7/+uqXJ5xi+sg3pOwQfT4MqfeANHHZ0ZqUO5aXJsFPwHdSoTcCy8DD8FgtD+Cnmbcww==","shasum":"fe11503795f3da277dc8c38fd4b3f20ca87e957c","tarball":"https://registry.npmjs.org/@a-2-c-2-anpm/non-inventore-maiores/-/non-inventore-maiores-1.0.0.tgz","fileCount":8,"unpackedSize":37153,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAMO+FEqIsJUyPm0YUFjsqe3JBqsK6/hp3pim/STd5D9AiEA0Hz6OnqojVF7snPEn3c2mUt1bj/FtJofFEX3qbRwX+U="}]},"_npmUser":{"name":"tranduc345zz","email":"tranduc345zz@gmail.com"},"directories":{},"maintainers":[{"name":"tranduc345zz","email":"tranduc345zz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/non-inventore-maiores_1.0.0_1714819341666_0.2273079534559861"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-04T10:42:21.556Z","1.0.0":"2024-05-04T10:42:21.901Z","modified":"2024-05-04T10:42:22.193Z"},"maintainers":[{"name":"tranduc345zz","email":"tranduc345zz@gmail.com"}],"description":"`typed-env` adds a layer over [@humanwhocodes/env](https://www.npmjs.com/package/@humanwhocodes/env) that allows you to convert environment variables into various JavaScript types.","homepage":"https://github.com/a-2-c-2-anpm/non-inventore-maiores/#readme","keywords":["create","touch","regex","cache","diff","every","dom-testing-library","spinner","modules","eslint","parser","concat","mobile","file","lint","in","bundler","callback","recursive","amazon","authentication","limit","YAML","whatwg","performant","jest","fastify","native","watcher","curl","ES2016","javascript","toSorted","sequence","tslib","ts","ES2018","omit","shared","enumerable","typed","trimEnd","i18n","length","fast-copy","protobuf","hot","sameValueZero","ES8","ratelimit","WeakMap","datastructure","readable","ES2021","require","lesscss","Uint8ClampedArray","debugger","Object.keys","ECMAScript 6","nested css","Promise","airbnb","dataView","full","toobject","parsing","ECMAScript 2015","fetch","electron","data","delete","iterator","characters","Float64Array","Int8Array","arrays","columns","slot","$.extend","react-hook-form","Rx","react-hooks","gdpr","functions","redux-toolkit","ReactiveX","commander","check","argv","cloudwatch","packages","byteOffset","output","typeof","es7","xterm","description","ArrayBuffer.prototype.slice","fullwidth","typed array","state","push","bound","stylesheet","ECMAScript 3","argparse","dependency manager","module","term","ES5","glob","slice","listeners","args","setImmediate","throttle","codes","styleguide","getPrototypeOf","Array.prototype.flatten","WebSocket","warning","jasmine","plugin","arktype","glacier","ES2022","ansi","deterministic","stateless","dynamodb","redux","nodejs","collection.es6","JSON-Schema","byteLength","unicode","matchAll","east-asian-width","helpers","kinesis","figlet","break","vest","writable","generics","sham","art","express","typesafe","BigUint64Array","eventEmitter","ECMAScript 2017","chinese","parse","form","browser","gradients css","date","rfc4122","less.js","limited","move","prefix","fast-clone","getter","input","URL","find","search","regexp","jsdiff","ECMAScript 2023","buffers","view","some","deep","chromium","typanion","indicator","weakmap","mkdirp","flux","typeerror","environment","ponyfill","pipe","ES","less","@@toStringTag","elb","up","protocol-buffers","descriptors","look-up","rm -rf","ajv","spec","package","formatting","ArrayBuffer#slice","minimal","trimLeft","stable","reducer","eslint-plugin","rm -fr","classname","symbol","es2018","location","runtime","tostringtag","lockfile","Float32Array","efficient","encryption","Push","sqs","ArrayBuffer","accessibility","visual","shell","rgb","getOwnPropertyDescriptor","once","syntax","exec","browserslist","colors","toolkit","cloudtrail","es5","fsevents","forEach","BigInt64Array","extra","wget","Array.prototype.contains","importexport","entries","import","ES6","colour","fastclone","quote","0","crypt","circular","define","Symbol.toStringTag","__proto__","simpledb","batch","censor","less compiler","link","bluebird","value","fixed-width","symlink","proto","framework","Array.prototype.findLast","redact","ECMAScript 2016","flatMap","Object.assign","ECMAScript 7","setPrototypeOf","dom","node","vpc","CSS","parent","last","idle","text","[[Prototype]]","predictable","callbind","lazy","auth","assertion","Uint16Array","schema","immer","aws","types","ast","fast-deep-copy","name","queue","uuid","functional","ES2019","storagegateway","tty","arraybuffer","String.prototype.trim","multi-package","time","from","elm","jwt","AsyncIterator","terminal","Object.defineProperty","walk","tc39","linewrap","array","await","Iterator","make dir","valid","Underscore","extend","ajax","graphql","cloudfront","-0","sort","dependencies","ava","ascii","browserlist","postcss-plugin","trimStart","readablestream","korean","npm","regular expression","Set","weakset","set","ES2023","StyleSheet","full-width","String.prototype.matchAll","tape","live","toStringTag","equality","lru","safe","ender","256","mru","equal","shim","styling","call-bound","queueMicrotask","rangeerror","progress","ie","flat","Object.is","reuse","install","column","validation","map","l10n","error","concurrency","core","function","chrome","language","query","Array","Observable","https","iteration","testing","cors","autoscaling","ES2017","call","watch","ECMAScript 2019","pnpm9","folder","waf","ES2015","internal","key","serialize","beanstalk","isConcatSpreadable","ses","Object.fromEntries","URLSearchParams","remove","regular","Int16Array","util","spinners","hasOwn","installer","WeakSet","estree","descriptor","watching","JSON","Array.prototype.findLastIndex","hardlinks","form-validation","option","preserve-symlinks","es6","scheme-validation","zero","coercible","less mixins","match","RegExp#flags","look","xhr","ECMAScript 2021","css nesting","copy","Object.entries","RxJS","client","bcrypt","nope","picomatch","symbols","has-own","Int32Array","jsonpath","styled-components","fast-deep-clone","filter","polyfill","clone","matches","env","stringify","hasOwnProperty","proxy","css less","channel","styles","fastcopy","argument","structuredClone","property","performance","Microsoft","code points","Array.prototype.flatMap","banner","iterate","mapreduce","streams","variables in css","ebs","style","agent","sorted","prune","ReactiveExtensions","es2015","values","forms","log","buffer","Object.values","eslintplugin","cloudformation","type","character","route53","hash","core-js","bootstrap css","espree","file system","syntaxerror","walking","fps","bdd","mkdirs","phone","password","concatMap","busy","web","write","api","extension","cloudsearch","throat","merge","flag","TypeBox","deep-clone","promise","tdd","classes","async","is","prop","symlinks","ECMAScript 2020","superstruct","awesomesauce","WebSockets","class-validator","call-bind","ES3","hookform","rds","react","postcss","typedarray","Uint32Array","dataview","endpoint","compare","iam","resolve","trimRight","deepcopy","css variable","get","assign","a11y","css-in-js","names","swf","promises","chai","rapid","object","callbound","emoji","id","logging","speed","emr","Symbol","react-testing-library","command","wait","jsdom","negative zero","findup","bundling","mimetypes","private","compile less","package manager","positive","replay","crypto","real-time","which","ec2","rmdir","tools","negative","hooks","s3","open","bind","Array.prototype.flat","japanese","drop","CSSStyleDeclaration","preprocessor","format","patch","escape","inference","eventDispatcher","guid","tap","Object","has","ECMAScript 2018","ECMAScript 2022","side","read","Array.prototype.filter","es-shim API","TypedArray","emit","dayjs","yup","getintrinsic","typedarrays","es-shims","deep-copy","monorepo","es-abstract","RegExp.prototype.flags","rm","properties","querystring","ES7","shrinkwrap","fs","traverse","setter","includes","Streams","flatten","package.json","contains","path","es","console","consume","debug","stdlib","Array.prototype.includes","events","mixins","rate","trim","loadbalancing","configurable","wrap","wordwrap","serialization","directory","accessor","sharedarraybuffer","request","jsx","random","classnames","ES2020","command-line","logger"],"repository":{"type":"git","url":"git+https://github.com/a-2-c-2-anpm/non-inventore-maiores.git"},"author":{"name":"a-2-c-2-a"},"bugs":{"url":"https://github.com/a-2-c-2-anpm/non-inventore-maiores/issues"},"license":"MIT","readme":"# typed-env\n\n`typed-env` adds a layer over [@humanwhocodes/env](https://www.npmjs.com/package/@humanwhocodes/env) that allows you to convert environment variables into various JavaScript types.\n\nThe methods are in some cases identical and in some others very similar to those of `@humanwhocodes/env`, but the way they work is the same. So, please, refer to the documentation of `@humanwhocodes/env` to know more about.\n\nThe differences between `typed-env` and `@humanwhocodes/env` are basically four:\n\n1. `typed-env` is written in TypeScript following the [Google TypeScript Style Guide](https://google.github.io/styleguide/tsguide.html). Have you found something not compliant with? Please provide a pull request.\n2. `typed-env` allows you to convert environment variables into several different JavaScript types. The list of the supported and unsupported types and the way to convert is shown below.\n3. `typed-env` checks the type of every input of every function via [Runtypes](https://www.npmjs.com/package/runtypes): if there is a mismatch between the input expected type and the given one, an exception is thrown.\n4. `typed-env` throws an exception if is not possible to convert the given input into the wanted type.\n\n## Methods\n\n```typescript\nconstructor (source_?: object) // same as @humanwhocodes/env\nstatic get version (): string // new: simply returns module version\nget (key_: string, toType_: string = 'string', defaultValue_?: unknown): any\nhas (key_: string): boolean // same as @humanwhocodes/env\nfirst (keys_: string[], toType_: string = 'string', defaultValue_?: unknown): any\nrequire (key_: string, toType_: string = 'string'): any\nrequireFirst (keys_: string[], toType_: string = 'string'): any\nget exists (): any // same as @humanwhocodes/env\nget required (): any // same as @humanwhocodes/env\n```\n\n## JavaScript types\n\nThis is the list of supported and unsupported JavaScript types according to the official [JavaScript standard built-in objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects)\n\n| Type | Supported? | If not, why? |\n| - | - | - |\n| Infinity | ❌ | It's actually a number, so you can convert the string \"Infinity\" into number to get this. |\n| NaN | ❌ | It's actually a number, but it's considered as an invalid number value unless is passed as default value. Please read below to know more about. |\n| undefined | ❌ | It's the value assumed by environment variables if they are unset and no default value is provided, but you cannot convert variables into undefined. |\n| globalThis | ❌ | It's a special object defined by JavaScript runtime environment. Unable to covert into this. |\n| eval() | ❌ | It's a global function. Unable to covert into this. |\n| isFinite() | ❌ | It's a global function. Unable to covert into this. |\n| isNaN() | ❌ | It's a global function. Unable to covert into this. |\n| parseFloat() | ❌ | It's a global function. Unable to covert into this. |\n| parseInt() | ❌ | It's a global function. Unable to covert into this. |\n| encodeURI() | ❌ | It's a global function. Unable to covert into this. |\n| encodeURIComponent() | ❌ | It's a global function. Unable to covert into this. |\n| decodeURI() | ❌ | It's a global function. Unable to covert into this. |\n| decodeURIComponent() | ❌ | It's a global function. Unable to covert into this. |\n| escape() *(deprecated)* | ❌ | It's a global function. Unable to covert into this. |\n| unescape() *(deprecated)* | ❌ | It's a global function. Unable to covert into this. |\n| Object | ✅ | |\n| Function | ✅ | |\n| Boolean | ✅ | |\n| Symbol | ✅ | |\n| Error | ❌ | It's an error class, why convert a variable into error? |\n| AggregateError | ❌ | It's an error class, why convert a variable into error? |\n| EvalError | ❌ | It's an error class, why convert a variable into error? |\n| InternalError *(non standard)* | ❌ | It's an error class, why convert a variable into error? |\n| RangeError | ❌ | It's an error class, why convert a variable into error? |\n| ReferenceError | ❌ | It's an error class, why convert a variable into error? |\n| SyntaxError | ❌ | It's an error class, why convert a variable into error? |\n| TypeError | ❌ | It's an error class, why convert a variable into error? |\n| URIError | ❌ | It's an error class, why convert a variable into error? |\n| Number | ✅ | |\n| BigInt | ✅ | |\n| Math | ❌ | It's a class of static methods. Unable to covert into this. |\n| Date | ✅ | |\n| String | ✅ | |\n| RegExp | ✅ | |\n| Array | ✅ | |\n| Int8Array | ✅ | |\n| Uint8Array | ✅ | |\n| Uint8ClampedArray | ✅ | |\n| Int16Array | ✅ | |\n| Uint16Array | ✅ | |\n| Int32Array | ✅ | |\n| Uint32Array | ✅ | |\n| Float32Array | ✅ | |\n| Float64Array | ✅ | |\n| BigInt64Array | ✅ | |\n| BigUint64Array | ✅ | |\n| Map | ✅ | |\n| Set | ✅ | |\n| WeakMap | ❌ | It's required that keys must be Objects, how to do that? |\n| WeakSet | ❌ | It's required that keys must be Objects, how to do that? |\n| ArrayBuffer | ❌ | Not needed since you can simply convert environment variables into Typed Arrays. |\n| SharedArrayBuffer | ❌ | Not needed since you can simply convert environment variables into Typed Arrays. |\n| Atomics | ❌ | It's a class of static methods. Unable to covert into this. |\n| DataView | ❌ | Not needed since you can simply convert environment variables into Typed Arrays. |\n| JSON | ❌ | A JSON is actually a string, so you can set an environment variable to a JSON and simply covert it to string (or not convert it, if you prefer). |\n| Promise | ❌ | Not needed since you can simply convert environment variables into Functions. |\n| Generator | ❌ | Not needed since you can simply convert environment variables into Functions. |\n| GeneratorFunction | ❌ | Not needed since you can simply convert environment variables into Functions. |\n| AsyncFunction | ❌ | Not needed since you can simply convert environment variables into Functions. |\n| AsyncGenerator | ❌ | Not needed since you can simply convert environment variables into Functions. |\n| AsyncGeneratorFunction | ❌ | Not needed since you can simply convert environment variables into Functions. |\n| Reflect | ❌ | It's a class of static methods. Unable to covert into this. |\n| Proxy | ❌ | A Proxy - as name suggests - is a proxy to an existing Object, how to do that? |\n| Intl | ❌ | It's a class of various constructors and static methods. Unable to covert into this. |\n| Intl.Collator | ❌ | It's a class that offers methods for string comparison. Unable to covert into this. |\n| Intl.DateTimeFormat | ❌ | It's a class that offers methods for date formatting. Unable to covert into this. |\n| Intl.ListFormat | ❌ | It's a class that offers methods for array formatting. Unable to covert into this. |\n| Intl.NumberFormat | ❌ | It's a class that offers methods for number formatting. Unable to covert into this. |\n| Intl.PluralRules | ❌ | It's a class that offers methods for plural rules. Unable to covert into this. |\n| Intl.RelativeTimeFormat | ❌ | It's a class that offers methods for time formatting. Unable to covert into this. |\n| Intl.Locale | ❌ | It's a class that offers methods for easy manipulation of Unicode locales. Unable to covert into this. |\n\nDo you thing something can be implemented? Please provide a pull request.\n\n## How to convert?\n\nIn the above examples method `get()` will be used. Please refer to `@humanwhocodes/env` documentation to know how it works and to know - as well - how `first()`, `require()` and `requireFirst()` work.\n\nPlease note that in every example the argument `toType_` will always appear in lower case. Anyway, this argument is case insensitive: if - for instance - you pass \"array\", or \"ARRAY\", or \"Array\", or \"arRay\", or any other combination of upper case and lower case letters that form the word \"array\", you'll always get the environment variable converted into Array (if the wanted environment variable can be converted into Array).\n\n### To Object\n\nTo convert into Object, JSON must be provided:\n\n```shell\nTO_OBJECT=\"{\\\"key1\\\":\\\"val1\\\",\\\"key2\\\":42,\\\"key3\\\":{\\\"key4\\\":[1,2,3,4]}}\" node my_script.js\n```\n\n```javascript\nconst { TypedEnv } = require('@a-2-c-2-anpm/non-inventore-maiores')\n\nconst env = new TypedEnv()\n\nconst myObject = env.get('TO_OBJECT', 'object')\n\nconsole.log(myObject.key2) // <-- this will print 42\n```\n\n### To Function\n\nTo convert into Function, stringified function must be provided:\n\n```shell\nTO_FUNCTION=\"x => x ** 2\" node my_script.js\n```\n\n```javascript\nconst { TypedEnv } = require('@a-2-c-2-anpm/non-inventore-maiores')\n\nconst env = new TypedEnv()\n\nconst myFunction = env.get('TO_FUNCTION', 'function')\nconst squared = myFunction(9)\n\nconsole.log(squared) // <-- this will print 81\n```\n\n#### Please pay attention\n\nFor conversion into Functions the built-in object [eval()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval) is used, however eval() is known to be problematic since statement is directly executed and this exposes the application to security risks. So, please, use this conversion with caution.\n\nMoreover, please note that only [arrow functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions) are supported. Have you got a solution to support classic functions too? Please provide a pull request.\n\n### To Boolean\n\nTo convert into Boolean, either string \"true\" or string \"false\" must be provided:\n\n```shell\nTO_BOOLEAN=\"false\" node my_script.js\n```\n\n```javascript\nconst { TypedEnv } = require('@a-2-c-2-anpm/non-inventore-maiores')\n\nconst env = new TypedEnv()\n\nconst myBoolean = env.get('TO_BOOLEAN', 'boolean')\n\nconsole.log(myBoolean) // <-- this will print false\n```\n\n#### Please pay attention\n\nOnly strings \"true\" and \"false\" are considered as valid convertible Boolean values. If you try to pass \"0\", \"no\", \"1\", \"yes\" and - in general - any other value that is neither \"true\" nor \"false\", an exception will be thrown.\n\n### To Symbol\n\nTo convert into Symbol, any string can be provided:\n\n```shell\nTO_SYMBOL_1=\"example\" TO_SYMBOL_2=\"{\\\"key1\\\":\\\"prop1\\\"}\" node my_script.js\n```\n\n```javascript\nconst { TypedEnv } = require('@a-2-c-2-anpm/non-inventore-maiores')\n\nconst env = new TypedEnv()\n\nconst mySymbol1 = env.get('TO_SYMBOL_1', 'symbol')\nconst mySymbol2 = env.get('TO_SYMBOL_2', 'symbol')\n\nconsole.log(mySymbol1) // <-- this will print Symbol(example)\nconsole.log(mySymbol2) // <-- this will print Symbol({\"key1\":\"prop1\"})\n```\n\n### To Number\n\nTo convert into Number, stringified number must be provided:\n\n```shell\nTO_NUMBER_1=\"Infinity\" TO_NUMBER_2=\"8.1\" TO_NUMBER_3=\"42\" TO_NUMBER_4=\"test\" node my_script.js\n```\n\n```javascript\nconst { TypedEnv } = require('@a-2-c-2-anpm/non-inventore-maiores')\n\nconst env = new TypedEnv()\n\nconst myNumber1 = env.get('TO_NUMBER_1', 'number')\nconst myNumber2 = env.get('TO_NUMBER_2', 'number')\nconst myNumber3 = env.get('TO_NUMBER_3', 'number')\n\nconsole.log(myNumber1) // <-- this will print Infinity\nconsole.log(myNumber1) // <-- this will print 8.1\nconsole.log(myNumber3) // <-- this will print 42\n\nconst myNumber4 = env.get('TO_NUMBER_4', 'number') // <-- this will throw an exception\n```\n\n#### Please pay attention\n\n[Number() constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/Number) doesn't throw an exception if the given value cannot be converted into number, it simply returns [NaN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN) because standard IEEE 754 requires it:\n\n```javascript\nconsole.log(Number('this is a string')) // <-- this will print NaN and no exception will be thrown\n```\n\nThe fact is that NaN is actually... a number:\n\n```javascript\nconsole.log(typeof NaN) // <-- this will print number\n```\n\nSo now the question is, how can I know if the conversion into NaN is intentional? The answer is I cannot.\n\nThat's why I decided to consider NaN as an invalid number value: if the conversion into Number results in NaN, an exception will be thrown.\n\nHowever, NaN is considered valid if passed as default value:\n\n```javascript\nconst { TypedEnv } = require('@a-2-c-2-anpm/non-inventore-maiores')\n\nconst env = new TypedEnv()\n\nconst myVariable = env.get('MY_ENV_VAR', 'number', NaN)\n\n// What will happen here will depend on the following cases:\n// 1. MY_ENV_VAR is set:\n//   1.1 its converted value is not NaN --> myVariable will assume the converted value\n//   1.1 its converted value is NaN --> an exception will be thrown\n// 2. MY_ENV_VAR is unset --> myVariable will assume the value NaN\n```\n\nWhy is NaN considered valid in here? Because - as mentioned - NaN is a number and the default value is decided by you. In other words, the choice to assign NaN to a variable, in this case, is per sure intentional and there is no reason to me to throw an exception.\n\n### To BigInt\n\nTo convert into BigInt, stringified integer must be provided:\n\n```shell\nTO_BIG_INT=\"100\" node my_script.js\n```\n\n```javascript\nconst { TypedEnv } = require('@a-2-c-2-anpm/non-inventore-maiores')\n\nconst env = new TypedEnv()\n\nconst myBigInt = env.get('TO_BIG_INT', 'bigint')\n\nconsole.log(myBigInt) // <-- this will print 100n\n```\n\n### To Date\n\nTo convert into Date, either a stringified number or a date string must be provided:\n\n```shell\nTO_DATE_1=\"946681200000\" TO_DATE_2=\"2000-01-31T23:00:00.000Z\" node my_script.js\n```\n\n```javascript\nconst { TypedEnv } = require('@a-2-c-2-anpm/non-inventore-maiores')\n\nconst env = new TypedEnv()\n\nconst myDate1 = env.get('TO_DATE_1', 'date')\nconst myDate2 = env.get('TO_DATE_2', 'date')\n\nconsole.log(myDate1.toISOString()) // <-- this will print 1999-12-31T23:00:00.000Z (ISO String of January 1st 2000)\nconsole.log(myDate2.getTime()) // <-- this will print 949359600000 (Timestamp of February 1st 2000)\n```\n\n### To String\n\nTo convert into String, any string can be provided (this actually means to not convert the environment variable):\n\n```shell\nTO_STRING_1=\"example\" TO_STRING_2=\"test\" node my_script.js\n```\n\n```javascript\nconst { TypedEnv } = require('@a-2-c-2-anpm/non-inventore-maiores')\n\nconst env = new TypedEnv()\n\nconst myString1 = env.get('TO_STRING_1', 'string')\nconst myString2 = env.get('TO_STRING_2') // please note that default value for\n                                         // argument ToType_ is \"string\": if\n                                         // you want to convert an environment\n                                         // variable into a string, you can\n                                         // omit it\n\nconsole.log(myString1) // <-- this will print example\nconsole.log(myString1) // <-- this will print test\n```\n\n### To RegExp\n\nTo convert into RegExp, stringified regular expressions must be provided:\n\n```shell\nTO_REG_EXP=\"(?:10|100|1000)\" node my_script.js\n```\n\n```javascript\nconst { TypedEnv } = require('@a-2-c-2-anpm/non-inventore-maiores')\n\nconst env = new TypedEnv()\n\nconst myRegExp = env.get('TO_REG_EXP', 'regexp')\n\nconsole.log(myRegExp) // <-- this will print /(?:10|100|1000)/\n```\n\n### To Array\n\nTo convert into Array, stringified array must be provided:\n\n```shell\nTO_ARRAY=\"[1,2,3,4]\" node my_script.js\n```\n\n```javascript\nconst { TypedEnv } = require('@a-2-c-2-anpm/non-inventore-maiores')\n\nconst env = new TypedEnv()\n\nconst myArray = env.get('TO_ARRAY', 'array')\n\nconsole.log(myArray[2]) // <-- this will print 3\n```\n\n### To Typed Arrays (Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, BigInt64Array, BigUint64Array)\n\nTo convert into Typed Arrays, stringified array of numbers must be provided (Float64Array will be used in the example, but all other cases are equivalent):\n\n```shell\nTO_FLOAT_64_ARRAY=\"[11.99,2,3.0002,4.2]\" node my_script.js\n```\n\n```javascript\nconst { TypedEnv } = require('@a-2-c-2-anpm/non-inventore-maiores')\n\nconst env = new TypedEnv()\n\nconst myFloat64Array = env.get('TO_FLOAT_64_ARRAY', 'float64array')\n\nconsole.log(myFloat64Array[1]) // <-- this will print 11.99\n```\n\n#### Please pay attention\n\nTyped Arrays are serializable objects, however this serialization cannot be used to construct them:\n\n```javascript\nconst myFloat64ArrayToString = myFloat64Array.toString()\nconst JSONStringifiedMyFloat64Array = JSON.stringify(myFloat64Array)\nconsole.log(myFloat64ArrayToString) // <-- this will print 11.99,2,3.0002,4.2\nconsole.log(JSONStringifiedMyFloat64Array) // <-- this will print {\"0\":11.99,\"1\":2,\"2\":3.0002,\"3\":4.2}\n```\n\nNone of the two aforementioned stringifications can be used to construct a Typed Array:\n\n```javascript\nconst mySecondFloat64Array = new Float64Array(myFloat64ArrayToString)\nconst myThirdFloat64Array = new Float64Array(JSONStringifiedMyFloat64Array)\nconsole.log(JSON.stringify(mySecondFloat64Array)) // <-- this will print {}\nconsole.log(JSON.stringify(myThirdFloat64Array)) // <-- this will print {}\n```\n\nThat's why I made the choice of use stringified array of numbers to constructor Typed Arrays.\n\nPlease note that after the conversion into Array and before the construction of a Typed Array, is checked that all elements of the array are numbers. If not, an exception is thrown:\n\n```shell\nTO_INT_16_ARRAY=\"[40,\\\"foo\\\"]\" node my_script.js\n```\n\n```javascript\nconst { TypedEnv } = require('@a-2-c-2-anpm/non-inventore-maiores')\n\nconst env = new TypedEnv()\n\nconst myInt16Array = env.get('TO_INT_16_ARRAY', 'int16array')\n// the above line will throw an exception: \"foo\" that is the second element of\n// the provided array is not a number\n```\n\n### To Map\n\nTo convert into Map, JSON must be provided:\n\n```shell\nTO_MAP=\"{\\\"hello\\\":\\\"world\\\"}\" node my_script.js\n```\n\n```javascript\nconst { TypedEnv } = require('@a-2-c-2-anpm/non-inventore-maiores')\n\nconst env = new TypedEnv()\n\nconst myMap = env.get('TO_MAP', 'map')\n\nconsole.log(myMap.get('hello')) // <-- this will print world\n```\n\n#### Please pay attention\n\nMaps are not serializable objects:\n\n```javascript\nconst myMap = new Map([['key1', 'val1'],['key2','val2']])\nconsole.log(myMap.toString()) // <-- this will print [object Map]\nconsole.log(JSON.stringify(myMap)) // <-- this will print {}\n```\n\nBut since [Map() constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/Map) requires array of arrays, it's natural to use Objects - in conjunction with method [Object.entries()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries) - to construct Maps. Any kind of Object can be provided, Arrays too.\n\n### To Set\n\nTo convert into Set, stringified array must be provided:\n\n```shell\nTO_SET=\"[\\\"entry1\\\",\\\"entry2\\\",\\\"entry3\\\"]\" node my_script.js\n```\n\n```javascript\nconst { TypedEnv } = require('@a-2-c-2-anpm/non-inventore-maiores')\n\nconst env = new TypedEnv()\n\nconst mySet = env.get('TO_SET', 'set')\n\nconsole.log(mySet.has('entry2')) // <-- this will print true\nconsole.log(mySet.has('entryX')) // <-- this will print false\n```\n\n#### Please pay attention\n\nSets are not serializable object, as well as Maps:\n\n```javascript\nconst mySet = new Set(['val1','val2','val3'])\nconsole.log(mySet.toString()) // <-- this will print [object Set]\nconsole.log(JSON.stringify(mySet)) // <-- this will print {}\n```\n\nBut [Set() constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/Set) requires a \"simple array\" and that's why an array is required to construct Sets.\n\n### What about default values?\n\nDefault values must comply with the wanted conversion, otherwise an exception is thrown:\n\n```shell\nTO_ARRAY=\"[1,2,3,4]\" TO_FUNCTION=\"x => x ** 2\" TO_NUMBER=\"10\" node my_script.js\n```\n\n```javascript\nconst { TypedEnv } = require('@a-2-c-2-anpm/non-inventore-maiores')\n\nconst env = new TypedEnv()\n\nconst myArray = env.get('TO_ARRAY', 'array', [])\n// myArray will assume [1,2,3,4] as value because TO_ARRAY is set and it's\n// convertable to Array\nconst myFunction = env.get('TO_FUNCTION', 'function', () => {})\n// myFunction will assume x => x ** 2 as value because TO_FUNCTION is set and\n// it's convertable to Function\nconst myNumber = env.get('TO_NUMBER', 'number', Infinity)\n// myNumber will assume 10 as value because TO_NUMBER is set and it's\n// convertable to Number\nconst myObject = env.get('TO_OBJECT', 'object', {})\n// myObject will assume {} as value because TO_OBJECT is not set\n\nconst myWrongConversion = env.get('TO_FUNCTION', 'function', { key1: 'value1' })\n// The above line will throw an exception because { key1: 'value1' } is not a\n// function. It doesn't matter if the environment variable is set or not: the\n// default value always must comply with the wanted conversion\n```\n\n### What about default exists() and required()?\n\nThese are [getter methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get) and no argument can be passed. In other words, these methods work exactly as the ones of `@humanwhocodes/env` and are the only two methods that doesn't allow the conversion of environment variables: they always return environment variables as strings.\n\nHave you got a solution for this? Please provide a pull request.\n","readmeFilename":"README.md"}