{"_id":"ts-enum-util","_rev":"43-43ea6690373443cf419333b947794982","name":"ts-enum-util","dist-tags":{"latest":"4.1.0","latest-v2":"2.1.0","beta":"5.0.0-beta.0"},"versions":{"0.0.1":{"name":"ts-enum-util","version":"0.0.1","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation","build:move-types-from-commonjs":"copyfiles --up 2 dist/commonjs/*.d.ts dist/types && rimraf dist/commonjs/*.d.ts","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation -m es6 --outDir dist/es --declaration false","build":"npm run clean:dist && run-p build:es build:commonjs && npm run build:move-types-from-commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest --runInBand","jest:coverage":"npm run clean:coverage && jest --runInBand --coverage","test":"run-s compile lint jest","test:coverage":"run-s compile lint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.1.1","@types/node":"9.4.0","copyfiles":"1.2.0","coveralls":"3.0.0","jest":"22.1.4","npm-run-all":"4.1.2","rimraf":"2.6.2","ts-jest":"22.0.2","tslint":"5.9.1","typescript":"^2.7.1"},"peerDependencies":{"typescript":">= 2.4.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"mapCoverage":true,"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"19985abaa9e7a58c9b815d2cecbf8bc5cd9f14e3","_id":"ts-enum-util@0.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-SCsqCUGRbAj4Oqs7C+XoCdC4B/AAa0g7U7Q72z6797B8sc/lsuEoGy6GAkWTM4D2efLYjwN0X1ksLd6xm7teBA==","shasum":"bf09364fdaa4c9dc46f3ab743b433d772338c621","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-0.0.1.tgz","fileCount":21,"unpackedSize":28918,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3wLUZp2HYA4D3P3sxSEsSrgbFxwAgpC99SKJO2VxYIQIhAMyBUrvK9DnkipkXyVQAum0GWZ2l3DrGkrSrNLY5/bHZ"}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_0.0.1_1518672310437_0.18261946458206202"},"_hasShrinkwrap":false},"0.0.2":{"name":"ts-enum-util","version":"0.0.2","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation","build:move-types-from-commonjs":"copyfiles --up 2 dist/commonjs/*.d.ts dist/types && rimraf dist/commonjs/*.d.ts","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation -m es6 --outDir dist/es --declaration false","build":"npm run clean:dist && run-p build:es build:commonjs && npm run build:move-types-from-commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest --runInBand","jest:coverage":"npm run clean:coverage && jest --runInBand --coverage","test":"run-s compile lint jest","test:coverage":"run-s compile lint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.1.1","@types/node":"9.4.0","copyfiles":"1.2.0","coveralls":"3.0.0","jest":"22.1.4","npm-run-all":"4.1.2","rimraf":"2.6.2","ts-jest":"22.0.2","tslint":"5.9.1","typescript":"^2.7.1"},"peerDependencies":{"typescript":">= 2.4.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"mapCoverage":true,"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"a1127ce29b0c215fc1ca94f4b96e80da7fb65295","_id":"ts-enum-util@0.0.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-we2BZIqtXa4stXcFRAiHDvz0V/jOikeOKnnMJl5m/UwTLfATq/qOpKE73txUtMDF0XDVXtqPVUUrG3XGIU8wOg==","shasum":"f74d07d1e060e061e1bdfa478d77031ac4d29f23","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-0.0.2.tgz","fileCount":21,"unpackedSize":65758,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHKqpAnkjy/uT9gOCPPERTcftp1tJf5kr7/yN3P1efqzAiB1KZnEbqUQB4f8YJQomT7zYlOzAU/9G2EU3e31/jDs/Q=="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_0.0.2_1518758429298_0.611782503030672"},"_hasShrinkwrap":false},"0.0.3":{"name":"ts-enum-util","version":"0.0.3","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation","build:move-types-from-commonjs":"copyfiles --up 2 dist/commonjs/*.d.ts dist/types && rimraf dist/commonjs/*.d.ts","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation -m es6 --outDir dist/es --declaration false","build":"npm run clean:dist && run-p build:es build:commonjs && npm run build:move-types-from-commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest --runInBand","jest:coverage":"npm run clean:coverage && jest --runInBand --coverage","test":"run-s compile lint jest","test:coverage":"run-s compile lint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.1.1","@types/node":"9.4.0","copyfiles":"1.2.0","coveralls":"3.0.0","jest":"22.1.4","npm-run-all":"4.1.2","rimraf":"2.6.2","ts-jest":"22.0.2","tslint":"5.9.1","typescript":"^2.7.1"},"peerDependencies":{"typescript":">= 2.4.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"mapCoverage":true,"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"b7e8d6cd6b36e63bb24bf384a0bf25ef53e30814","_id":"ts-enum-util@0.0.3","_npmVersion":"5.6.0","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-KRcKsQSwyjnb7Y5F++5hKW/1q/vCuiWGPY7c9KW6anEf/xY6QKu65Zvdc1yaQfkTUp9CIIqW/XfW1iV94mDMeQ==","shasum":"2ca69447adfc75e5b661126612506b60cbca3fcf","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-0.0.3.tgz","fileCount":9,"unpackedSize":60189,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICGQ+yyBSaVADoudG3riMODMqRk5h63cCHHUfavbZFtGAiEA+Fguoy1VpHK8grbVz0lNzpk5umZroLByJOY80DziV+w="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_0.0.3_1518761668372_0.6468552425276124"},"_hasShrinkwrap":false},"0.0.4":{"name":"ts-enum-util","version":"0.0.4","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation","build:move-types-from-commonjs":"copyfiles --up 2 dist/commonjs/*.d.ts dist/types && rimraf dist/commonjs/*.d.ts","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation -m es6 --outDir dist/es --declaration false","build":"npm run clean:dist && run-p build:es build:commonjs && npm run build:move-types-from-commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest --runInBand","jest:coverage":"npm run clean:coverage && jest --runInBand --coverage","test":"run-s compile lint jest","test:coverage":"run-s compile lint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.1.1","@types/node":"9.4.0","copyfiles":"1.2.0","coveralls":"3.0.0","jest":"22.1.4","npm-run-all":"4.1.2","rimraf":"2.6.2","ts-jest":"22.0.2","tslint":"5.9.1","typescript":"^2.7.1"},"peerDependencies":{"typescript":">= 2.4.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"mapCoverage":true,"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"f61440f6a734d9be0d72b1e05602f80916fa2075","_id":"ts-enum-util@0.0.4","_npmVersion":"5.6.0","_nodeVersion":"6.11.1","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-ViZialzZNvl8vJzldI+2lr06MpeTO78re4jcOMiV1dZWfeClcw51hZYtDCJCOZQhzwi/pTzeNqV4qm4cIu7upA==","shasum":"7f75ba15080170d07cad04cbd9925873fc33e929","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-0.0.4.tgz","fileCount":9,"unpackedSize":62770,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHr+lNDDX+RuZoRwaBOVFRErOOtQB7LnK0hwf8jtcuc8AiBu6b65McdGNVUE+El9fnG+1T7FRtnP2q7ECAfWUDnfiA=="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_0.0.4_1518803143417_0.37576421644954183"},"_hasShrinkwrap":false},"0.0.5":{"name":"ts-enum-util","version":"0.0.5","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation","build:move-types-from-commonjs":"copyfiles --up 2 dist/commonjs/*.d.ts dist/types && rimraf dist/commonjs/*.d.ts","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation -m es6 --outDir dist/es --declaration false","build":"npm run clean:dist && run-p build:es build:commonjs && npm run build:move-types-from-commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest --runInBand","jest:coverage":"npm run clean:coverage && jest --runInBand --coverage","test":"run-s compile lint jest","test:coverage":"run-s compile lint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.1.1","@types/node":"9.4.0","copyfiles":"1.2.0","coveralls":"3.0.0","jest":"22.1.4","npm-run-all":"4.1.2","rimraf":"2.6.2","ts-jest":"22.0.2","tslint":"5.9.1","typescript":"^2.7.1"},"peerDependencies":{"typescript":">= 2.4.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"mapCoverage":true,"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"534eba100006cb2d7b7a00916503c1a2e905071c","_id":"ts-enum-util@0.0.5","_npmVersion":"5.6.0","_nodeVersion":"6.11.1","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-J5SIIiFOr4issoRKrZYxjW69dot+wihkos9WqfmnuRLpM9PEW8qrJevJpzWNS6mlq6NgcbWA5HPQutVxjDK/5g==","shasum":"384409d21c54ec10f4c735b2369b3db861848470","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-0.0.5.tgz","fileCount":9,"unpackedSize":63938,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHldTidD2a2/hWN0UnFqVMcqCwf3uc50SJw0MMt6ETaaAiBAhj56Kga8pPK0XA0BY4rCkdCnSayn5UPEiZ2tJEHEzQ=="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_0.0.5_1518808749785_0.733270296667643"},"_hasShrinkwrap":false},"0.0.6":{"name":"ts-enum-util","version":"0.0.6","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation","build:move-types-from-commonjs":"copyfiles --up 2 dist/commonjs/*.d.ts dist/types && rimraf dist/commonjs/*.d.ts","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation -m es6 --outDir dist/es --declaration false","build":"npm run clean:dist && run-p build:es build:commonjs && npm run build:move-types-from-commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest --runInBand","jest:coverage":"npm run clean:coverage && jest --runInBand --coverage","test":"run-s compile lint jest","test:coverage":"run-s compile lint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.1.1","@types/node":"9.4.0","copyfiles":"1.2.0","coveralls":"3.0.0","jest":"22.1.4","npm-run-all":"4.1.2","rimraf":"2.6.2","ts-jest":"22.0.2","tslint":"5.9.1","typescript":"^2.7.1"},"peerDependencies":{"typescript":">= 2.4.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"mapCoverage":true,"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"a38e7aafc14d354d3526ceac5af167ca54ed5cd2","_id":"ts-enum-util@0.0.6","_npmVersion":"5.6.0","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-uvKtOLyA/fDG/9WTc0kx0SdRfPb4GCEL8L7T3w/7UpYlQFVjIXaZNM0qQu0q0zD3dDfyPQO83n9F4aEMXvt+lQ==","shasum":"8d8060723bf92627ea92c67ebb764a1c7c6141b6","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-0.0.6.tgz","fileCount":9,"unpackedSize":109571,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClSk7irtqbPLPu3uE0IMfye8xSUtqJxX8xgEmnPW7CNwIgYb488mn/0Pb6ao58Hba6Zi8fCZU5716U2WjaM2GbFbg="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_0.0.6_1518850232277_0.25304885966829715"},"_hasShrinkwrap":false},"0.0.7":{"name":"ts-enum-util","version":"0.0.7","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation","build:move-types-from-commonjs":"copyfiles --up 2 dist/commonjs/*.d.ts dist/types && rimraf dist/commonjs/*.d.ts","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation -m es6 --outDir dist/es --declaration false","build":"npm run clean:dist && run-p build:es build:commonjs && npm run build:move-types-from-commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest --runInBand","jest:coverage":"npm run clean:coverage && jest --runInBand --coverage","test":"run-s compile lint jest","test:coverage":"run-s compile lint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.1.1","@types/node":"9.4.0","copyfiles":"1.2.0","coveralls":"3.0.0","jest":"22.1.4","npm-run-all":"4.1.2","rimraf":"2.6.2","ts-jest":"22.0.2","tslint":"5.9.1","typescript":"^2.7.1"},"peerDependencies":{"typescript":">= 2.4.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"mapCoverage":true,"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"7d04ad26bd1e2bbf06ca55c58ea28fc56386ae00","_id":"ts-enum-util@0.0.7","_npmVersion":"5.6.0","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-n5Nign5weDKIjhj01P8mPfXNW2KjmK3lo62nfzcAxylwlP2MCtNlLmIIHEuPmCdOl/hcEq9k1Re5IaE6c9x2cQ==","shasum":"2517ebc02124566e04d0b2f4c2c1b81b7ce9781f","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-0.0.7.tgz","fileCount":9,"unpackedSize":111614,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5C29BSjFisxqvqhI06r0jOiGZz4rISfPxhgvCrPVRxAIgY7xqodXf0YcIayFIhx7FJH4yGuhXldS7r8umg+eTF9k="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_0.0.7_1518854447088_0.15825605213454752"},"_hasShrinkwrap":false},"0.0.8":{"name":"ts-enum-util","version":"0.0.8","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation","build:move-types-from-commonjs":"copyfiles --up 2 dist/commonjs/*.d.ts dist/types && rimraf dist/commonjs/*.d.ts","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation -m es6 --outDir dist/es --declaration false","build":"npm run clean:dist && run-p build:es build:commonjs && npm run build:move-types-from-commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest --runInBand","jest:coverage":"npm run clean:coverage && jest --runInBand --coverage","test":"run-s compile lint jest","test:coverage":"run-s compile lint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.1.3","@types/node":"9.4.6","copyfiles":"1.2.0","coveralls":"3.0.0","jest":"22.3.0","npm-run-all":"4.1.2","rimraf":"2.6.2","ts-jest":"22.0.4","tslint":"5.9.1","typescript":"2.7.2"},"peerDependencies":{"typescript":">= 2.4.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"mapCoverage":true,"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"974f40fbb43d7c19b8714f5a398661e6dbbd2cbe","_id":"ts-enum-util@0.0.8","_npmVersion":"5.6.0","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-9J2R/RcNlh/WWkXfJOE5dw3v4Z/0gLzYm3+Rc3p8nv/UyP7twuDYzHr0HoDgOYWhOZrawiOm7LktGldusEYgFw==","shasum":"42165930eeded542f7027b6e8dce3572394d8a4d","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-0.0.8.tgz","fileCount":9,"unpackedSize":116696,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCtL/aw9knvbmDmVD2Xs0TQdecFvxq9clZbnCPtgxhYwwIgQs+wz38k/Q4zqxHqDmp84QheJdkWvQ/FSJPlYy1p03U="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_0.0.8_1518886774946_0.02786386400607377"},"_hasShrinkwrap":false},"0.0.9":{"name":"ts-enum-util","version":"0.0.9","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation","build:move-types-from-commonjs":"copyfiles --up 2 dist/commonjs/*.d.ts dist/types && rimraf dist/commonjs/*.d.ts","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation -m es6 --outDir dist/es --declaration false","build":"npm run clean:dist && run-p build:es build:commonjs && npm run build:move-types-from-commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest --runInBand","jest:coverage":"npm run clean:coverage && jest --runInBand --coverage","test":"run-s compile lint jest","test:coverage":"run-s compile lint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.1.3","@types/node":"9.4.6","copyfiles":"1.2.0","coveralls":"3.0.0","jest":"22.3.0","npm-run-all":"4.1.2","rimraf":"2.6.2","ts-jest":"22.0.4","tslint":"5.9.1","typescript":"2.7.2"},"peerDependencies":{"typescript":">= 2.4.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"mapCoverage":true,"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"1eea555663282308677c728b346246041e525695","_id":"ts-enum-util@0.0.9","_npmVersion":"5.6.0","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-QM82l+H2GGFCiqm90h8PaD6UyPl0vE/YrwAOzZHYFRG0SW6eZG/Wc0E/UOfNOPez5MDFc4YibLDYpJut0Cqx4Q==","shasum":"ea50b7b2b14133a32d3cefad7b02323e113c0d5a","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-0.0.9.tgz","fileCount":9,"unpackedSize":133351,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIhW7becD4o1sMr1b84t49t4DCBNprwu+rCDg5PJor0gIhAOTiz6X+HmVKnjbeXGJ3fPW5omuQ941nXsz0jkcowwDr"}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_0.0.9_1518974765720_0.37052797628379097"},"_hasShrinkwrap":false},"0.0.10":{"name":"ts-enum-util","version":"0.0.10","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation","build:move-types-from-commonjs":"copyfiles --up 2 dist/commonjs/*.d.ts dist/types && rimraf dist/commonjs/*.d.ts","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation -m es6 --outDir dist/es --declaration false","build":"npm run clean:dist && run-p build:es build:commonjs && npm run build:move-types-from-commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest --runInBand","jest:coverage":"npm run clean:coverage && jest --runInBand --coverage","test":"run-s compile lint jest","test:coverage":"run-s compile lint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.1.3","@types/node":"9.4.6","copyfiles":"1.2.0","coveralls":"3.0.0","jest":"22.3.0","npm-run-all":"4.1.2","rimraf":"2.6.2","ts-jest":"22.0.4","tslint":"5.9.1","typescript":"2.7.2"},"peerDependencies":{"typescript":">= 2.4.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"mapCoverage":true,"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"cfd59bbc5e67e4e8492310ff2c460cfc7f19e5f5","_id":"ts-enum-util@0.0.10","_npmVersion":"5.6.0","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-WRwEW+SJji3hcLVuCqFhEI5UvLvLo3LmAzZP45hRuzsb/hGSxHmRdcSl1FPO6d2GFhiam4TZvfQEkApuAPZ8mw==","shasum":"8a60246f56ad028da7c9257880a18e6cdc9b4ba7","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-0.0.10.tgz","fileCount":9,"unpackedSize":133831,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG1bMoOiDoCY+rMrEQP2ZiLHrqWBRvdqFr0YJwwLpJRSAiBN0zlAXAU6CXBZVZYnuwkBac886n/HSMQrfP6OYFWfuQ=="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_0.0.10_1518976013833_0.18483684320125437"},"_hasShrinkwrap":false},"0.0.11":{"name":"ts-enum-util","version":"0.0.11","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation","build:move-types-from-commonjs":"copyfiles --up 2 dist/commonjs/*.d.ts dist/types && rimraf dist/commonjs/*.d.ts","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation -m es6 --outDir dist/es --declaration false","build":"npm run clean:dist && run-p build:es build:commonjs && npm run build:move-types-from-commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest --runInBand","jest:coverage":"npm run clean:coverage && jest --runInBand --coverage","test":"run-s compile lint jest","test:coverage":"run-s compile lint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.1.3","@types/node":"9.4.6","copyfiles":"1.2.0","coveralls":"3.0.0","jest":"22.3.0","npm-run-all":"4.1.2","rimraf":"2.6.2","ts-jest":"22.0.4","tslint":"5.9.1","typescript":"2.7.2"},"peerDependencies":{"typescript":">= 2.4.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"mapCoverage":true,"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"e40e6569a5fdb6150f6ddd7f8e57279dcf4647b1","_id":"ts-enum-util@0.0.11","_npmVersion":"5.6.0","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-GKDn15wpxSJmxWqXaokg00X+nGTl8qLAsrBySY854R6WKLCggFKxgx8S7s2cb4LhaAt5aAfwAXNhaQN203352A==","shasum":"bc9d9584e41a4b37ebd536b27e7616f085ccd983","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-0.0.11.tgz","fileCount":9,"unpackedSize":139012,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDcK8c7e3gyd9UdYhq5JWAKh/cHLYn4K/IKMMOTylqnEwIgEGjCScInTT0nR/2ewN4ES3EfyHsNuFH0f/lq36MsFkI="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_0.0.11_1519001576144_0.6202852260575824"},"_hasShrinkwrap":false},"0.0.12":{"name":"ts-enum-util","version":"0.0.12","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation","build:move-types-from-commonjs":"copyfiles --up 2 dist/commonjs/*.d.ts dist/types && rimraf dist/commonjs/*.d.ts","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation -m es6 --outDir dist/es --declaration false","build":"npm run clean:dist && run-p build:es build:commonjs && npm run build:move-types-from-commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest --runInBand","jest:coverage":"npm run clean:coverage && jest --runInBand --coverage","test":"run-s compile lint jest","test:coverage":"run-s compile lint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.1.3","@types/node":"9.4.6","copyfiles":"1.2.0","coveralls":"3.0.0","jest":"22.3.0","npm-run-all":"4.1.2","rimraf":"2.6.2","ts-jest":"22.0.4","tslint":"5.9.1","typescript":"2.7.2"},"peerDependencies":{"typescript":">= 2.4.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"mapCoverage":true,"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"8984eb57c538405c69556f67aa959319b6786f7e","_id":"ts-enum-util@0.0.12","_npmVersion":"5.6.0","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-fHk2JX6NHZgZS3347DF9Tv8c/SAqI8ihRFPspr6LoygBpgZTq7LtiviRN9Nf9RIHjcNKO7ZuqMKtrZHpaxNfiw==","shasum":"db1f80761ec725252107867a1ee638fea6668777","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-0.0.12.tgz","fileCount":9,"unpackedSize":139105,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvOKKQvuL07bIk1drxwV3MBxAm8kvR8tbirAsGuzOTjgIgcHBPA6h9bZv+9gPKGb2lgtI40+nGLtsm/3g8SahWM94="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_0.0.12_1519002282345_0.8694608078607664"},"_hasShrinkwrap":false},"0.0.13":{"name":"ts-enum-util","version":"0.0.13","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation","build:move-types-from-commonjs":"copyfiles --up 2 dist/commonjs/*.d.ts dist/types && rimraf dist/commonjs/*.d.ts","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation -m es6 --outDir dist/es --declaration false","build":"npm run clean:dist && run-p build:es build:commonjs && npm run build:move-types-from-commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest --runInBand","jest:coverage":"npm run clean:coverage && jest --runInBand --coverage","test":"run-s compile lint jest","test:coverage":"run-s compile lint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.1.3","@types/node":"9.4.6","copyfiles":"1.2.0","coveralls":"3.0.0","jest":"22.3.0","npm-run-all":"4.1.2","rimraf":"2.6.2","ts-jest":"22.0.4","tslint":"5.9.1","typescript":"2.7.2"},"peerDependencies":{"typescript":">= 2.4.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"mapCoverage":true,"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"1ad8f3981b7237a0f1abfd98ce68e7454311fd34","_id":"ts-enum-util@0.0.13","_npmVersion":"5.6.0","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-Jo9SK6JvAC6OKB/btgd0MWdzRoK4jKsYrEm1swNJx5HWbBk4x2WDEKxWq2Ib8Dgd+dYexet+fjfrKZfC3CQhRA==","shasum":"0c8cceb432a885b11e39b146740d944eaa70f050","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-0.0.13.tgz","fileCount":9,"unpackedSize":140275,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1bVmr+G4lx8nzRK9GcKuYNu045wyd2WSP7kVMrgGubgIgbkW/H+jmuneS08k+Vh1BZDlZ77RuxgffEbHA9uTsVpM="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_0.0.13_1519004308601_0.19192451249241538"},"_hasShrinkwrap":false},"0.1.0":{"name":"ts-enum-util","version":"0.1.0","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation","build:move-types-from-commonjs":"copyfiles --up 2 dist/commonjs/*.d.ts dist/types && rimraf dist/commonjs/*.d.ts","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation -m es6 --outDir dist/es --declaration false","build":"npm run clean:dist && run-p build:es build:commonjs && npm run build:move-types-from-commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest --runInBand","jest:coverage":"npm run clean:coverage && jest --runInBand --coverage","test":"run-s compile lint jest","test:coverage":"run-s compile lint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.1.3","@types/node":"9.4.6","copyfiles":"1.2.0","coveralls":"3.0.0","jest":"22.3.0","npm-run-all":"4.1.2","rimraf":"2.6.2","ts-jest":"22.0.4","tslint":"5.9.1","typescript":"2.7.2"},"peerDependencies":{"typescript":">= 2.4.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"mapCoverage":true,"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"5bec4df3ba607ffe1731eb2c885eab070204364e","_id":"ts-enum-util@0.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-EhT7Emvt7fiENSiLdWBVt/PukSz0XKbkT1ui0U0Fa7JCVzdWK1c2yqwrmVzKwQNw3Sa4SgUG9SNwkRaQ0F4M2w==","shasum":"de7d5596c8de92eab2853c3ba74763ad90e6fcbf","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-0.1.0.tgz","fileCount":9,"unpackedSize":148173,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBjwioQCwlLCkqaK6vc0YWQrd2hLgJplMMOFTQU1zmHdAiEAkCM8YP9kq+GaczBd9pFSE3g8LMvEVLSR5YcO1MU302c="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_0.1.0_1519018468917_0.28198203454735715"},"_hasShrinkwrap":false},"0.2.0":{"name":"ts-enum-util","version":"0.2.0","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation","build:move-types-from-commonjs":"copyfiles --up 2 dist/commonjs/*.d.ts dist/types && rimraf dist/commonjs/*.d.ts","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation -m es6 --outDir dist/es --declaration false","build":"npm run clean:dist && run-p build:es build:commonjs && npm run build:move-types-from-commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest --runInBand","jest:coverage":"npm run clean:coverage && jest --runInBand --coverage","test":"run-s compile lint jest","test:coverage":"run-s compile lint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.1.3","@types/node":"9.4.6","copyfiles":"1.2.0","coveralls":"3.0.0","jest":"22.3.0","npm-run-all":"4.1.2","rimraf":"2.6.2","ts-jest":"22.0.4","tslint":"5.9.1","typescript":"2.7.2"},"peerDependencies":{"typescript":">= 2.4.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"mapCoverage":true,"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"f2b02a2303cb342ee54f2124a301c81c0c402101","_id":"ts-enum-util@0.2.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-UK4l5smX6IXTAW9F8h69tez/AGUWNcrd+8hLJL8NMu4KWXD0FW2pwckVacz7KGx/ErlZqSzNJgO7xuWkCLbgVA==","shasum":"8d16e4296061702d3878fc4245e858e591653c01","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-0.2.0.tgz","fileCount":9,"unpackedSize":149524,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWbpUc+rTXBzz/4m1H0Dg9kEmSieGZJNVcm4oMqx8bfQIgITmyLqbmCUjY6xWf5Ks9QrFAiOn93OFTcSY9v/TdvWY="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_0.2.0_1519099675118_0.14157940862343144"},"_hasShrinkwrap":false},"0.2.1":{"name":"ts-enum-util","version":"0.2.1","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation","build:move-types-from-commonjs":"copyfiles --up 2 dist/commonjs/*.d.ts dist/types && rimraf dist/commonjs/*.d.ts","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation -m es6 --outDir dist/es --declaration false","build":"npm run clean:dist && run-p build:es build:commonjs && npm run build:move-types-from-commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest --runInBand","jest:coverage":"npm run clean:coverage && jest --runInBand --coverage","test":"run-s compile lint jest","test:coverage":"run-s compile lint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.1.3","@types/node":"9.4.6","copyfiles":"1.2.0","coveralls":"3.0.0","jest":"22.3.0","npm-run-all":"4.1.2","rimraf":"2.6.2","ts-jest":"22.0.4","tslint":"5.9.1","typescript":"2.7.2"},"peerDependencies":{"typescript":">= 2.4.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"mapCoverage":true,"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"3a6ffcf463fc6f642343eb8e2fe2d7982a9bb2ed","_id":"ts-enum-util@0.2.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-2kTZZsL0oLxbt8wqRttLoIbcIJ8vyfYKj7pVC7jpuc8tMTxPhwqgbY4sy/6ziwhGnls0e2iSMQVoiwM2cYvZLQ==","shasum":"4aecc50f93fefabb441568645796bb9ab598000e","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-0.2.1.tgz","fileCount":9,"unpackedSize":152385,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICXuzCgqmld6vK4ubPFEJoQP4sNWVGwj2gDTsdQGG8q8AiEA/8/J3hbjfxhX/APZH57pQWb91Zr/ARVeis47AshQlsU="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_0.2.1_1519197178136_0.2722092282535775"},"_hasShrinkwrap":false},"0.2.2":{"name":"ts-enum-util","version":"0.2.2","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation","build:move-types-from-commonjs":"copyfiles --up 2 dist/commonjs/*.d.ts dist/types && rimraf dist/commonjs/*.d.ts","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation -m es6 --outDir dist/es --declaration false","build":"npm run clean:dist && run-p build:es build:commonjs && npm run build:move-types-from-commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest --runInBand","jest:coverage":"npm run clean:coverage && jest --runInBand --coverage","test":"run-s compile lint jest","test:coverage":"run-s compile lint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.1.3","@types/node":"9.4.6","copyfiles":"1.2.0","coveralls":"3.0.0","jest":"22.3.0","npm-run-all":"4.1.2","rimraf":"2.6.2","ts-jest":"22.0.4","tslint":"5.9.1","typescript":"2.7.2"},"peerDependencies":{"typescript":">= 2.4.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"mapCoverage":true,"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"4d8e80efc9d220e506f630c401b010d3efa14bd6","_id":"ts-enum-util@0.2.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-NmvdpanEVJjXmEJk+KkuR7mfqVaZWRkZg61mRP4/pwm8yagW7CCU8+9tPLwTgesBxJiLDk8zrS7UZTnYT8uMLQ==","shasum":"d0c153c26e92dd8963e92595c9419c6dd5421d7a","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-0.2.2.tgz","fileCount":9,"unpackedSize":152372,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE+0dZqR6qgW6UmYWNAiu40HWsLB0Cj1CL8/BzwnYNBgAiAvCEbllWjXrpV051yu+vT9i3/PAjlkFJGVig5yvrXO6g=="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_0.2.2_1519197338276_0.5566025600364217"},"_hasShrinkwrap":false},"1.0.0":{"name":"ts-enum-util","version":"1.0.0","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation","build:move-types-from-commonjs":"copyfiles --up 2 dist/commonjs/*.d.ts dist/types && rimraf dist/commonjs/*.d.ts","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation -m es6 --outDir dist/es --declaration false","build":"npm run clean:dist && run-p build:es build:commonjs && npm run build:move-types-from-commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest --runInBand","jest:coverage":"npm run clean:coverage && jest --runInBand --coverage","test":"run-s compile lint jest","test:coverage":"run-s compile lint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.1.3","@types/node":"9.4.6","copyfiles":"1.2.0","coveralls":"3.0.0","jest":"22.3.0","npm-run-all":"4.1.2","rimraf":"2.6.2","ts-jest":"22.0.4","tslint":"5.9.1","typescript":"2.7.2"},"peerDependencies":{"typescript":">= 2.4.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"mapCoverage":true,"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"b4159abe9f70eba73980344a935a9d2e87c2d398","_id":"ts-enum-util@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"6.11.1","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-EYgGGtT66RHNRChIbWFi5M6lYgFyt6IJTv7YJ8jVsU7zmKhNJ892prUQl65AaKr/eXY32e3TCGDgEjfEdpSZcA==","shasum":"8521b7eaeaa6d872f90b1d83e7d3f006a30e28cc","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-1.0.0.tgz","fileCount":9,"unpackedSize":158399,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAqxhnmD5dwFk8/E1A2u5RrMT+QJ2DDBsKC13pOGAjyPAiBHuTS1PHzUtqv4ZSuUSJjLw1K/MgausVTXZz5G2MIk0Q=="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_1.0.0_1519255329583_0.6146871906130282"},"_hasShrinkwrap":false},"2.0.0":{"name":"ts-enum-util","version":"2.0.0","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation","build:move-types-from-commonjs":"copyfiles --up 2 dist/commonjs/*.d.ts dist/types && rimraf dist/commonjs/*.d.ts","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation -m es6 --outDir dist/es --declaration false","build":"npm run clean:dist && run-p build:es build:commonjs && npm run build:move-types-from-commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest --runInBand","jest:coverage":"npm run clean:coverage && jest --runInBand --coverage","test":"run-s compile lint jest","test:coverage":"run-s compile lint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.1.3","@types/node":"9.4.6","copyfiles":"1.2.0","coveralls":"3.0.0","jest":"22.3.0","npm-run-all":"4.1.2","rimraf":"2.6.2","ts-jest":"22.0.4","tslint":"5.9.1","typescript":"2.7.2"},"peerDependencies":{"typescript":">= 2.4.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"mapCoverage":true,"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"9ee273a5a2ad6a4be8dfbedd083f39646e2eb0e0","_id":"ts-enum-util@2.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-UFrVn2W1EwYiWItUo3VY08hl/FlX331Z4eo+EnFOrK09PNelWGEfAK1qQ1ihJIayFyeAgwezwTent1pQ8YWSTg==","shasum":"3ef103f6088f948e453073129274fb9d4693a911","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-2.0.0.tgz","fileCount":9,"unpackedSize":148660,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDYp9zADehOKaH8qpoI7NkOEgpjlKrkzI1c7DyLHSTItAiEArh4RjquHsCt7k3anFDRMrtGIprFaOHvtS9GtgLodLGA="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_2.0.0_1519447915593_0.6265822897187237"},"_hasShrinkwrap":false},"2.0.1":{"name":"ts-enum-util","version":"2.0.1","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation","build:move-types-from-commonjs":"copyfiles --up 2 dist/commonjs/*.d.ts dist/types && rimraf dist/commonjs/*.d.ts","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation -m es6 --outDir dist/es --declaration false","build":"npm run clean:dist && run-p build:es build:commonjs && npm run build:move-types-from-commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest","jest:coverage":"npm run clean:coverage && jest --coverage","dtslint:v2_3_plus":"dtslint type_tests/v2_3_plus","dtslint:v2_4_plus":"dtslint type_tests/v2_4_plus","dtslint":"run-s dtslint:v2_3_plus dtslint:v2_4_plus","test":"run-s compile lint dtslint jest","test:coverage":"run-s compile lint dtslint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.1.3","@types/node":"9.4.6","copyfiles":"1.2.0","coveralls":"3.0.0","dtslint":"0.2.0","jest":"22.3.0","npm-run-all":"4.1.2","rimraf":"2.6.2","ts-jest":"22.0.4","tslint":"5.9.1","typescript":"2.7.2"},"peerDependencies":{"typescript":">= 2.3.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"mapCoverage":true,"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"4658d831c0b2b713a2a607f5b3b61ea042d4677e","_id":"ts-enum-util@2.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-VwwvQa/If/CR+WhIa4EC9D0FmMh3CHPnqpZlotHVqMWfueZASo09v9fZSD+DdgoMAZOhQEaA3MvbYT3ffZ0umw==","shasum":"32eff90d892aeee3201f038969080a07d16b0e2c","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-2.0.1.tgz","fileCount":9,"unpackedSize":148939,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBfYu/YHqU1WSKCnR7oLPOzNdBoVUIkbxMA3kgxikHCLAiEA5U3NyNRP1MZQXP2BNTA2gvI7SPyUsDgtHzoaSjEJ7wc="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_2.0.1_1520404919141_0.7115479318029823"},"_hasShrinkwrap":false},"2.0.2":{"name":"ts-enum-util","version":"2.0.2","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","prettier:test":"prettier --list-different \"{src,tests,type_tests}/**/*.ts\"","prettier:fix":"prettier --write \"{src,tests,type_tests}/**/*.ts\"","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation","build:move-types-from-commonjs":"copyfiles --up 2 dist/commonjs/*.d.ts dist/types && rimraf dist/commonjs/*.d.ts","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation -m es6 --outDir dist/es --declaration false","build":"npm run clean:dist && run-p build:es build:commonjs && npm run build:move-types-from-commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest","jest:coverage":"npm run clean:coverage && jest --coverage","dtslint:v2_3_plus":"dtslint type_tests/v2_3_plus","dtslint:v2_4_plus":"dtslint type_tests/v2_4_plus","dtslint":"run-s dtslint:v2_3_plus dtslint:v2_4_plus","test":"run-s compile prettier:test lint dtslint jest","test:coverage":"run-s compile prettier:test lint dtslint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.1.3","@types/node":"9.4.6","copyfiles":"1.2.0","coveralls":"3.0.0","dtslint":"0.2.0","jest":"22.3.0","npm-run-all":"4.1.2","prettier":"1.11.1","rimraf":"2.6.2","ts-jest":"22.0.4","tslint":"5.9.1","tslint-config-prettier":"1.9.0","typescript":"2.7.2"},"peerDependencies":{"typescript":">= 2.3.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"mapCoverage":true,"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"c6886dba2b8b9ae9debcb122b36d447ed7ee0a87","_id":"ts-enum-util@2.0.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-IWMYRBmgVmTSMRAEKwX2K8CYjcEht1lmMAd45AichxXc5oa9NNDuB6c2fUlmuCtbzmCM7rcqHHzgcBngjhs6DQ==","shasum":"5ddd05f2272dd599fdb68a935912aed254fca01d","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-2.0.2.tgz","fileCount":9,"unpackedSize":149269,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCr4Lg8t1dS5w+I95JGO+zDycKa7cPueWlXG0YY08H3wgIhAL5tupvAB6tCINLK/2qn+N99MIYIuQTR3cyi1trz2WBD"}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_2.0.2_1520660733000_0.11724440687687787"},"_hasShrinkwrap":false},"2.0.3":{"name":"ts-enum-util","version":"2.0.3","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","prettier:test":"prettier --list-different \"{src,tests,type_tests}/**/*.ts\"","prettier:fix":"prettier --write \"{src,tests,type_tests}/**/*.ts\"","build:types":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --emitDeclarationOnly true --outDir dist/types","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false --outDir dist/commonjs","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false -m es6 --outDir dist/es","build":"npm run clean:dist && run-p build:types build:es build:commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest","jest:coverage":"npm run clean:coverage && jest --coverage","dtslint:v2_3_plus":"dtslint type_tests/v2_3_plus","dtslint:v2_4_plus":"dtslint type_tests/v2_4_plus","dtslint":"run-s dtslint:v2_3_plus dtslint:v2_4_plus","test":"run-s compile prettier:test lint dtslint jest","test:coverage":"run-s compile prettier:test lint dtslint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.2.3","@types/node":"10.3.0","coveralls":"3.0.1","dtslint":"0.3.0","jest":"23.1.0","npm-run-all":"4.1.3","prettier":"1.13.3","rimraf":"2.6.2","ts-jest":"22.4.6","tslint":"5.10.0","tslint-config-prettier":"1.13.0","typescript":"2.8.3"},"peerDependencies":{"typescript":">= 2.3.1 < 2.9"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"8035c6a0c56566342ad0d7c8f844fa265bd4f60d","_id":"ts-enum-util@2.0.3","_npmVersion":"6.0.1","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-ZapA0fZz7WpSikXGDEblONt5oVUv8Lfx3ON9HR4mOW//mZny9Mr+yE65ea1DZksVdGedJZXZETuTbfJU+zTOUg==","shasum":"0264d485f2aa3e0514beadc60fcfbe5579a45e28","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-2.0.3.tgz","fileCount":9,"unpackedSize":150026,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbEJbUCRA9TVsSAnZWagAAHmYP/i0PMgw32PR4j5vqL1b2\nbeAVPzcA6s7969kT4qVc7C/1v/IP42e6oNp8lwHvCHwX7sWVMr7DZa+5Akmr\nsLIL1uwaWp4HF7mLSvrKsXzmnhiuRQIJS+RXoUeQ6jDzOcHrbIMRQsc+02zD\nMhn7rQjgWi3Nuf4KHSZrnnHhTexpMO5Zgp4vk5ufXBHKCiR3IQpoyzgCocA+\necQGtRwyYMmTBniYMl/JnK9YZPmK9RTP3c+TWzJ07R4zfHPEBkXGzg+A4UZ9\n4eZzJ9qVN9AuOFsjRixFX/u7hun+70hBCm09rPl6mt03UWZP7ni5K9m530jo\nqLXoCybCCSSjvb2hQwgPWhvos6R8p6bPbWcU1F3wQoNBC0ptoFQLq7eGDjjo\nFI14i7TR1OtTgSZAe26j1iQNmHp26W4b8W28sNGetPChmf0BpzgHLcWXF8hA\nlGwSz0Ig+c+6hU6AC8Fj8WWLpBnU+FSchiPf1O4xAUakuEfTsKuiZSAOsS0W\nM04YBhwF3LlJejqgn9YfQceqMcOvi7E4yvPDB6zLdByvJS51kOkz3PKXSKFh\n9FFZIHPzYpLCHvvdtvOMXt83pR2+Scm7F6LmaB0u+uMMANwLPtMFR6B3npv/\n2Yd8a9TPPDr4g8Q1y87RsPwP7PCnf6nksxGi0ajhg9jJnyrnMfGrXDK05FNG\nwBr/\r\n=FrhS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCB+o4fA5quHdJCcgRTL703qBLiJha2Q47QFP9hmHNuggIgJVyAxGi/5ow2mxrH1yI8Q5rKNwcFr3uYeqkY+KZoJCs="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_2.0.3_1527813842314_0.060832313189537635"},"_hasShrinkwrap":false},"3.0.0":{"name":"ts-enum-util","version":"3.0.0","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","prettier:test":"prettier --list-different \"{src,tests,type_tests}/**/*.ts\"","prettier:fix":"prettier --write \"{src,tests,type_tests}/**/*.ts\"","build:types":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --emitDeclarationOnly true --outDir dist/types","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false --outDir dist/commonjs","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false -m es6 --outDir dist/es","build":"npm run clean:dist && run-p build:types build:es build:commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest","jest:coverage":"npm run clean:coverage && jest --coverage","dtslint:v2_8_plus":"dtslint type_tests/v2_8_plus","dtslint":"run-s clean:dist build:types dtslint:v2_8_plus","test":"run-s compile prettier:test lint dtslint jest","test:coverage":"run-s compile prettier:test lint dtslint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.2.3","@types/node":"10.3.0","coveralls":"3.0.1","dtslint":"0.3.0","jest":"23.1.0","npm-run-all":"4.1.3","prettier":"1.13.3","rimraf":"2.6.2","ts-jest":"22.4.6","tslint":"5.10.0","tslint-config-prettier":"1.13.0","typescript":"2.9.1"},"peerDependencies":{"typescript":">= 2.8.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"078c3e7b909983862ceb72b4a4886a07990701c9","_id":"ts-enum-util@3.0.0","_npmVersion":"6.0.1","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-Psu8OySfvC5sK0t1PMlCPTxIT62ixCC6gZhIf2qS3FM7KbSdAa/5nTlGmZL2Dcvvnoz0ZMi9+ZG29MgGHbXTPQ==","shasum":"2aa4dc6136b789d4dd415513e0307426f81e29fe","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-3.0.0.tgz","fileCount":9,"unpackedSize":150911,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbEKYKCRA9TVsSAnZWagAAZAcP/AvqeCaj9/9jYh/bSwZb\nI6c45EwEMWYynNakLtgoARxx2ZXNBaXdQ8pBxwudowjuzk5fghnwG03SYHOu\nv2LeOQtSPK94tLj95XcfraYG9r9ZZPlaItVZOg0CYgdRrsK0kce4zjTKRryy\n7G6gPI8uY8j72VOzCb7DptOWflG8dkd2/T41891AM2cpX9hUM/9aJtz3F+RU\nMFCtuzAag9A4hcZHtlLjALT0r4zLAH2LZEx2gpud0JmpraaAtvqZl5sHINcS\nfVtpc5rZmhyiHhhe7yeBBLm6rntSq2j93ZUCUrIXClbdHlsVkgJfTZXiPw5j\n4uKGLPWktjlZxlEOyviIVALrYKTIY9+a7p7FjJlvCuG2JeIo4f1dgO8ccQSb\n5NUs4rCGCJLgBoXNee1LXBEYd9hlKHGkKT1YUMdX4hWEpRiaAK2k71Lb2YKT\noOGb4GqwxdR2KmP5plm6IiTx/HYkMU/290R8C5FycVGQBINb42Oh5ClYk/oX\nRYRnJAKZshNKsI8Jy4VoQyBFBuIe2GF4nE5leBCnrH+PagnLyRYNEEE5YQMB\nb/6HvDvi8gjlrkHFxrR6glnW29fJVBpLxnyXQVd0iT/ObXVkgq+T3n9SPXXj\nuLOc+aCj4jDCSi8z+34HPPwRXaXGCh6X+WlBmyW5IRqlxqjcmyfiiWiHMGRS\niEeE\r\n=S3Qf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDSk4ZYQcildWbDIbcBJyiNAjd3QsGu2zyMGV6ikZAbywIgbLZ0BKiUIhe3qacGrzzVgWt7V/jqe8IF6WT9/YJXSy0="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_3.0.0_1527817737407_0.9795388741333413"},"_hasShrinkwrap":false},"3.0.1":{"name":"ts-enum-util","version":"3.0.1","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","prettier:test":"prettier --list-different \"{src,tests,type_tests}/**/*.ts\"","prettier:fix":"prettier --write \"{src,tests,type_tests}/**/*.ts\"","build:types":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --emitDeclarationOnly true --outDir dist/types","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false --sourceRoot ../src --outDir dist/commonjs","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false -m es6 --sourceRoot ../src --outDir dist/es","build":"npm run clean:dist && run-p build:types build:es build:commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest","jest:coverage":"npm run clean:coverage && jest --coverage","dtslint:v2_8_plus":"dtslint type_tests/v2_8_plus","dtslint":"run-s clean:dist build:types dtslint:v2_8_plus","test":"run-s compile prettier:test lint dtslint jest","test:coverage":"run-s compile prettier:test lint dtslint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.2.3","@types/node":"10.3.0","coveralls":"3.0.1","dtslint":"0.3.0","jest":"23.1.0","npm-run-all":"4.1.3","prettier":"1.13.3","rimraf":"2.6.2","ts-jest":"22.4.6","tslint":"5.10.0","tslint-config-prettier":"1.13.0","typescript":"2.9.1"},"peerDependencies":{"typescript":">= 2.8.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"04dea6bca5e339c7fa4d89ac154e9817d0adef5d","_id":"ts-enum-util@3.0.1","_npmVersion":"6.0.1","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-cDiQ8woI1Ioe0sYCRXyS41p5tyxTquLdpIOvbhzwHrl4l3bFZEBiVBuarj7vifjiIewy8thpfXMfxIRjxEMUTQ==","shasum":"af368c7faefe4314aef56279de7e7bbe88ca463e","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-3.0.1.tgz","fileCount":9,"unpackedSize":150945,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbEKm1CRA9TVsSAnZWagAA6ZMP/jv+7aOmi7YHnAV98cvi\n6SfpVvIEjKyvDnzkFxS5RZJesXNZ925djzGbOimrSfA9Oi9YXqV9rXRrDPci\n6QM6cO9vLjtYBd3MkwzuwnLeeEM91u42QDlz9c+pu0yor0bS1C+8LO/UsHBZ\nDn33YLjiP67SUSevJFZWmbWcmJmUK8addNiz6jRF0tpxFoh/ExUNGX85E2US\n8XtNxAHWhFSpZx2Qtv/MAUoWstjtsdBSBKHINjx8TloaLq6BranixtE63ga6\nuciTiFUp0biqcbkM8P8TFDLoAga28S8bObLx6Z2v/UZ0wI1KJvJHS7pxO+tG\n8G3S5xDoPIvkaBjSvLRlIF4iZ8zuPQVeUF/u98Pc5HvLHBCq5ffdnBW8RHp4\n3Tu2btcSUXnfJMDMnWR3xFzWvP85qYuGfD8V26IwzycxbSi4cqtVjFJvVC16\n48Y2BTJzuLY21xdoEq5bT2XKN/Um+lhJaFJb9bL/7fkzh/bin6LeBEjsXg7d\ntzStfSPZBnOsUKwxhEXXK598DUp97lAI2Hl7Tui3savZGyN3X1cdBhQokaOS\ndSZS3tPNoenzExvOKOun/T3KL39xsoGh+dvc6kYydlqzgioa44wmUZO2tBdH\nFHZV+2CJZU48oTSs1tQpFakYk1u3lnWDLWACKC3bk6wRVrYfvDHMbEYOrFmk\nGTfm\r\n=BI4b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsDt+wacBQdmoj2HlisSvgxHDTjvQdPCP5ZLWrlU2MnwIhAPZ9NGT+XKvrT0gH6AsZ2PTsGk9OGkq6KzoIz4m0LKpn"}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_3.0.1_1527818675864_0.21972886031894578"},"_hasShrinkwrap":false},"3.0.2":{"name":"ts-enum-util","version":"3.0.2","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","prettier:test":"prettier --list-different \"{src,tests,type_tests}/**/*.ts\"","prettier:fix":"prettier --write \"{src,tests,type_tests}/**/*.ts\"","build:types":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --emitDeclarationOnly true --outDir dist/types","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false --outDir dist/commonjs","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false -m es6 --outDir dist/es","build":"npm run clean:dist && run-p build:types build:es build:commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest","jest:coverage":"npm run clean:coverage && jest --coverage","dtslint:v2_8_plus":"dtslint type_tests/v2_8_plus","dtslint":"run-s clean:dist build:types dtslint:v2_8_plus","test":"run-s compile prettier:test lint dtslint jest","test:coverage":"run-s compile prettier:test lint dtslint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.2.3","@types/node":"10.3.0","coveralls":"3.0.1","dtslint":"0.3.0","jest":"23.1.0","npm-run-all":"4.1.3","prettier":"1.13.3","rimraf":"2.6.2","ts-jest":"22.4.6","tslint":"5.10.0","tslint-config-prettier":"1.13.0","typescript":"2.9.1"},"peerDependencies":{"typescript":">= 2.8.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"edcd64e9561df38b69d730769651eded3565583b","_id":"ts-enum-util@3.0.2","_npmVersion":"6.0.1","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-BUSdqh/lYqTaA/QBJQJ2r/Iu7wx3tYztmYvAEPqurwp81kdlsQYs3ELH7YlKww3ehxgSZco+iFDR/QriYP6ZbQ==","shasum":"c310b79da5caa3c33eedb26aefd3f690526c0f18","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-3.0.2.tgz","fileCount":9,"unpackedSize":150911,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbELGYCRA9TVsSAnZWagAAVikP/0KWtw1Mc25xHvR+Fsdg\nf8viCHF6fRXwYq0zdewWYsR5sEPl8huIUDeiCoCBT0euqZpRetOGOzIpb0Zw\njEClWkQIlf/YjycZso1NL2tvMncR8fpy3hoTs2zI2cUO2ojwXqliRMd6bLt5\nSPyfX3hx0jh5uWnRKFdZ2K7EwH89pqIQYF9M29mCgM55leMYzhZKz8b04yNr\nah5ueHdW8CTNsER+xqUspTbiSNcL+08I97ZuitLS5YE1vs4XlOd1YmRbwcNM\ntiihdHeiko37c9CrQimD77aKl2jOMRZ5F9r0Q/VvTaHx1i+YK/5qfwUfVpJM\nHD+2uWx5H6GjUttJs4QzSXsbeTs/rZSAi10r+lgceqCMMuLXFPq6XBAAhPli\nAvSnWDpYhr+VjgpUAPFLpAMA8zhdVbLjIwH3AHhAAwkRlWJdpVwolv40Nsq8\nMRIuLMRh7PCjOMKBhoXJiE9iNcIg+0m+P09uT5ktNayUuq+4DL1xxi2ol040\n/uXiKX1RyEBwGolcc+/Q6f4NVom+8ozum89ClfA5k7D1e7OqD0GJPFtsrr2S\nLeFrA/e7C3nR2K4dnpx5E6w3svvRHLNVaZ7+468xmYqba3s9Zm4ivexd+4nj\nPq92MVYHvmhAlTb92+upAn5inLnBmLg27Dkq9K0BG0L0P1lcmVJgXLrSgxKa\nIGpp\r\n=btQ9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDRahJDc8zbMWKtvWDONuCN32lFKMsyivVYbriliIM6bQIgJ7M2KagvxcxW3n4rYDcFjiHLF5Hw930KSRsBiw5igsQ="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_3.0.2_1527820695695_0.13082891261084928"},"_hasShrinkwrap":false},"3.0.3":{"name":"ts-enum-util","version":"3.0.3","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","prettier:test":"prettier --list-different \"{src,tests,type_tests}/**/*.ts\"","prettier:fix":"prettier --write \"{src,tests,type_tests}/**/*.ts\"","build:types":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --emitDeclarationOnly true --declarationMap true --outDir dist/types","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false --outDir dist/commonjs","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false -m es6 --outDir dist/es","build":"npm run clean:dist && run-p build:types build:es build:commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest","jest:coverage":"npm run clean:coverage && jest --coverage","dtslint:v2_8_plus":"dtslint type_tests/v2_8_plus","dtslint":"run-s clean:dist build:types dtslint:v2_8_plus","test":"run-s compile prettier:test lint dtslint jest","test:coverage":"run-s compile prettier:test lint dtslint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"22.2.3","@types/node":"10.3.0","coveralls":"3.0.1","dtslint":"0.3.0","jest":"23.1.0","npm-run-all":"4.1.3","prettier":"1.13.3","rimraf":"2.6.2","ts-jest":"22.4.6","tslint":"5.10.0","tslint-config-prettier":"1.13.0","typescript":"2.9.1"},"peerDependencies":{"typescript":">= 2.8.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"a5e5f78536389573cdce34bc29f69ba2ab23bcb9","_id":"ts-enum-util@3.0.3","_npmVersion":"6.0.1","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-Q/tyuHO1Oji6YB4TcW6UkkYVdm5CRvEn9HJX7D9w5Bs6pZa5ndUl/LDddCMCgqHpnLgsht4r2+7L+4zD1VfOyA==","shasum":"4b846731e901188d9c7020a96c0be417706083f7","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-3.0.3.tgz","fileCount":10,"unpackedSize":158345,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbErDBCRA9TVsSAnZWagAAJ8UQAIR1QbuJssYNkLVYMonF\nCDbVQO8iFDRYUwfgezjpy2gzsfW5SyrGd1edNsxvd1YX7LSO7unvx3NkBVxQ\nxZtxTpGzvn/5h/J7lNN5PQSVT7arlZXBp6U6hq+gJ2yWZiNsHO8LHcWxq0Xi\nrg3qttnbkO9SwFa27tqxIv5zU2eqUECflCYxDx1PNIlvc/Pzosj+xpv+5ScB\nUSNfV3SJWlZ69DekiNoiGVTNmBIHOr31t5T9W6Ks0Y7BKnoQ5XpmFTC67nSy\nJbjI5d5qzRoddsyL/RkXy/y6eStHwqg/doJP/fyXD74yMia4MFiW4Mphcpzf\njbioZoDTlVUiZmlAlFg688+7g+f6U+dlF6AW4ZToKNlokzgIznUgLNAOEjfa\nfAQLQo/VH5XX5i85PaCqr/2e6d2XUHkDpJztY1QqOfRXe4OFtHhz80K0Dzcm\nu+EN8j0dnUp6EYD0DVFqDMBsAf+8RuTYvewm4dOhqK7US5btg7Cizo42bNvg\nJ2rU3nHWnDBfX1/OqamkvoWptEEysGDMxomjSIumuHuJJ0ktBsDJXAA8Al+s\nysyjo8Vb0MiZNeE7aN1lTc2evPdjIzRaiuWEzorUz4n51xmyOyYZbFNMakwH\n7XL6p4KpyRBK9lWc/+Yl2ilgmUKM6m8Z9ek0k0pxCk64ImL1jR2oy0540snx\nAZe5\r\n=aZPp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFYc7ci+qfQ0YISI+kcp/tC84d6hYvQL8GORrt72qkVkAiB2w/BAVkZJD7lpqS7j1P2uMc4H2b37ZIJ31d5162s3Ng=="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_3.0.3_1527951551438_0.10060585440414971"},"_hasShrinkwrap":false},"3.0.4":{"name":"ts-enum-util","version":"3.0.4","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","prettier:test":"prettier --list-different \"{src,tests,type_tests}/**/*.ts\"","prettier:fix":"prettier --write \"{src,tests,type_tests}/**/*.ts\"","build:types":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --emitDeclarationOnly true --declarationMap true --outDir dist/types","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false --outDir dist/commonjs","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false -m es6 --outDir dist/es","build":"npm run clean:dist && run-p build:types build:es build:commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest","jest:coverage":"npm run clean:coverage && jest --coverage","dtslint:v2_8_plus":"dtslint type_tests/v2_8_plus","dtslint":"run-s clean:dist build:types dtslint:v2_8_plus","test":"run-s compile prettier:test lint dtslint jest","test:coverage":"run-s compile prettier:test lint dtslint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"23.0.0","@types/node":"10.3.0","coveralls":"3.0.1","dtslint":"0.3.0","jest":"23.1.0","npm-run-all":"4.1.3","prettier":"1.13.4","rimraf":"2.6.2","ts-jest":"22.4.6","tslint":"5.10.0","tslint-config-prettier":"1.13.0","typescript":"2.9.1"},"peerDependencies":{"typescript":">= 2.8.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"024600130c3484e0aaa06d98d77cdb7b0218ebca","_id":"ts-enum-util@3.0.4","_npmVersion":"6.0.1","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-TRqyEkAa69QRSwtN+YCHNNAtLwn1QOJRbSHaLJSt7dxB4F9qDi3CnbwZezhTbIE7cT9bQhlZ2bIWKw6OfMu7fw==","shasum":"54590f62b6ef8f3d1276ab69ed667d5a5c5b8af3","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-3.0.4.tgz","fileCount":10,"unpackedSize":156290,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbE14KCRA9TVsSAnZWagAA8oUP/2elDhyFzIrWaI3pk1Rc\nSEkXjCqcS4q9En8c3nGOZJkXLoy8OYrIENzVKdbBlyzLn+9m3vnIixNEjQ15\nhtYr4blR9CtRUQEgFwhLGRPMyKbWEg9U0eEoWTHo2bBUk0A1GTu8JQzW8JxX\notjtghvs9NChhulLg4JsjL2VoZLb7rWKdz2FewxC4t5JofJAGLatwPkCBY8E\nNVCsF4MH/34m5tuykgwfFdBdcREmoMZBb5eS/eoH5a5X08XCni9CTTotTLWC\ndihtdJcjBpX2SahlFAj9OxPVmW9BIdb/nRa88xz7HLjF3f9G/I+bnqTXzSYb\nW1al9Kka+6085YAfREkBW+J89Bg1xcIBEPc7GFHRdB6ByrdLB3TLlqqXj2NN\nUEm79mX0nIzKROccnIy7JkF0uLofHI7h3aWZsZ1/cNtdOFkPuXYWf36OdUF7\n8/yRVNQQfMnR6tvMHgSL51OrTS4yt6aZuVf81hvfKufavdbig/ChkA0RppZ3\nInW0mqOLwmDs0ZNMLw9OHfzGdLn/LFD47PywiL4+RYUzhBE12prvUlmFw6IY\nCKm0TnsQ65vvOn3D7ZhZ2nd9JE7Jrq3qqAhSBM1nlwB9JhgqZnrGMELgHso7\nEYobo0tlYbpuv2z28VVMqj4Ze4wrl+p2Aa+7o25+e7X8fyd+VMwzGrdFP1+O\nCecN\r\n=a4Ez\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC06IP6sWHF0vUniPIdpPBcq+eZOCVk6yHyWmLPrOCPTwIgCNR38aMCU+mJZ4J8GC137kmAK0FInmMmXjJkmN07Iu8="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_3.0.4_1527995913763_0.5276866389442791"},"_hasShrinkwrap":false},"2.0.4":{"name":"ts-enum-util","version":"2.0.4","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","prettier:test":"prettier --list-different \"{src,tests,type_tests}/**/*.ts\"","prettier:fix":"prettier --write \"{src,tests,type_tests}/**/*.ts\"","build:types":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --emitDeclarationOnly true --outDir dist/types","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false --outDir dist/commonjs","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false -m es6 --outDir dist/es","build":"npm run clean:dist && run-p build:types build:es build:commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest","jest:coverage":"npm run clean:coverage && jest --coverage","dtslint:v2_3_plus":"dtslint type_tests/v2_3_plus","dtslint:v2_4_plus":"dtslint type_tests/v2_4_plus","dtslint":"run-s clean:dist build:types dtslint:v2_3_plus dtslint:v2_4_plus","test":"run-s compile prettier:test lint jest","test:coverage":"run-s compile prettier:test lint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"23.0.0","@types/node":"10.3.0","coveralls":"3.0.1","dtslint":"0.3.0","jest":"23.1.0","npm-run-all":"4.1.3","prettier":"1.13.4","rimraf":"2.6.2","ts-jest":"22.4.6","tslint":"5.10.0","tslint-config-prettier":"1.13.0","typescript":"2.8.3"},"peerDependencies":{"typescript":">= 2.3.1 < 2.9"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"d367bfa079ed08da74d54e273a90e4d6e632bd18","_id":"ts-enum-util@2.0.4","_npmVersion":"6.0.1","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-/c13TQRtQ0+DPQWUSQqBTuFCrRL+YI+LWwKrBfSIXXuobNMxzoC4JkHo8guYbnVVBEsGakMMlm02nGhTWfhLlA==","shasum":"40ce1d2dbf44bab085c09d98ba0e7603727533ea","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-2.0.4.tgz","fileCount":9,"unpackedSize":147978,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbE2dnCRA9TVsSAnZWagAA1WQP+wR9wCtGi16AznJsQcz3\n/vRne94agsUFFh+nPRi/UrTk+GES9otsmx0JKXKsJjEbSWye4Ch33VyOy0Rz\notxssaL3tuWvMl2vfL1W7gMrHpR7UABFKKjnaNNzHYfcn+nsKMpFcVA3yynQ\nCtitlWIttFm4Caomw+x/XoK94/TqkgYNUXgZtESO9q4wad8EaaM5RU0SNPqc\npDuqGiHX9mm6ncnl8VEJTJ+ccUXggR/M3jZ7RRuIx5EdlSJK1oC4atpxB+mt\nSw1N1hBHYMI235wXKBB6++nEVHASFQUOtx8BPLFq41S7B7x4tu7qif/mao5f\nCs3jL6VhL7HKzunemwh5bFLco+FPsk3ToFyi0a5R8ODED5XCP0iDjSkjMmch\nJAKtWVYLN/Xyp4HyLLkRijX0iDfNBC8JIJRydeUtD5QwN1fFV6ejwWCGlqZ1\nDjQbfcLD6rlnCju1dwDXccMrRPwCRdLkXM83Ce6twiT8dSWYe7F0rG6SXK06\nXUqIDsEx7KA+2cAEtJ6ocVaVnSewuwONWGdgpKoolw6Sem37UxwjPc+RjQPD\nMdWtgUy8M5gj0qzFFRXRM87um/uFfs1gcIHPm2RN/DUVjGsjD+XKOphCyMtu\nH8NPESI0V6ddZuZaZG33qgacAqv5fXLuWqP2w8uvjtSLnP4OxMdFlUIYIvDr\nkpF4\r\n=UA7u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAiJ7SSRrK/yN/pnGeWpl0FjF6QyBap9MmSA7XhonNtHAiBcF7PE9dkG4/m0Q6lPC5n8ATfk41lLVcTiRbtVxFwdRg=="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_2.0.4_1527998309984_0.6040753591987014"},"_hasShrinkwrap":false},"2.0.5":{"name":"ts-enum-util","version":"2.0.5","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","prettier:test":"prettier --list-different \"{src,tests,type_tests}/**/*.ts\"","prettier:fix":"prettier --write \"{src,tests,type_tests}/**/*.ts\"","build:types":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --emitDeclarationOnly true --outDir dist/types","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false --outDir dist/commonjs","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false -m es6 --outDir dist/es","build":"npm run clean:dist && run-p build:types build:es build:commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest","jest:coverage":"npm run clean:coverage && jest --coverage","dtslint:v2_3_plus":"dtslint type_tests/v2_3_plus","dtslint:v2_4_plus":"dtslint type_tests/v2_4_plus","dtslint":"run-s clean:dist build:types dtslint:v2_3_plus dtslint:v2_4_plus","test":"run-s compile prettier:test lint jest","test:coverage":"run-s compile prettier:test lint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"23.0.0","@types/node":"10.3.0","coveralls":"3.0.1","dtslint":"0.3.0","jest":"23.1.0","npm-run-all":"4.1.3","prettier":"1.13.4","rimraf":"2.6.2","ts-jest":"22.4.6","tslint":"5.10.0","tslint-config-prettier":"1.13.0","typescript":"2.8.3"},"peerDependencies":{"typescript":">= 2.3.1 < 2.9"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"4277c31640068ac4fabffd820949b3b708e8fbad","readme":"[![npm version](https://img.shields.io/npm/v/ts-enum-util.svg)](https://www.npmjs.com/package/ts-enum-util)\r\n[![Join the chat at https://gitter.im/ts-enum-util/Lobby](https://badges.gitter.im/ts-enum-util/Lobby.svg)](https://gitter.im/ts-enum-util/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\r\n[![Build Status](https://travis-ci.org/UselessPickles/ts-enum-util.svg?branch=master)](https://travis-ci.org/UselessPickles/ts-enum-util)\r\n[![Coverage Status](https://coveralls.io/repos/github/UselessPickles/ts-enum-util/badge.svg?branch=master)](https://coveralls.io/github/UselessPickles/ts-enum-util?branch=master)\r\n\r\n# ts-enum-util\r\n\r\nStrictly typed utilities for working with TypeScript enums.\r\n\r\n# Contents\r\n\r\n<!-- TOC depthFrom:2 -->\r\n\r\n-   [What is it?](#what-is-it)\r\n-   [Other TypeScript Enum Projects](#other-typescript-enum-projects)\r\n-   [Installation](#installation)\r\n-   [Usage Examples](#usage-examples)\r\n    -   [Basic setup for all examples](#basic-setup-for-all-examples)\r\n    -   [Get an `EnumWrapper` instance for an enum](#get-an-enumwrapper-instance-for-an-enum)\r\n    -   [Get count of enum entries](#get-count-of-enum-entries)\r\n    -   [Get lists of enum data](#get-lists-of-enum-data)\r\n    -   [Lookup value by key](#lookup-value-by-key)\r\n    -   [Reverse lookup key by value](#reverse-lookup-key-by-value)\r\n    -   [Validate/convert enum keys](#validateconvert-enum-keys)\r\n    -   [Validate/convert enum values](#validateconvert-enum-values)\r\n    -   [Iteration and Mapping](#iteration-and-mapping)\r\n    -   [Wrapped enums are Array-Like](#wrapped-enums-are-array-like)\r\n    -   [Wrapped enums are Map-Like](#wrapped-enums-are-map-like)\r\n-   [Requirements](#requirements)\r\n-   [Limitations](#limitations)\r\n-   [Known Issues](#known-issues)\r\n    -   [`WeakMap` Polyfill](#weakmap-polyfill)\r\n-   [General Concepts](#general-concepts)\r\n    -   [Enum-Like Object](#enum-like-object)\r\n    -   [EnumWrapper](#enumwrapper)\r\n    -   [Specific Typing](#specific-typing)\r\n    -   [Map-Like Interface](#map-like-interface)\r\n    -   [Array-Like Interface](#array-like-interface)\r\n    -   [Guaranteed Order of Iteration](#guaranteed-order-of-iteration)\r\n    -   [Caching](#caching)\r\n-   [API Reference](#api-reference)\r\n    -   [Terminology](#terminology)\r\n    -   [$enum](#enum)\r\n    -   [Types](#types)\r\n        -   [EnumWrapper](#enumwrapper-1)\r\n        -   [EnumWrapper.Entry](#enumwrapperentry)\r\n        -   [EnumWrapper.Iteratee](#enumwrapperiteratee)\r\n    -   [Array-Like Interface](#array-like-interface-1)\r\n        -   [EnumWrapper.prototype.length](#enumwrapperprototypelength)\r\n        -   [EnumWrapper.prototype.[index]](#enumwrapperprototypeindex)\r\n    -   [Map-Like Interface](#map-like-interface-1)\r\n        -   [EnumWrapper.prototype.size](#enumwrapperprototypesize)\r\n        -   [EnumWrapper.prototype.keys](#enumwrapperprototypekeys)\r\n        -   [EnumWrapper.prototype.values](#enumwrapperprototypevalues)\r\n        -   [EnumWrapper.prototype.entries](#enumwrapperprototypeentries)\r\n        -   [EnumWrapper.prototype.@@iterator](#enumwrapperprototypeiterator)\r\n        -   [EnumWrapper.prototype.forEach](#enumwrapperprototypeforeach)\r\n    -   [Iteration](#iteration)\r\n        -   [EnumWrapper.prototype.forEach](#enumwrapperprototypeforeach-1)\r\n        -   [EnumWrapper.prototype.map](#enumwrapperprototypemap)\r\n    -   [Get Arrays of Enum Data](#get-arrays-of-enum-data)\r\n        -   [EnumWrapper.prototype.getKeys](#enumwrapperprototypegetkeys)\r\n        -   [EnumWrapper.prototype.getValues](#enumwrapperprototypegetvalues)\r\n        -   [EnumWrapper.prototype.getEntries](#enumwrapperprototypegetentries)\r\n    -   [Key Validation/Typecasting](#key-validationtypecasting)\r\n        -   [EnumWrapper.prototype.isKey](#enumwrapperprototypeiskey)\r\n        -   [EnumWrapper.prototype.asKeyOrThrow](#enumwrapperprototypeaskeyorthrow)\r\n        -   [EnumWrapper.prototype.asKeyOrDefault](#enumwrapperprototypeaskeyordefault)\r\n    -   [Value Validation/Typecasting](#value-validationtypecasting)\r\n        -   [EnumWrapper.prototype.isValue](#enumwrapperprototypeisvalue)\r\n        -   [EnumWrapper.prototype.asValueOrThrow](#enumwrapperprototypeasvalueorthrow)\r\n        -   [EnumWrapper.prototype.asValueOrDefault](#enumwrapperprototypeasvalueordefault)\r\n    -   [Lookup Key by Value](#lookup-key-by-value)\r\n        -   [EnumWrapper.prototype.getKeyOrThrow](#enumwrapperprototypegetkeyorthrow)\r\n        -   [EnumWrapper.prototype.getKeyOrDefault](#enumwrapperprototypegetkeyordefault)\r\n    -   [Lookup Value by Key](#lookup-value-by-key)\r\n        -   [EnumWrapper.prototype.getValueOrThrow](#enumwrapperprototypegetvalueorthrow)\r\n        -   [EnumWrapper.prototype.getValueOrDefault](#enumwrapperprototypegetvalueordefault)\r\n\r\n<!-- /TOC -->\r\n\r\n## What is it?\r\n\r\n`ts-enum-util` provides utilities to improve the usefulness of enums. Examples include:\r\n\r\n-   Get a list of an enum's keys, values, or key/value pairs.\r\n-   Lookup values by key with run-time key validation and optional result defaulting.\r\n-   Reverse lookup of keys by value (for string enums too!) with run-time value validation and optional result defaulting.\r\n-   Run-time validation that a specified value or key is valid for a given enum, with compile-time type guards.\r\n-   Treat an enum like an Array.\r\n-   Treat an enum like a Map.\r\n\r\nAll of these utilities are very specifically typed for each enum via generics and type inference.\r\n\r\n## Other TypeScript Enum Projects\r\n\r\n-   `ts-string-visitor` [[github](https://github.com/UselessPickles/ts-string-visitor), [npm](https://www.npmjs.com/package/ts-string-visitor)] - Generic TypeScript Visitor and Mapper for String Enums and String Literal Union Types\r\n\r\n## Installation\r\n\r\nInstall via [NPM](https://www.npmjs.com/package/ts-enum-util):\r\n\r\n```\r\nnpm i -s ts-enum-util\r\n```\r\n\r\n## Usage Examples\r\n\r\nSeveral small examples `ts-enum-util`'s capabilities to give you a quick overview of what it can do, as well as an organized \"by example\" reference.\r\n\r\nPay special attention to the comments indicating the compile-time type of various results. See [Specific Typing](#specific-typing) for more about data types.\r\n\r\nSee [API Reference](#api-reference) for more details about method signatures and behaviors.\r\n\r\n### Basic setup for all examples\r\n\r\n```ts\r\n// import the $enum helper function\r\nimport { $enum } from \"ts-enum-util\";\r\n\r\n// Example string enum\r\n// (basic numeric enums also supported)\r\n// (enums with a mix of numeric and string values also supported)\r\nenum RGB {\r\n    R = \"r\",\r\n    G = \"g\",\r\n    B = \"b\"\r\n}\r\n```\r\n\r\n### Get an `EnumWrapper` instance for an enum\r\n\r\nUse the [$enum](#enum) function to get an `EnumWrapper` instance for a particular enum.\r\nRead about how `EnumWrapper` instances are cached: [Caching](#caching).\r\n\r\n```ts\r\n// type: EnumWrapper<string, RGB>\r\nconst wrappedRgb = $enum(RGB);\r\n```\r\n\r\n### Get count of enum entries\r\n\r\nSee also:\r\n\r\n-   [Wrapped enums are Array-Like](#wrapped-enums-are-array-like)\r\n-   [Wrapped enums are Map-Like](#wrapped-enums-are-map-like)\r\n\r\n```ts\r\n// Part of the Map-like interface implementation\r\n// type: number\r\n// value: 3\r\nconst size = $enum(RGB).size;\r\n\r\n// Part of the Array-like interface implementation\r\n// type: number\r\n// value: 3\r\nconst length = $enum(RGB).length;\r\n```\r\n\r\n### Get lists of enum data\r\n\r\nSee also:\r\n\r\n-   [Guaranteed Order of Iteration](#guaranteed-order-of-iteration)\r\n-   [Wrapped enums are Array-Like](#wrapped-enums-are-array-like)\r\n-   [Wrapped enums are Map-Like](#wrapped-enums-are-map-like)\r\n\r\n```ts\r\n// type: (\"R\" | \"G\" | \"B\")[]\r\n// value: [\"R\", \"G\", \"B\"]\r\nconst keys = $enum(RGB).getKeys();\r\n\r\n// type: RGB[]\r\n// value: [\"r\", \"g\", \"b\"]\r\nconst values = $enum(RGB).getValues();\r\n\r\n// List of key/value pair tuples\r\n// type: [(\"R\" | \"G\" | \"B\"), RGB][]\r\n// value: [[\"R\", \"r\"], [\"G\", \"g\"], [\"B\", \"b\"]]\r\nconst entries = $enum(RGB).getEntries();\r\n```\r\n\r\n### Lookup value by key\r\n\r\n```ts\r\n// type: RGB\r\n// value: \"g\"\r\nconst value1 = $enum(RGB).getValueOrThrow(\"G\");\r\n\r\n// throws: Error(\"Unexpected value: blah. Expected one of: R,G,B\")\r\nconst value2 = $enum(RGB).getValueOrThrow(\"blah\");\r\n\r\n// type: RGB | undefined\r\n// value: undefined\r\nconst value3 = $enum(RGB).getValueOrDefault(\"blah\");\r\n\r\n// type: RGB\r\n// value: \"r\"\r\nconst value4 = $enum(RGB).getValueOrDefault(\"blah\", RGB.R);\r\n\r\n// type: string\r\n// value: \"BLAH!\"\r\nconst value5 = $enum(RGB).getValueOrDefault(\"blah\", \"BLAH!\");\r\n```\r\n\r\n### Reverse lookup key by value\r\n\r\n```ts\r\n// type: (\"R\" | \"G\" | \"B\")\r\n// value: \"G\"\r\nconst key1 = $enum(RGB).getKeyOrThrow(\"g\");\r\n\r\n// throws: Error(\"Unexpected value: blah. Expected one of: r,g,b\")\r\nconst key2 = $enum(RGB).getKeyOrThrow(\"blah\");\r\n\r\n// type: (\"R\" | \"G\" | \"B\") | undefined\r\n// value: undefined\r\nconst key3 = $enum(RGB).getKeyOrDefault(\"blah\");\r\n\r\n// type: (\"R\" | \"G\" | \"B\")\r\n// value: \"R\"\r\nconst key4 = $enum(RGB).getKeyOrDefault(\"blah\", \"R\");\r\n\r\n// type: string\r\n// value: \"BLAH!\"\r\nconst key4 = $enum(RGB).getKeyOrDefault(\"blah\", \"BLAH!\");\r\n```\r\n\r\n### Validate/convert enum keys\r\n\r\n```ts\r\n// Some arbitrary string\r\ndeclare const str: string;\r\n\r\n// Returns `true` if 'str' is a valid key of RGB\r\nif ($enum(RGB).isKey(str)) {\r\n    // isKey() is a type guard\r\n    // type of 'str' in here is (\"R\" | \"G\" | \"B\")\r\n}\r\n\r\n// type: (\"R\" | \"G\" | \"B\")\r\n// throws error if 'str' is not a valid key for RGB\r\nconst key1 = $enum(RGB).asKeyOrThrow(str);\r\n\r\n// type: (\"R\" | \"G\" | \"B\") | undefined\r\n// value is undefined if 'str' is not a valid key for RGB\r\nconst key2 = $enum(RGB).asKeyOrDefault(str);\r\n\r\n// type: (\"R\" | \"G\" | \"B\")\r\n// value is \"G\" if 'str' is not a valid key for RGB\r\nconst key3 = $enum(RGB).asKeyOrDefault(str, \"G\");\r\n```\r\n\r\n### Validate/convert enum values\r\n\r\n```ts\r\n// Some arbitrary string\r\ndeclare const str: string;\r\n\r\n// Returns `true` if 'str' is a valid value of RGB\r\nif ($enum(RGB).isValue(str)) {\r\n    // isValue() is a type guard\r\n    // type of 'str' in here is RGB\r\n}\r\n\r\n// type: RGB\r\n// throws error if 'str' is not a valid value for RGB\r\nconst value1 = $enum(RGB).asValueOrThrow(str);\r\n\r\n// type: RGB | undefined\r\n// value is undefined if 'str' is not a valid value for RGB\r\nconst value2 = $enum(RGB).asValueOrDefault(str);\r\n\r\n// type: RGB | undefined\r\n// value is RGB.G if 'str' is not a valid value for RGB\r\nconst value3 = $enum(RGB).asValueOrDefault(str, RGB.G);\r\n```\r\n\r\n### Iteration and Mapping\r\n\r\nSee also:\r\n\r\n-   [Guaranteed Order of Iteration](#guaranteed-order-of-iteration)\r\n\r\n```ts\r\nconst wrappedRgb = $enum(RGB);\r\n\r\n// iterate all entries in the enum\r\nwrappedRgb.forEach((value, key, wrappedEnum, index) => {\r\n    // type of value is RGB\r\n    // type of key is (\"R\" | \"G\" | \"B\")\r\n    // wrappedEnum is a reference to wrappedRgb\r\n    // index is based on sorted key order\r\n});\r\n\r\n// Convert all entries of the enum to an array of mapped values\r\n// value: [\"R: r\", \"G: g\", \"B: b\"]\r\nconst mapped = wrappedRgb.map((value, key, wrappedEnum, index) => {\r\n    // type of value is RGB\r\n    // type of key is (\"R\" | \"G\" | \"B\")\r\n    // wrappedEnum is a reference to wrappedRgb\r\n    // index is based on sorted key order\r\n    return `${key}: ${value}`;\r\n});\r\n```\r\n\r\n### Wrapped enums are Array-Like\r\n\r\nA wrapped enum can be treated like an array of enum \"entry\" tuples.\r\n\r\nSee also:\r\n\r\n-   [Array-Like Interface](#array-like-interface)\r\n-   [Guaranteed Order of Iteration](#guaranteed-order-of-iteration)\r\n\r\n```ts\r\nconst wrappedRgb = $enum(RGB);\r\n\r\n// type: number\r\n// value: 3\r\nconst length = wrappedRgb.length;\r\n\r\n// type: [(\"R\" | \"G\" | \"B\"), RGB]\r\n// value: [\"G\", \"g\"]\r\nconst entry = wrappedRgb[1];\r\n```\r\n\r\n### Wrapped enums are Map-Like\r\n\r\nA wrapped enum is similar to a read-only `Map` of enum name -> enum value.\r\n\r\nSee also:\r\n\r\n-   [Map-Like Interface](#map-like-interface) (has explanation of why there's no `get()` or `has()` method)\r\n-   [Guaranteed Order of Iteration](#guaranteed-order-of-iteration)\r\n\r\n```ts\r\nconst wrappedRgb = $enum(RGB);\r\n\r\n// type: number\r\n// value: 3\r\nconst size = wrappedRgb.size;\r\n\r\n// EnumWrapper is directly iterable like a Map\r\nfor (const [key, value] of wrappedRgb) {\r\n    // type of key: (\"R\" | \"G\" | \"B\")\r\n    // type of value: RGB\r\n}\r\n\r\nfor (const key of wrappedRgb.keys()) {\r\n    // type of key: (\"R\" | \"G\" | \"B\")\r\n}\r\n\r\nfor (const value of wrappedRgb.values()) {\r\n    // type of value: RGB\r\n}\r\n\r\nwrappedRgb.forEach((value, key, wrappedEnum, index) => {\r\n    // type of value is RGB\r\n    // type of key is (\"R\" | \"G\" | \"B\")\r\n    // wrappedEnum is a reference to wrappedRgb\r\n    // index is based on sorted key order\r\n    // NOTE: index param is extra compared to Map's forEach\r\n});\r\n```\r\n\r\n## Requirements\r\n\r\n-   _TypeScript 2.3-2.8_: Code that uses `ts-enum-util` will not compile properly with TypeScript versions prior to 2.3. You'll need TypeScript 2.4+ to take advantage of string enums, but you can still use `ts-enum-util` with [Enum-Like Objects](#enum-like-object) containing string values if you are stuck with TypeScript 2.3. Due to a breaking change to `keyof` in TypeScript 2.9, this version of `ts-enum-util` is not compatible with TypeScript 2.9+. Upgrade to `ts-enum-util` v3+ for TypeScript 2.9 compatibility.\r\n-   _ES6 Features_: The following ES6 features are used by `ts-enum-util`, so they must exist (either natively or via polyfill) in the run-time environment:\r\n    -   `Map`\r\n    -   `WeakMap`\r\n    -   `Symbol.iterator`\r\n\r\n## Limitations\r\n\r\n-   Does not work with enums that are merged with a namespace containing values (variables, functions, etc.), or otherwise have any additional properties added to the enum's runtime object.\r\n-   Requires the `preserveConstEnums` TypeScript compiler option to work with `const enums`.\r\n-   For certain `Iterable` features of `WrappedEnum` to work, you must either compile with a target of `es6` or higher, or enable the `downlevelIteration` compiler option.\r\n\r\n## Known Issues\r\n\r\n### `WeakMap` Polyfill\r\n\r\n`WeakMap` polyfills typically store values directly on the \"key\" object (the run-time `enum` object, in this case) as a non-enumerable \"secret\" (randomly generated) property. This allows for quick O(1) constant time lookups and garbage collection of the value along with the key object, but does add a property to the object. The `WeakMap` secret property will NOT be iterated in `for ... in` loops, and will NOT be included in the results of `Object.keys()`, but it WILL be included in the result of `Object.getOwnPropertyNames()`.\r\n\r\nIt's hard to imagine this actually causing any problems, and all mainstream browsers have natively supported `WeakMap` since about 2014-2015, so I have decided to go ahead with relying on `WeakMap`. If you run into a problem caused by this, please [report an issue on github](https://github.com/UselessPickles/ts-enum-util/issues).\r\n\r\nRead more about the use of `WeakMap` for caching `EnumWrapper` instances here: [Caching](#caching)\r\n\r\n## General Concepts\r\n\r\n### Enum-Like Object\r\n\r\n`ts-enum-util` technically works with any \"enum-like\" object, which is any object whose property values are of type `string` or `number`.\r\n\r\nThe most obvious example is a TypeScript `enum`. It can be a standard enum of numeric values, a string enum, or even an enum with a mix of numeric and string values.\r\n\r\n### EnumWrapper\r\n\r\nThe bulk of `ts-enum-util`'s functionality is implemented via an `EnumWrapper` class, which is instantiated with a reference to an enum-like object and implements all the useful utility methods for that enum.\r\n\r\nYou likely won't ever directly reference the `EnumWrapper` class because it's much more convenient to use the [$enum](#enum) function to obtain a reference to an `EnumWrapper` instance.\r\n\r\n### Specific Typing\r\n\r\nThe various methods of `ts-enum-util` are generic and overloaded to ensure that params and results are as specifically-typed as possible. This is acheived through generics, type inference, and overloading of the `$enum` function signature that is used to obtain an `EnumWrapper` instance for a particular enum.\r\n\r\nFor example, when obtaining a key or keys from an `EnumWrapper`, the data type will be a string literal union containing only the specific key names that exist in the enum.\r\n\r\nThis helps maximize the usefulness of `ts-enum-util` by making it compatible with other strictly typed code related to enums.\r\n\r\n### Map-Like Interface\r\n\r\nA subset of `EnumWrapper`'s interface overlaps with much of the ES6 `Map` interface. `EnumWrapper` is similar to a read-only `Map` of enum values, keyed by the enum names. The following Map-like features are implemented:\r\n\r\n-   [size](#enumwrapperprototypesize) property.\r\n-   [keys](#enumwrapperprototypekeys), [values](#enumwrapperprototypevalues), and [entries](#enumwrapperprototypeentries) methods.\r\n-   [forEach](#enumwrapperprototypeforeach) method.\r\n-   [@@iterator](#enumwrapperprototypeiterator) method (`EnumWrapper` is iterable!).\r\n\r\nNOTE: The `Map` interface's `has()` and `get()` methods are intentionally NOT implemented in the interest of clarity and consistency of naming with respect to other `EnumWrapper`-specific methods. The equivalent methods are [isKey](#enumwrapperprototypeiskey) and [getValueOrDefault](#enumwrapperprototypegetvalueordefault) (with second param omitted).\r\n\r\n### Array-Like Interface\r\n\r\n`EnumWrapper` implements the `ArrayLike` interface. It is usable as a readonly array of [EnumWrapper.Entry](#enumwrapperentry). This allows you to pass an `EnumWrapper` instance to any method that is designed read/iterate an array-like value, such as most of [lodash](#https://lodash.com/)'s methods for collections and arrays.\r\n\r\n### Guaranteed Order of Iteration\r\n\r\nECMAScript does not guarantee a specific order when iterating properties/keys of objects. While many implementations do consistently iterate object properties/keys in the order in which they were added to the object, it is not safe to rely upon an assumption that all implementations will do the same.\r\n\r\n`EnumWrapper` sorts the keys of the enum and uses this sorted order to guarantee consistent ordering of all array/iterator results across all implementations. Just beware that the order may not be what you expect.\r\n\r\nExample:\r\n\r\n```ts\r\n// enum defined with keys alphabetically out of order\r\nenum ABC = {\r\n    B,\r\n    A,\r\n    C\r\n}\r\n\r\n// keys are sorted: [\"A\", \"B\", \"C\"]\r\nconst values = $enum(ABC).getKeys();\r\n\r\n// values are ordered by sorted key order: [1, 0, 2]\r\nconst values = $enum(ABC).getValues();\r\n```\r\n\r\n### Caching\r\n\r\n`EnumWrapper` instances are cached using an ES6 `WeakMap` for quick subsequent retrieval via the [$enum](#enum) function. This allows you to easily access the `EnumWrapper` functionality for a given enum via the `$enum` function throughout your codebase without worrying about storing a reference to an `EnumWrapper` that is accessible by all of the relevant code.\r\n\r\nThe use of the `WeakMap` means that even if you use `ts-enum-util` on temporary, dynamically-generated, enum-like objects, there will be no excessive cache bloat or memory leaks. A cached `EnumWrapper` instance will be garbage collected when the enum-like object it is mapped to is garbage collected.\r\n\r\nAlthough `WeakMap` lookups can be extremely efficient (constant time lookups in typical implementations), beware that the ECMAScript specification only requires lookups to be \"on average\" less than O(n) linear time. As such, you should still excercise caution against needlessly obtaining cached references via `$enum` when making heavy use of `EnumWrapper` functionality. Consider storing the result of `$enum()` in a local variable before making multiple calls to its methods, especially if the `EnumWrapper`'s features are used within a loop.\r\n\r\nDespite the above warning, it is noteworthy that even the worst case implementation still produces extremely quick lookups for a relatively small number of items (like the number of enums that you are likely have in a project). For example, see [this performance test](https://www.measurethat.net/Benchmarks/Show/2513/5/map-keyed-by-object) of lookups into maps containing 500 entries, including a simple `Map` polyfill implementation.\r\n\r\nRead about a potential [`WeakMap` Polyfill issue](#weakmap-polyfill).\r\n\r\nRead more about `WeakMap` on the [MDN website](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap).\r\n\r\n## API Reference\r\n\r\nAlso see the source code or the distributed `index.d.ts` file for complete details of method signatures/overloads, detailed method/param documentation, etc.\r\n\r\nSee [Usage Examples](#usage-examples) if you prefer a \"by example\" reference.\r\n\r\n### Terminology\r\n\r\nThroughout this reference, the following aliases for types will be used:\r\n\r\n-   `EnumLike`: An enum-like object type. See [Enum-Like Object](#enum-like-object).\r\n-   `KeyType`: The type of the enum's keys. This is usually a string literal union type of the enum's names, but may also simply be `string` if an `EnumWrapper` was created for an object whose possible property names are not known at compile time.\r\n-   `EnumType`: The specific enum type of the enum values. This is usually the enum type itself, but may also simply be the same as `ValueType` (see below) if a `EnumWrapper` was created for an object that is not actually an enum, but is only \"enum-like\".\r\n-   `ValueType`: The widened type of the enum's values. Will be `number`, `string`, or `number | string`, depending on whether the wrapped enum-like object contains only number, only string, or both number and string values.\r\n\r\n### $enum\r\n\r\nThis is where it all begins. This method returns an [EnumWrapper](#enum-wrapper-1) instance that provides useful utilities for `enumObj`.\r\n\r\nSee [Caching](#caching) for more about caching of `EnumWrapper` instances.\r\n\r\n```ts\r\nfunction $enum(enumObj: EnumLike): EnumWrapper;\r\n```\r\n\r\n-   `enumObj` - An enum or \"enum-like\" object.\r\n\r\n### Types\r\n\r\n#### EnumWrapper\r\n\r\nThis is the class that implements all the enum utilities. It's a generic class that requires an overloaded helper function to properly instantiate, so the constructor is private. Use [$enum()](#enum) to get/create an instance of `EnumWrapper`.\r\n\r\n```ts\r\nclass EnumWrapper\r\n```\r\n\r\n#### EnumWrapper.Entry\r\n\r\nA generic type alias for a tuple containing a key and value pair, representing a complete \"entry\" in the enum. The tuple is defined as `Readonly` to prevent accidental corruption of the `EnumWrapper` instance's data.\r\n\r\n```ts\r\ntype EnumWrapper.Entry = Readonly<[KeyType, EnumType]>\r\n```\r\n\r\n#### EnumWrapper.Iteratee\r\n\r\nA generic type alias for a function signature to be used in iteration methods. This is compliant with the signature of an iteratee for a `Map<KeyType, EnumType>.forEach()` method, but also has an additional `index` param at the end of the parameter list.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\ntype EnumWrapper.Iteratee<R> = (\r\n    value: EnumType,\r\n    key: KeyType,\r\n    enumWrapper: EnumWrapper,\r\n    index: number\r\n) => R\r\n```\r\n\r\n-   `R` - Generic type param for the return type of the function. The signifigance of the return type/value depends on teh context in which the iteratee is being used.\r\n-   `value` - The value of the enum entry.\r\n-   `key` - The key of the enum entry.\r\n-   `enumWrapper` - A reference to the `EnumWrapper` instance that is being iterated.\r\n-   `index` - The index of the enum entry\r\n\r\n### Array-Like Interface\r\n\r\nSee also: [Array-Like Interface](#array-like-interface)\r\n\r\n#### EnumWrapper.prototype.length\r\n\r\nA read-only property containing the number of entries in the enum.\r\n\r\n```ts\r\nreadonly EnumWrapper.prototype.length: number\r\n```\r\n\r\n#### EnumWrapper.prototype.[index]\r\n\r\nThe index signature is implemented on `EnumWrapper` to allow you to access `[key, value]` tuples by index like an array. The values accessed by indexing are readonly.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nreadonly EnumWrapper.prototype.[index: number]: EnumWrapper.Entry\r\n```\r\n\r\n### Map-Like Interface\r\n\r\nSee also: [Map-Like Interface](#map-like-interface)\r\n\r\n#### EnumWrapper.prototype.size\r\n\r\nA read-only property containing the number of entries in the enum.\r\n\r\n```ts\r\nreadonly EnumWrapper.prototype.size: number\r\n```\r\n\r\n#### EnumWrapper.prototype.keys\r\n\r\nReturns an `Iterator` that will iterate all keys of the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.keys(): IterableIterator<KeyType>\r\n```\r\n\r\n#### EnumWrapper.prototype.values\r\n\r\nReturns an `Iterator` that will iterate all values of the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.values(): IterableIterator<EnumType>\r\n```\r\n\r\n#### EnumWrapper.prototype.entries\r\n\r\nReturns an `Iterator` that will iterate all [key, value] pairs of the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.entries(): IterableIterator<EnumWrapper.Entry>\r\n```\r\n\r\n#### EnumWrapper.prototype.@@iterator\r\n\r\nSame as [EnumWrapper.prototype.entries](#enumwrapperprototypeentries).\r\n\r\nAllows an `EnumWrapper` to be directly iterated as a collection of `[key, value]` tuples.\r\n\r\n```ts\r\nEnumWrapper.prototype.@@iterator(): IterableIterator<EnumWrapper.Entry>\r\n```\r\n\r\n#### EnumWrapper.prototype.forEach\r\n\r\nIterates every entry in the enum and calls the provided `iteratee` function.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.forEach(\r\n    iteratee: EnumWrapper.Iteratee,\r\n    context?: any\r\n): void\r\n```\r\n\r\n-   `iteratee`: See [EnumWrapper.Iteratee](#enumwraperriteratee). The return value of this function is ignored.\r\n-   `context`: If provided, then the value will be used as the `this` context when executing `iteratee`.\r\n\r\n### Iteration\r\n\r\n#### EnumWrapper.prototype.forEach\r\n\r\nSee [EnumWrapper.prototype.forEach](#enumwrapperprototypeforeach) in the [Map-Like Interface](#map-like-interface-1) section.\r\n\r\n#### EnumWrapper.prototype.map\r\n\r\nBuilds and returns a new array containing the results of calling the provided `iteratee` function on every entry in the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.map<R>(\r\n    iteratee: EnumWrapper.Iteratee,\r\n    context?: any\r\n): R[]\r\n```\r\n\r\n-   `R`: Generic type param that indicates the type of entries in the resulting array. If not specified, then it will be inferred from the return type of `iteratee`.\r\n-   `iteratee`: See [EnumWrapper.Iteratee](#enumwraperriteratee).\r\n-   `context`: If provided, then the value will be used as the `this` context when executing `iteratee`.\r\n\r\n### Get Arrays of Enum Data\r\n\r\n#### EnumWrapper.prototype.getKeys\r\n\r\nReturns an array of all keys in the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.getKeys(): KeyType[]\r\n```\r\n\r\n#### EnumWrapper.prototype.getValues\r\n\r\nReturns an array of all values in the enum. If the enum contains any duplicate values, then so will the returned array.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.getValues(): EnumType[]\r\n```\r\n\r\n#### EnumWrapper.prototype.getEntries\r\n\r\nReturns a list of `[key, value]` tuples representing all entries in the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.getEntries(): EnumWrapper.Entry[]\r\n```\r\n\r\n### Key Validation/Typecasting\r\n\r\n#### EnumWrapper.prototype.isKey\r\n\r\n```ts\r\nReturns `true` if the provided `key` is a valid key for the enum.\r\n\r\nAlso acts as a type guard to tell the compiler that the provided `key` is the more specific `KeyType` type.\r\nEnumWrapper.prototype.isKey(\r\n    key: string | null | undefined\r\n): key is KeyType\r\n```\r\n\r\n#### EnumWrapper.prototype.asKeyOrThrow\r\n\r\nIf the provided `key` is a valid key for the enum, then the `key` is returned, but cast to the more specific `KeyType` type.\r\n\r\nIf the provided `key` is NOT valid, then an `Error` is thrown.\r\n\r\n```ts\r\nEnumWrapper.prototype.asKeyOrThrow(\r\n    key: string | null | undefined\r\n): KeyType\r\n```\r\n\r\n#### EnumWrapper.prototype.asKeyOrDefault\r\n\r\nIf the provided `key` is a valid key for the enum, then the `key` is returned, but cast to the more specific `KeyType` type.\r\n\r\nIf the provided `key` is NOT valid, then `defaultKey` is returned.\r\n\r\nThis method is overloaded so that its return type is as specific as possible, depending on the type of the `defaultKey` param.\r\n\r\n```ts\r\nEnumWrapper.prototype.asKeyOrDefault(\r\n    key: string | null | undefined,\r\n    defaultKey?: KeyType | string\r\n): KeyType | string | undefined\r\n```\r\n\r\n### Value Validation/Typecasting\r\n\r\n#### EnumWrapper.prototype.isValue\r\n\r\nReturns `true` if the provided `value` is a valid value for the enum.\r\n\r\nAlso acts as a type guard to tell the compiler that the provided `value` is the more specific `EnumType` type.\r\n\r\n```ts\r\nEnumWrapper.prototype.isValue(\r\n    value: ValueType | null | undefined\r\n): key is EnumType\r\n```\r\n\r\n#### EnumWrapper.prototype.asValueOrThrow\r\n\r\nIf the provided `value` is a valid value for the enum, then the `value` is returned, but cast to the more specific `EnumType` type.\r\n\r\nIf the provided `value` is NOT valid, then an `Error` is thrown.\r\n\r\n```ts\r\nEnumWrapper.prototype.asValueOrThrow(\r\n    value: ValueType | null | undefined\r\n): EnumType\r\n```\r\n\r\n#### EnumWrapper.prototype.asValueOrDefault\r\n\r\nIf the provided `value` is a valid value for the enum, then the `value` is returned, but cast to the more specific `EnumType` type.\r\n\r\nIf the provided `value` is NOT valid, then `defaultValue` is returned.\r\n\r\nThis method is overloaded so that its return type is as specific as possible, depending on the type of the `defaultValue` param.\r\n\r\n```ts\r\nEnumWrapper.prototype.asValueOrDefault(\r\n    value: ValueType | null | undefined,\r\n    defaultValue?: EnumType | ValueType\r\n): EnumType | ValueType | undefined\r\n```\r\n\r\n### Lookup Key by Value\r\n\r\n#### EnumWrapper.prototype.getKeyOrThrow\r\n\r\nPerforms a reverse lookup to get the key that corresponds to the provided `value`.\r\n\r\nIf the enum has duplicate values matching the provided `value`, then the key for the last duplicate entry (in order specified by the [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) section) is returned.\r\n\r\nIf the provided `value` is NOT valid, then an `Error` is thrown.\r\n\r\n```ts\r\nEnumWrapper.prototype.getKeyOrThrow(\r\n    value: ValueType | null | undefined\r\n): KeyType\r\n```\r\n\r\n#### EnumWrapper.prototype.getKeyOrDefault\r\n\r\nPerforms a reverse lookup to get the key that corresponds to the provided `value`.\r\n\r\nIf the enum has duplicate values matching the provided `value`, then the key for the last duplicate entry (in order specified by the [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) section) is returned.\r\n\r\nIf the provided `value` is NOT valid, then `defaultKey` is returned.\r\n\r\nThis method is overloaded so that its return type is as specific as possible, depending on the type of the `defaultKey` param.\r\n\r\n```ts\r\nEnumWrapper.prototype.getKeyOrDefault(\r\n    value: ValueType | null | undefined,\r\n    defaultKey?: KeyType | string\r\n): KeyType | string | undefined\r\n```\r\n\r\n### Lookup Value by Key\r\n\r\n#### EnumWrapper.prototype.getValueOrThrow\r\n\r\nReturns the value corresponding to the provided `key`.\r\n\r\nIf the provided `key` is NOT valid, then an `Error` is thrown.\r\n\r\n```ts\r\nEnumWrapper.prototype.getValueOrThrow(\r\n    key: string | null | undefined\r\n): EnumType\r\n```\r\n\r\n#### EnumWrapper.prototype.getValueOrDefault\r\n\r\nReturns the value corresponding to the provided `key`.\r\n\r\nIf the provided `key` is NOT valid, then `defaultValue` is returned.\r\n\r\nThis method is overloaded so that its return type is as specific as possible, depending on the type of the `defaultValue` param.\r\n\r\n```ts\r\nEnumWrapper.prototype.getValueOrDefault(\r\n    key: string | null | undefined,\r\n    defaultValue?: EnumType | ValueType\r\n): EnumType | ValueType | undefined\r\n```\r\n","readmeFilename":"README.md","_id":"ts-enum-util@2.0.5","_npmVersion":"6.0.1","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-gpUmvkXDJ2RPIjaAOXuzsM0OquUITa8EiIOWbr2+Mk24ujkNzaWOtS2/y8yfVMtn3T8VCj8jbpDinFowwdQNjQ==","shasum":"dce5af780bc556c81a9ffdde7823f1bfa40c88d2","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-2.0.5.tgz","fileCount":9,"unpackedSize":147969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbF1a2CRA9TVsSAnZWagAAJkcP+QEg/N1puHSdCtImt6ng\nBpt5Dl6pqkt2DT3Er2z1XVisAPyewVgpoUyUNN4j18wJOmHqAdn6EFES5qUN\n2Ivh+hOUfnUzwJOj2AjYJ/xWIY8QhfN0Bg2029lb439crYY6vKAAg4KtvAIG\nQ9gFUKfZJ+X2vBTM0drtIe2YV6LOqYAD2L4dgi6UWkijsYLNc8J+2JOwZ354\nOgeiKahnyRWVAqmhRYBwn5wpE2UbjXmp09UQqVCQARqJIaASGAq7PincCdje\nFySDhF8FNXkEYPHePqc5Ord9ZWhNfXZewjuVCGcMGXw/B8XVaXHkEYxVEMgJ\nLRdikjtHCE7RTmgkSbz+QRt9xVgpSxYZbYL1zGsUszSJ+an/ry+Oa4uWjnhm\ne1yKdPR8zkxeeWxDt5YqI3VYiy5we+eRVaozFv2YZ0E+xYwrwBaE5BjgHF7i\nEyr5esCq3S1ZKTAcT5FORwD+DQEMe7xvibGC+T/49bBPx9ZVOrsJbie+vyB9\nmKzyGR2hOrXulH/9n89JF/NeWzwRxdh0y4AnWL7Xq+xUKbnkU6FLXsxmx975\nT7qpoAkPDa0h+XDmTVZa5ujMoYolN8Hs9XMoj/8yeAxs4gCQwpp3lAvOIj2f\nTQbeHSgGu6rqds/eeMmBZbhSYR8cOb8wJyRXUGk1Uv2N1O7+2lmnLIs2ydmV\nPb7L\r\n=rKFo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDN5RFO+noAaNJIDzYyTmsQkc3CLW2PMdnDFl32nL45swIgO6g7BOXMtg7uYnKBIQ5APKoh7ucB0KC4CBGT2mRng10="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_2.0.5_1528256181792_0.62424135485098"},"_hasShrinkwrap":false},"3.0.5":{"name":"ts-enum-util","version":"3.0.5","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","prettier:test":"prettier --list-different \"{src,tests,type_tests}/**/*.ts\"","prettier:fix":"prettier --write \"{src,tests,type_tests}/**/*.ts\"","build:types":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --emitDeclarationOnly true --declarationMap true --outDir dist/types","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false --outDir dist/commonjs","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false -m es6 --outDir dist/es","build":"npm run clean:dist && run-p build:types build:es build:commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest","jest:coverage":"npm run clean:coverage && jest --coverage","dtslint:v2_8_plus":"dtslint type_tests/v2_8_plus","dtslint":"run-s clean:dist build:types dtslint:v2_8_plus","test":"run-s compile prettier:test lint dtslint jest","test:coverage":"run-s compile prettier:test lint dtslint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"23.0.0","@types/node":"10.3.0","coveralls":"3.0.1","dtslint":"0.3.0","jest":"23.1.0","npm-run-all":"4.1.3","prettier":"1.13.4","rimraf":"2.6.2","ts-jest":"22.4.6","tslint":"5.10.0","tslint-config-prettier":"1.13.0","typescript":"2.9.1"},"peerDependencies":{"typescript":">= 2.8.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"3efd8acf0ae822dd099f983d7d47611fc747c135","_id":"ts-enum-util@3.0.5","_npmVersion":"6.0.1","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-LdjeydieLIYxApENDWMCl2HhPRqCghPsQyIEYBV2/luOjbK6H5ARIiC5tb9URgEJlS6XU6wNQRi1/aOtSPBqYw==","shasum":"6419c4c8527bda22f7d6801a7844a553ffa9925d","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-3.0.5.tgz","fileCount":6,"unpackedSize":106219,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbF1fiCRA9TVsSAnZWagAA+V0P/3fQg48Uuo29PJcxGh88\nzzFGp17T0nO/0roAW2+ElvmNd7aUkDrtiINwgwpZJwwBuzPSFSCTPpXItFBE\nPofpwb6incy4OdbK6nyVLV09XqUYsFaDckFibjqTbxN5Bp2jxaSqDWQXx4q8\nVZIiQ/rBqLQtasbFQ3G7s7lJ6aKMNo3hlHUt9nocsMiGSb9w+4+wjAqUjvAR\nnnxAm7qvs9TOEtZmPEuy58S463UoBD+c/UxRxDNRr9FE1S/CdGAFEobqTk9b\nTVHu1uQQ8M+C4UYDUCXrfLbCpdqZ/KgJJ9DRrJiXk471yJ5IOCFqCNZSrQhp\nOqgqzt6a7RTf9c9mCE9HTmzj0WIRO50JAzrxwLijnjPgcRZmeC5RkE/sOTaX\nZpKoi1PxTI/KhIXYVLuhNM0oorPF+T2CNifa5v6IFI7D7wJRAnJdClmdxgAo\ncpuwIBIdxehcXYIm/eWvR0FNAlV4S//lXkIi7CY7Cp198GN4T18qszwwdIbq\n+CiXsVYJyUEBCfTn7Ai3NE3wNj0PYM8HnbgpRxMErMETePnu96rgAn9KpuYU\nImKKJTtlG9EzIQ0KT/NHI5lzWZPr5stVeuJmJDNUvY8odukUULRoc9lFyx0T\nYCw6mk89tn6M5UZBnYz5Mfc6eolyTLhnQE4Y3pJS3dMDHg7+dvKYJshQ6WND\nJ2EE\r\n=jBBg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIACZHle6vYtVnhonUZ5lV7vJucXoiof0kAAdfkjr+B1hAiEAywin9gbYYTkW3dC/WbDwkHtA1ar/t+AfWlPcRRajhg4="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_3.0.5_1528256480417_0.7767354761460781"},"_hasShrinkwrap":false},"3.0.6":{"name":"ts-enum-util","version":"3.0.6","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","prettier:test":"prettier --list-different \"{src,tests,type_tests}/**/*.ts\"","prettier:fix":"prettier --write \"{src,tests,type_tests}/**/*.ts\"","build:types":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --emitDeclarationOnly true --declarationMap true --outDir dist/types","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false --outDir dist/commonjs","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false -m es6 --outDir dist/es","build":"npm run clean:dist && run-p build:types build:es build:commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest","jest:coverage":"npm run clean:coverage && jest --coverage","dtslint:v2_8_plus":"dtslint type_tests/v2_8_plus","dtslint":"run-s clean:dist build:types dtslint:v2_8_plus","test":"run-s compile prettier:test lint dtslint jest","test:coverage":"run-s compile prettier:test lint dtslint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"23.0.0","@types/node":"10.3.0","coveralls":"3.0.1","dtslint":"0.3.0","jest":"23.1.0","npm-run-all":"4.1.3","prettier":"1.13.4","rimraf":"2.6.2","ts-jest":"22.4.6","tslint":"5.10.0","tslint-config-prettier":"1.13.0","typescript":"2.9.1"},"peerDependencies":{"typescript":">= 2.8.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"17ed615b81b4263ce6154d8d6ba94b20b8fbd237","_id":"ts-enum-util@3.0.6","_npmVersion":"6.0.1","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-jQ1BWiM6sXe+sth+aak1HcwjQcJnBUkr/N/3k27rb0Qd00wzimQw5uNY2mhtqzatLZfQHsIAYNFqaPhqzfRoAg==","shasum":"0ee198554e43522901ee2c3e49e84bb8d686b659","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-3.0.6.tgz","fileCount":10,"unpackedSize":156281,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbGLVxCRA9TVsSAnZWagAAXyEP/0RnffcqjEzKNgMRN2Xc\nqDMj++KH2GYvioJfXEEh1wUFcog916zezoRPXVt94K6u69L+ctlxhkWyXYe0\nstOOWZ4iodAKzzZzYP+G7N4DGnXW29dh9iZ/ZA18u/WxZMGdheS0zQPmOsK3\nlxlWXJsYnuCyWrsZDEk20sjTdEW3iE4nTmv43H+Gju6Lzyd7Td6U66s/v9FK\n6OOc281RbIIAT+wuweRfRp2tqHOJY5cpge9vpvwd19bhMdADMnegAcunDG4Z\nb1dWp63wXUIqqgVB4rjLw0l8ZkZE3UmOSxFHDDa03nayHJjgxsk9Mcs+sELh\n1/HVt93bgTL0AkNKtc5zp+qGqcZWFuXOgk6h6cmJu5958tVS8aBv5B7kZVLn\nvhLu3Oi7Mu8cFhC4wVhJpt8Q68jrMx5qX7oL0bjOIfxPe6q3DGrU3fO7EVPK\nV5+RxUefCC1FLEdM45majRjXPDu8M71r4IrDj6krHHjUY9Z5LyMsJLL3VBkh\nbeiVjnwNdV+B42XnQ9eUVzlRq7bYUMViukwekXYEGL4/JYPcF/8AshkelVNN\njsE0fJnBwkETz/KcDzJzttE9B8w+jU0xpaLKDMzjdsixrDKyYIBxMKDEXpAi\nP9v3/8K440J8gw3arQCOwOj8xfcp8iuxwoAm+1gU9jLYNlx9aINHV3hDSFRM\nH4He\r\n=IRaq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEgmQq4YMcoVv2jweYDGeTxTCZ5KexlcZkV9GRB8sN2nAiEAojkbG599nIbzHdHLyT+j4pKKYp0DX7bPJ7ftUoBzsaw="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_3.0.6_1528345967069_0.7131223935922537"},"_hasShrinkwrap":false},"2.1.0":{"name":"ts-enum-util","version":"2.1.0","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","prettier:test":"prettier --list-different \"{src,tests,type_tests}/**/*.ts\"","prettier:fix":"prettier --write \"{src,tests,type_tests}/**/*.ts\"","build:types":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --emitDeclarationOnly true --outDir dist/types","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false --outDir dist/commonjs","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false -m es6 --outDir dist/es","build":"npm run clean:dist && run-p build:types build:es build:commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest","jest:coverage":"npm run clean:coverage && jest --coverage","dtslint:v2_3_plus":"dtslint type_tests/v2_3_plus","dtslint:v2_4_plus":"dtslint type_tests/v2_4_plus","dtslint":"run-s clean:dist build:types dtslint:v2_3_plus dtslint:v2_4_plus","test":"run-s compile prettier:test lint jest","test:coverage":"run-s compile prettier:test lint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"23.0.0","@types/node":"10.3.0","coveralls":"3.0.1","dtslint":"0.3.0","jest":"23.1.0","npm-run-all":"4.1.3","prettier":"1.13.4","rimraf":"2.6.2","ts-jest":"22.4.6","tslint":"5.10.0","tslint-config-prettier":"1.13.0","typescript":"2.8.3"},"peerDependencies":{"typescript":">= 2.3.1 < 2.9"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"readme":"[![npm version](https://img.shields.io/npm/v/ts-enum-util.svg)](https://www.npmjs.com/package/ts-enum-util)\r\n[![Join the chat at https://gitter.im/ts-enum-util/Lobby](https://badges.gitter.im/ts-enum-util/Lobby.svg)](https://gitter.im/ts-enum-util/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\r\n[![Build Status](https://travis-ci.org/UselessPickles/ts-enum-util.svg?branch=master)](https://travis-ci.org/UselessPickles/ts-enum-util)\r\n[![Coverage Status](https://coveralls.io/repos/github/UselessPickles/ts-enum-util/badge.svg?branch=master)](https://coveralls.io/github/UselessPickles/ts-enum-util?branch=master)\r\n\r\n# ts-enum-util\r\n\r\nStrictly typed utilities for working with TypeScript enums.\r\n\r\n# Contents\r\n\r\n<!-- TOC depthFrom:2 -->\r\n\r\n-   [What is it?](#what-is-it)\r\n-   [Other TypeScript Enum Projects](#other-typescript-enum-projects)\r\n-   [Installation](#installation)\r\n-   [Usage Examples](#usage-examples)\r\n    -   [Basic setup for all examples](#basic-setup-for-all-examples)\r\n    -   [Get an `EnumWrapper` instance for an enum](#get-an-enumwrapper-instance-for-an-enum)\r\n    -   [Get count of enum entries](#get-count-of-enum-entries)\r\n    -   [Get lists of enum data](#get-lists-of-enum-data)\r\n    -   [Lookup value by key](#lookup-value-by-key)\r\n    -   [Reverse lookup key by value](#reverse-lookup-key-by-value)\r\n    -   [Validate/convert enum keys](#validateconvert-enum-keys)\r\n    -   [Validate/convert enum values](#validateconvert-enum-values)\r\n    -   [Iteration and Mapping](#iteration-and-mapping)\r\n    -   [Wrapped enums are Array-Like](#wrapped-enums-are-array-like)\r\n    -   [Wrapped enums are Map-Like](#wrapped-enums-are-map-like)\r\n-   [Requirements](#requirements)\r\n-   [Limitations](#limitations)\r\n-   [Known Issues](#known-issues)\r\n    -   [`WeakMap` Polyfill](#weakmap-polyfill)\r\n-   [General Concepts](#general-concepts)\r\n    -   [Enum-Like Object](#enum-like-object)\r\n    -   [EnumWrapper](#enumwrapper)\r\n    -   [Specific Typing](#specific-typing)\r\n    -   [Map-Like Interface](#map-like-interface)\r\n    -   [Array-Like Interface](#array-like-interface)\r\n    -   [Guaranteed Order of Iteration](#guaranteed-order-of-iteration)\r\n    -   [Caching](#caching)\r\n-   [API Reference](#api-reference)\r\n    -   [Terminology](#terminology)\r\n    -   [$enum](#enum)\r\n    -   [Types](#types)\r\n        -   [EnumWrapper](#enumwrapper-1)\r\n        -   [EnumWrapper.Entry](#enumwrapperentry)\r\n        -   [EnumWrapper.Iteratee](#enumwrapperiteratee)\r\n    -   [Array-Like Interface](#array-like-interface-1)\r\n        -   [EnumWrapper.prototype.length](#enumwrapperprototypelength)\r\n        -   [EnumWrapper.prototype.[index]](#enumwrapperprototypeindex)\r\n    -   [Map-Like Interface](#map-like-interface-1)\r\n        -   [EnumWrapper.prototype.size](#enumwrapperprototypesize)\r\n        -   [EnumWrapper.prototype.keys](#enumwrapperprototypekeys)\r\n        -   [EnumWrapper.prototype.values](#enumwrapperprototypevalues)\r\n        -   [EnumWrapper.prototype.entries](#enumwrapperprototypeentries)\r\n        -   [EnumWrapper.prototype.@@iterator](#enumwrapperprototypeiterator)\r\n        -   [EnumWrapper.prototype.forEach](#enumwrapperprototypeforeach)\r\n    -   [Iteration](#iteration)\r\n        -   [EnumWrapper.prototype.forEach](#enumwrapperprototypeforeach-1)\r\n        -   [EnumWrapper.prototype.map](#enumwrapperprototypemap)\r\n    -   [Get Arrays of Enum Data](#get-arrays-of-enum-data)\r\n        -   [EnumWrapper.prototype.getKeys](#enumwrapperprototypegetkeys)\r\n        -   [EnumWrapper.prototype.getValues](#enumwrapperprototypegetvalues)\r\n        -   [EnumWrapper.prototype.getEntries](#enumwrapperprototypegetentries)\r\n    -   [Key Validation/Typecasting](#key-validationtypecasting)\r\n        -   [EnumWrapper.prototype.isKey](#enumwrapperprototypeiskey)\r\n        -   [EnumWrapper.prototype.asKeyOrThrow](#enumwrapperprototypeaskeyorthrow)\r\n        -   [EnumWrapper.prototype.asKeyOrDefault](#enumwrapperprototypeaskeyordefault)\r\n    -   [Value Validation/Typecasting](#value-validationtypecasting)\r\n        -   [EnumWrapper.prototype.isValue](#enumwrapperprototypeisvalue)\r\n        -   [EnumWrapper.prototype.asValueOrThrow](#enumwrapperprototypeasvalueorthrow)\r\n        -   [EnumWrapper.prototype.asValueOrDefault](#enumwrapperprototypeasvalueordefault)\r\n    -   [Lookup Key by Value](#lookup-key-by-value)\r\n        -   [EnumWrapper.prototype.getKeyOrThrow](#enumwrapperprototypegetkeyorthrow)\r\n        -   [EnumWrapper.prototype.getKeyOrDefault](#enumwrapperprototypegetkeyordefault)\r\n    -   [Lookup Value by Key](#lookup-value-by-key)\r\n        -   [EnumWrapper.prototype.getValueOrThrow](#enumwrapperprototypegetvalueorthrow)\r\n        -   [EnumWrapper.prototype.getValueOrDefault](#enumwrapperprototypegetvalueordefault)\r\n\r\n<!-- /TOC -->\r\n\r\n## What is it?\r\n\r\n`ts-enum-util` provides utilities to improve the usefulness of enums. Examples include:\r\n\r\n-   Get a list of an enum's keys, values, or key/value pairs.\r\n-   Lookup values by key with run-time key validation and optional result defaulting.\r\n-   Reverse lookup of keys by value (for string enums too!) with run-time value validation and optional result defaulting.\r\n-   Run-time validation that a specified value or key is valid for a given enum, with compile-time type guards.\r\n-   Treat an enum like an Array.\r\n-   Treat an enum like a Map.\r\n\r\nAll of these utilities are very specifically typed for each enum via generics and type inference.\r\n\r\n## Other TypeScript Enum Projects\r\n\r\n-   `ts-string-visitor` [[github](https://github.com/UselessPickles/ts-string-visitor), [npm](https://www.npmjs.com/package/ts-string-visitor)] - Generic TypeScript Visitor and Mapper for String Enums and String Literal Union Types\r\n\r\n## Installation\r\n\r\nInstall via [NPM](https://www.npmjs.com/package/ts-enum-util):\r\n\r\n```\r\nnpm i -s ts-enum-util\r\n```\r\n\r\n## Usage Examples\r\n\r\nSeveral small examples `ts-enum-util`'s capabilities to give you a quick overview of what it can do, as well as an organized \"by example\" reference.\r\n\r\nPay special attention to the comments indicating the compile-time type of various results. See [Specific Typing](#specific-typing) for more about data types.\r\n\r\nSee [API Reference](#api-reference) for more details about method signatures and behaviors.\r\n\r\n### Basic setup for all examples\r\n\r\n```ts\r\n// import the $enum helper function\r\nimport { $enum } from \"ts-enum-util\";\r\n\r\n// Example string enum\r\n// (basic numeric enums also supported)\r\n// (enums with a mix of numeric and string values also supported)\r\nenum RGB {\r\n    R = \"r\",\r\n    G = \"g\",\r\n    B = \"b\"\r\n}\r\n```\r\n\r\n### Get an `EnumWrapper` instance for an enum\r\n\r\nUse the [$enum](#enum) function to get an `EnumWrapper` instance for a particular enum.\r\nRead about how `EnumWrapper` instances are cached: [Caching](#caching).\r\n\r\n```ts\r\n// type: EnumWrapper<string, RGB>\r\nconst wrappedRgb = $enum(RGB);\r\n```\r\n\r\n### Get count of enum entries\r\n\r\nSee also:\r\n\r\n-   [Wrapped enums are Array-Like](#wrapped-enums-are-array-like)\r\n-   [Wrapped enums are Map-Like](#wrapped-enums-are-map-like)\r\n\r\n```ts\r\n// Part of the Map-like interface implementation\r\n// type: number\r\n// value: 3\r\nconst size = $enum(RGB).size;\r\n\r\n// Part of the Array-like interface implementation\r\n// type: number\r\n// value: 3\r\nconst length = $enum(RGB).length;\r\n```\r\n\r\n### Get lists of enum data\r\n\r\nSee also:\r\n\r\n-   [Guaranteed Order of Iteration](#guaranteed-order-of-iteration)\r\n-   [Wrapped enums are Array-Like](#wrapped-enums-are-array-like)\r\n-   [Wrapped enums are Map-Like](#wrapped-enums-are-map-like)\r\n\r\n```ts\r\n// type: (\"R\" | \"G\" | \"B\")[]\r\n// value: [\"R\", \"G\", \"B\"]\r\nconst keys = $enum(RGB).getKeys();\r\n\r\n// type: RGB[]\r\n// value: [\"r\", \"g\", \"b\"]\r\nconst values = $enum(RGB).getValues();\r\n\r\n// List of key/value pair tuples\r\n// type: [(\"R\" | \"G\" | \"B\"), RGB][]\r\n// value: [[\"R\", \"r\"], [\"G\", \"g\"], [\"B\", \"b\"]]\r\nconst entries = $enum(RGB).getEntries();\r\n```\r\n\r\n### Lookup value by key\r\n\r\n```ts\r\n// type: RGB\r\n// value: \"g\"\r\nconst value1 = $enum(RGB).getValueOrThrow(\"G\");\r\n\r\n// throws: Error(\"Unexpected value: blah. Expected one of: R,G,B\")\r\nconst value2 = $enum(RGB).getValueOrThrow(\"blah\");\r\n\r\n// type: RGB | undefined\r\n// value: undefined\r\nconst value3 = $enum(RGB).getValueOrDefault(\"blah\");\r\n\r\n// type: RGB\r\n// value: \"r\"\r\nconst value4 = $enum(RGB).getValueOrDefault(\"blah\", RGB.R);\r\n\r\n// type: string\r\n// value: \"BLAH!\"\r\nconst value5 = $enum(RGB).getValueOrDefault(\"blah\", \"BLAH!\");\r\n```\r\n\r\n### Reverse lookup key by value\r\n\r\n```ts\r\n// type: (\"R\" | \"G\" | \"B\")\r\n// value: \"G\"\r\nconst key1 = $enum(RGB).getKeyOrThrow(\"g\");\r\n\r\n// throws: Error(\"Unexpected value: blah. Expected one of: r,g,b\")\r\nconst key2 = $enum(RGB).getKeyOrThrow(\"blah\");\r\n\r\n// type: (\"R\" | \"G\" | \"B\") | undefined\r\n// value: undefined\r\nconst key3 = $enum(RGB).getKeyOrDefault(\"blah\");\r\n\r\n// type: (\"R\" | \"G\" | \"B\")\r\n// value: \"R\"\r\nconst key4 = $enum(RGB).getKeyOrDefault(\"blah\", \"R\");\r\n\r\n// type: string\r\n// value: \"BLAH!\"\r\nconst key4 = $enum(RGB).getKeyOrDefault(\"blah\", \"BLAH!\");\r\n```\r\n\r\n### Validate/convert enum keys\r\n\r\n```ts\r\n// Some arbitrary string\r\ndeclare const str: string;\r\n\r\n// Returns `true` if 'str' is a valid key of RGB\r\nif ($enum(RGB).isKey(str)) {\r\n    // isKey() is a type guard\r\n    // type of 'str' in here is (\"R\" | \"G\" | \"B\")\r\n}\r\n\r\n// type: (\"R\" | \"G\" | \"B\")\r\n// throws error if 'str' is not a valid key for RGB\r\nconst key1 = $enum(RGB).asKeyOrThrow(str);\r\n\r\n// type: (\"R\" | \"G\" | \"B\") | undefined\r\n// value is undefined if 'str' is not a valid key for RGB\r\nconst key2 = $enum(RGB).asKeyOrDefault(str);\r\n\r\n// type: (\"R\" | \"G\" | \"B\")\r\n// value is \"G\" if 'str' is not a valid key for RGB\r\nconst key3 = $enum(RGB).asKeyOrDefault(str, \"G\");\r\n```\r\n\r\n### Validate/convert enum values\r\n\r\n```ts\r\n// Some arbitrary string\r\ndeclare const str: string;\r\n\r\n// Returns `true` if 'str' is a valid value of RGB\r\nif ($enum(RGB).isValue(str)) {\r\n    // isValue() is a type guard\r\n    // type of 'str' in here is RGB\r\n}\r\n\r\n// type: RGB\r\n// throws error if 'str' is not a valid value for RGB\r\nconst value1 = $enum(RGB).asValueOrThrow(str);\r\n\r\n// type: RGB | undefined\r\n// value is undefined if 'str' is not a valid value for RGB\r\nconst value2 = $enum(RGB).asValueOrDefault(str);\r\n\r\n// type: RGB | undefined\r\n// value is RGB.G if 'str' is not a valid value for RGB\r\nconst value3 = $enum(RGB).asValueOrDefault(str, RGB.G);\r\n```\r\n\r\n### Iteration and Mapping\r\n\r\nSee also:\r\n\r\n-   [Guaranteed Order of Iteration](#guaranteed-order-of-iteration)\r\n\r\n```ts\r\nconst wrappedRgb = $enum(RGB);\r\n\r\n// iterate all entries in the enum\r\nwrappedRgb.forEach((value, key, wrappedEnum, index) => {\r\n    // type of value is RGB\r\n    // type of key is (\"R\" | \"G\" | \"B\")\r\n    // wrappedEnum is a reference to wrappedRgb\r\n    // index is based on sorted key order\r\n});\r\n\r\n// Convert all entries of the enum to an array of mapped values\r\n// value: [\"R: r\", \"G: g\", \"B: b\"]\r\nconst mapped = wrappedRgb.map((value, key, wrappedEnum, index) => {\r\n    // type of value is RGB\r\n    // type of key is (\"R\" | \"G\" | \"B\")\r\n    // wrappedEnum is a reference to wrappedRgb\r\n    // index is based on sorted key order\r\n    return `${key}: ${value}`;\r\n});\r\n```\r\n\r\n### Wrapped enums are Array-Like\r\n\r\nA wrapped enum can be treated like an array of enum \"entry\" tuples.\r\n\r\nSee also:\r\n\r\n-   [Array-Like Interface](#array-like-interface)\r\n-   [Guaranteed Order of Iteration](#guaranteed-order-of-iteration)\r\n\r\n```ts\r\nconst wrappedRgb = $enum(RGB);\r\n\r\n// type: number\r\n// value: 3\r\nconst length = wrappedRgb.length;\r\n\r\n// type: [(\"R\" | \"G\" | \"B\"), RGB]\r\n// value: [\"G\", \"g\"]\r\nconst entry = wrappedRgb[1];\r\n```\r\n\r\n### Wrapped enums are Map-Like\r\n\r\nA wrapped enum is similar to a read-only `Map` of enum name -> enum value.\r\n\r\nSee also:\r\n\r\n-   [Map-Like Interface](#map-like-interface) (has explanation of why there's no `get()` or `has()` method)\r\n-   [Guaranteed Order of Iteration](#guaranteed-order-of-iteration)\r\n\r\n```ts\r\nconst wrappedRgb = $enum(RGB);\r\n\r\n// type: number\r\n// value: 3\r\nconst size = wrappedRgb.size;\r\n\r\n// EnumWrapper is directly iterable like a Map\r\nfor (const [key, value] of wrappedRgb) {\r\n    // type of key: (\"R\" | \"G\" | \"B\")\r\n    // type of value: RGB\r\n}\r\n\r\nfor (const key of wrappedRgb.keys()) {\r\n    // type of key: (\"R\" | \"G\" | \"B\")\r\n}\r\n\r\nfor (const value of wrappedRgb.values()) {\r\n    // type of value: RGB\r\n}\r\n\r\nwrappedRgb.forEach((value, key, wrappedEnum, index) => {\r\n    // type of value is RGB\r\n    // type of key is (\"R\" | \"G\" | \"B\")\r\n    // wrappedEnum is a reference to wrappedRgb\r\n    // index is based on sorted key order\r\n    // NOTE: index param is extra compared to Map's forEach\r\n});\r\n```\r\n\r\n## Requirements\r\n\r\n-   _TypeScript 2.3-2.8_: Code that uses `ts-enum-util` will not compile properly with TypeScript versions prior to 2.3. You'll need TypeScript 2.4+ to take advantage of string enums, but you can still use `ts-enum-util` with [Enum-Like Objects](#enum-like-object) containing string values if you are stuck with TypeScript 2.3. Due to a breaking change to `keyof` in TypeScript 2.9, this version of `ts-enum-util` is not compatible with TypeScript 2.9+. Upgrade to `ts-enum-util` v3+ for TypeScript 2.9 compatibility.\r\n-   _ES6 Features_: The following ES6 features are used by `ts-enum-util`, so they must exist (either natively or via polyfill) in the run-time environment:\r\n    -   `Map`\r\n    -   `WeakMap`\r\n    -   `Symbol.iterator`\r\n    -   `Symbol.toStringTag`\r\n\r\n## Limitations\r\n\r\n-   Does not work with enums that are merged with a namespace containing values (variables, functions, etc.), or otherwise have any additional properties added to the enum's runtime object.\r\n-   Requires the `preserveConstEnums` TypeScript compiler option to work with `const enums`.\r\n-   For certain `Iterable` features of `WrappedEnum` to work, you must either compile with a target of `es6` or higher, or enable the `downlevelIteration` compiler option.\r\n\r\n## Known Issues\r\n\r\n### `WeakMap` Polyfill\r\n\r\n`WeakMap` polyfills typically store values directly on the \"key\" object (the run-time `enum` object, in this case) as a non-enumerable \"secret\" (randomly generated) property. This allows for quick O(1) constant time lookups and garbage collection of the value along with the key object, but does add a property to the object. The `WeakMap` secret property will NOT be iterated in `for ... in` loops, and will NOT be included in the results of `Object.keys()`, but it WILL be included in the result of `Object.getOwnPropertyNames()`.\r\n\r\nIt's hard to imagine this actually causing any problems, and all mainstream browsers have natively supported `WeakMap` since about 2014-2015, so I have decided to go ahead with relying on `WeakMap`. If you run into a problem caused by this, please [report an issue on github](https://github.com/UselessPickles/ts-enum-util/issues).\r\n\r\nRead more about the use of `WeakMap` for caching `EnumWrapper` instances here: [Caching](#caching)\r\n\r\n## General Concepts\r\n\r\n### Enum-Like Object\r\n\r\n`ts-enum-util` technically works with any \"enum-like\" object, which is any object whose property values are of type `string` or `number`.\r\n\r\nThe most obvious example is a TypeScript `enum`. It can be a standard enum of numeric values, a string enum, or even an enum with a mix of numeric and string values.\r\n\r\n### EnumWrapper\r\n\r\nThe bulk of `ts-enum-util`'s functionality is implemented via an `EnumWrapper` class, which is instantiated with a reference to an enum-like object and implements all the useful utility methods for that enum.\r\n\r\nYou likely won't ever directly reference the `EnumWrapper` class because it's much more convenient to use the [$enum](#enum) function to obtain a reference to an `EnumWrapper` instance.\r\n\r\n### Specific Typing\r\n\r\nThe various methods of `ts-enum-util` are generic and overloaded to ensure that params and results are as specifically-typed as possible. This is acheived through generics, type inference, and overloading of the `$enum` function signature that is used to obtain an `EnumWrapper` instance for a particular enum.\r\n\r\nFor example, when obtaining a key or keys from an `EnumWrapper`, the data type will be a string literal union containing only the specific key names that exist in the enum.\r\n\r\nThis helps maximize the usefulness of `ts-enum-util` by making it compatible with other strictly typed code related to enums.\r\n\r\n### Map-Like Interface\r\n\r\nA subset of `EnumWrapper`'s interface overlaps with much of the ES6 `Map` interface. `EnumWrapper` is similar to a read-only `Map` of enum values, keyed by the enum names. The following Map-like features are implemented:\r\n\r\n-   [size](#enumwrapperprototypesize) property.\r\n-   [keys](#enumwrapperprototypekeys), [values](#enumwrapperprototypevalues), and [entries](#enumwrapperprototypeentries) methods.\r\n-   [forEach](#enumwrapperprototypeforeach) method.\r\n-   [@@iterator](#enumwrapperprototypeiterator) method (`EnumWrapper` is iterable!).\r\n\r\nNOTE: The `Map` interface's `has()` and `get()` methods are intentionally NOT implemented in the interest of clarity and consistency of naming with respect to other `EnumWrapper`-specific methods. The equivalent methods are [isKey](#enumwrapperprototypeiskey) and [getValueOrDefault](#enumwrapperprototypegetvalueordefault) (with second param omitted).\r\n\r\n### Array-Like Interface\r\n\r\n`EnumWrapper` implements the `ArrayLike` interface. It is usable as a readonly array of [EnumWrapper.Entry](#enumwrapperentry). This allows you to pass an `EnumWrapper` instance to any method that is designed read/iterate an array-like value, such as most of [lodash](#https://lodash.com/)'s methods for collections and arrays.\r\n\r\n### Guaranteed Order of Iteration\r\n\r\nECMAScript does not guarantee a specific order when iterating properties/keys of objects. While many implementations do consistently iterate object properties/keys in the order in which they were added to the object, it is not safe to rely upon an assumption that all implementations will do the same.\r\n\r\n`EnumWrapper` sorts the keys of the enum and uses this sorted order to guarantee consistent ordering of all array/iterator results across all implementations. Just beware that the order may not be what you expect.\r\n\r\nExample:\r\n\r\n```ts\r\n// enum defined with keys alphabetically out of order\r\nenum ABC = {\r\n    B,\r\n    A,\r\n    C\r\n}\r\n\r\n// keys are sorted: [\"A\", \"B\", \"C\"]\r\nconst values = $enum(ABC).getKeys();\r\n\r\n// values are ordered by sorted key order: [1, 0, 2]\r\nconst values = $enum(ABC).getValues();\r\n```\r\n\r\n### Caching\r\n\r\n`EnumWrapper` instances are cached using an ES6 `WeakMap` for quick subsequent retrieval via the [$enum](#enum) function. This allows you to easily access the `EnumWrapper` functionality for a given enum via the `$enum` function throughout your codebase without worrying about storing a reference to an `EnumWrapper` that is accessible by all of the relevant code.\r\n\r\nThe use of the `WeakMap` means that even if you use `ts-enum-util` on temporary, dynamically-generated, enum-like objects, there will be no excessive cache bloat or memory leaks. A cached `EnumWrapper` instance will be garbage collected when the enum-like object it is mapped to is garbage collected.\r\n\r\nAlthough `WeakMap` lookups can be extremely efficient (constant time lookups in typical implementations), beware that the ECMAScript specification only requires lookups to be \"on average\" less than O(n) linear time. As such, you should still excercise caution against needlessly obtaining cached references via `$enum` when making heavy use of `EnumWrapper` functionality. Consider storing the result of `$enum()` in a local variable before making multiple calls to its methods, especially if the `EnumWrapper`'s features are used within a loop.\r\n\r\nDespite the above warning, it is noteworthy that even the worst case implementation still produces extremely quick lookups for a relatively small number of items (like the number of enums that you are likely have in a project). For example, see [this performance test](https://www.measurethat.net/Benchmarks/Show/2513/5/map-keyed-by-object) of lookups into maps containing 500 entries, including a simple `Map` polyfill implementation.\r\n\r\nRead about a potential [`WeakMap` Polyfill issue](#weakmap-polyfill).\r\n\r\nRead more about `WeakMap` on the [MDN website](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap).\r\n\r\n## API Reference\r\n\r\nAlso see the source code or the distributed `index.d.ts` file for complete details of method signatures/overloads, detailed method/param documentation, etc.\r\n\r\nSee [Usage Examples](#usage-examples) if you prefer a \"by example\" reference.\r\n\r\n### Terminology\r\n\r\nThroughout this reference, the following aliases for types will be used:\r\n\r\n-   `EnumLike`: An enum-like object type. See [Enum-Like Object](#enum-like-object).\r\n-   `KeyType`: The type of the enum's keys. This is usually a string literal union type of the enum's names, but may also simply be `string` if an `EnumWrapper` was created for an object whose possible property names are not known at compile time.\r\n-   `EnumType`: The specific enum type of the enum values. This is usually the enum type itself, but may also simply be the same as `ValueType` (see below) if a `EnumWrapper` was created for an object that is not actually an enum, but is only \"enum-like\".\r\n-   `ValueType`: The widened type of the enum's values. Will be `number`, `string`, or `number | string`, depending on whether the wrapped enum-like object contains only number, only string, or both number and string values.\r\n\r\n### $enum\r\n\r\nThis is where it all begins. This method returns an [EnumWrapper](#enum-wrapper-1) instance that provides useful utilities for `enumObj`.\r\n\r\nSee [Caching](#caching) for more about caching of `EnumWrapper` instances.\r\n\r\n```ts\r\nfunction $enum(enumObj: EnumLike): EnumWrapper;\r\n```\r\n\r\n-   `enumObj` - An enum or \"enum-like\" object.\r\n\r\n### Types\r\n\r\n#### EnumWrapper\r\n\r\nThis is the class that implements all the enum utilities. It's a generic class that requires an overloaded helper function to properly instantiate, so the constructor is private. Use [$enum()](#enum) to get/create an instance of `EnumWrapper`.\r\n\r\n```ts\r\nclass EnumWrapper\r\n```\r\n\r\n#### EnumWrapper.Entry\r\n\r\nA generic type alias for a tuple containing a key and value pair, representing a complete \"entry\" in the enum. The tuple is defined as `Readonly` to prevent accidental corruption of the `EnumWrapper` instance's data.\r\n\r\n```ts\r\ntype EnumWrapper.Entry = Readonly<[KeyType, EnumType]>\r\n```\r\n\r\n#### EnumWrapper.Iteratee\r\n\r\nA generic type alias for a function signature to be used in iteration methods. This is compliant with the signature of an iteratee for a `Map<KeyType, EnumType>.forEach()` method, but also has an additional `index` param at the end of the parameter list.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\ntype EnumWrapper.Iteratee<R> = (\r\n    value: EnumType,\r\n    key: KeyType,\r\n    enumWrapper: EnumWrapper,\r\n    index: number\r\n) => R\r\n```\r\n\r\n-   `R` - Generic type param for the return type of the function. The signifigance of the return type/value depends on teh context in which the iteratee is being used.\r\n-   `value` - The value of the enum entry.\r\n-   `key` - The key of the enum entry.\r\n-   `enumWrapper` - A reference to the `EnumWrapper` instance that is being iterated.\r\n-   `index` - The index of the enum entry\r\n\r\n### Array-Like Interface\r\n\r\nSee also: [Array-Like Interface](#array-like-interface)\r\n\r\n#### EnumWrapper.prototype.length\r\n\r\nA read-only property containing the number of entries in the enum.\r\n\r\n```ts\r\nreadonly EnumWrapper.prototype.length: number\r\n```\r\n\r\n#### EnumWrapper.prototype.[index]\r\n\r\nThe index signature is implemented on `EnumWrapper` to allow you to access `[key, value]` tuples by index like an array. The values accessed by indexing are readonly.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nreadonly EnumWrapper.prototype.[index: number]: EnumWrapper.Entry\r\n```\r\n\r\n### Map-Like Interface\r\n\r\nSee also: [Map-Like Interface](#map-like-interface)\r\n\r\n#### EnumWrapper.prototype.size\r\n\r\nA read-only property containing the number of entries in the enum.\r\n\r\n```ts\r\nreadonly EnumWrapper.prototype.size: number\r\n```\r\n\r\n#### EnumWrapper.prototype.keys\r\n\r\nReturns an `Iterator` that will iterate all keys of the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.keys(): IterableIterator<KeyType>\r\n```\r\n\r\n#### EnumWrapper.prototype.values\r\n\r\nReturns an `Iterator` that will iterate all values of the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.values(): IterableIterator<EnumType>\r\n```\r\n\r\n#### EnumWrapper.prototype.entries\r\n\r\nReturns an `Iterator` that will iterate all [key, value] pairs of the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.entries(): IterableIterator<EnumWrapper.Entry>\r\n```\r\n\r\n#### EnumWrapper.prototype.@@iterator\r\n\r\nSame as [EnumWrapper.prototype.entries](#enumwrapperprototypeentries).\r\n\r\nAllows an `EnumWrapper` to be directly iterated as a collection of `[key, value]` tuples.\r\n\r\n```ts\r\nEnumWrapper.prototype.@@iterator(): IterableIterator<EnumWrapper.Entry>\r\n```\r\n\r\n#### EnumWrapper.prototype.forEach\r\n\r\nIterates every entry in the enum and calls the provided `iteratee` function.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.forEach(\r\n    iteratee: EnumWrapper.Iteratee,\r\n    context?: any\r\n): void\r\n```\r\n\r\n-   `iteratee`: See [EnumWrapper.Iteratee](#enumwraperriteratee). The return value of this function is ignored.\r\n-   `context`: If provided, then the value will be used as the `this` context when executing `iteratee`.\r\n\r\n### Iteration\r\n\r\n#### EnumWrapper.prototype.forEach\r\n\r\nSee [EnumWrapper.prototype.forEach](#enumwrapperprototypeforeach) in the [Map-Like Interface](#map-like-interface-1) section.\r\n\r\n#### EnumWrapper.prototype.map\r\n\r\nBuilds and returns a new array containing the results of calling the provided `iteratee` function on every entry in the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.map<R>(\r\n    iteratee: EnumWrapper.Iteratee,\r\n    context?: any\r\n): R[]\r\n```\r\n\r\n-   `R`: Generic type param that indicates the type of entries in the resulting array. If not specified, then it will be inferred from the return type of `iteratee`.\r\n-   `iteratee`: See [EnumWrapper.Iteratee](#enumwraperriteratee).\r\n-   `context`: If provided, then the value will be used as the `this` context when executing `iteratee`.\r\n\r\n### Get Arrays of Enum Data\r\n\r\n#### EnumWrapper.prototype.getKeys\r\n\r\nReturns an array of all keys in the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.getKeys(): KeyType[]\r\n```\r\n\r\n#### EnumWrapper.prototype.getValues\r\n\r\nReturns an array of all values in the enum. If the enum contains any duplicate values, then so will the returned array.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.getValues(): EnumType[]\r\n```\r\n\r\n#### EnumWrapper.prototype.getEntries\r\n\r\nReturns a list of `[key, value]` tuples representing all entries in the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.getEntries(): EnumWrapper.Entry[]\r\n```\r\n\r\n### Key Validation/Typecasting\r\n\r\n#### EnumWrapper.prototype.isKey\r\n\r\n```ts\r\nReturns `true` if the provided `key` is a valid key for the enum.\r\n\r\nAlso acts as a type guard to tell the compiler that the provided `key` is the more specific `KeyType` type.\r\nEnumWrapper.prototype.isKey(\r\n    key: string | null | undefined\r\n): key is KeyType\r\n```\r\n\r\n#### EnumWrapper.prototype.asKeyOrThrow\r\n\r\nIf the provided `key` is a valid key for the enum, then the `key` is returned, but cast to the more specific `KeyType` type.\r\n\r\nIf the provided `key` is NOT valid, then an `Error` is thrown.\r\n\r\n```ts\r\nEnumWrapper.prototype.asKeyOrThrow(\r\n    key: string | null | undefined\r\n): KeyType\r\n```\r\n\r\n#### EnumWrapper.prototype.asKeyOrDefault\r\n\r\nIf the provided `key` is a valid key for the enum, then the `key` is returned, but cast to the more specific `KeyType` type.\r\n\r\nIf the provided `key` is NOT valid, then `defaultKey` is returned.\r\n\r\nThis method is overloaded so that its return type is as specific as possible, depending on the type of the `defaultKey` param.\r\n\r\n```ts\r\nEnumWrapper.prototype.asKeyOrDefault(\r\n    key: string | null | undefined,\r\n    defaultKey?: KeyType | string\r\n): KeyType | string | undefined\r\n```\r\n\r\n### Value Validation/Typecasting\r\n\r\n#### EnumWrapper.prototype.isValue\r\n\r\nReturns `true` if the provided `value` is a valid value for the enum.\r\n\r\nAlso acts as a type guard to tell the compiler that the provided `value` is the more specific `EnumType` type.\r\n\r\n```ts\r\nEnumWrapper.prototype.isValue(\r\n    value: ValueType | null | undefined\r\n): key is EnumType\r\n```\r\n\r\n#### EnumWrapper.prototype.asValueOrThrow\r\n\r\nIf the provided `value` is a valid value for the enum, then the `value` is returned, but cast to the more specific `EnumType` type.\r\n\r\nIf the provided `value` is NOT valid, then an `Error` is thrown.\r\n\r\n```ts\r\nEnumWrapper.prototype.asValueOrThrow(\r\n    value: ValueType | null | undefined\r\n): EnumType\r\n```\r\n\r\n#### EnumWrapper.prototype.asValueOrDefault\r\n\r\nIf the provided `value` is a valid value for the enum, then the `value` is returned, but cast to the more specific `EnumType` type.\r\n\r\nIf the provided `value` is NOT valid, then `defaultValue` is returned.\r\n\r\nThis method is overloaded so that its return type is as specific as possible, depending on the type of the `defaultValue` param.\r\n\r\n```ts\r\nEnumWrapper.prototype.asValueOrDefault(\r\n    value: ValueType | null | undefined,\r\n    defaultValue?: EnumType | ValueType\r\n): EnumType | ValueType | undefined\r\n```\r\n\r\n### Lookup Key by Value\r\n\r\n#### EnumWrapper.prototype.getKeyOrThrow\r\n\r\nPerforms a reverse lookup to get the key that corresponds to the provided `value`.\r\n\r\nIf the enum has duplicate values matching the provided `value`, then the key for the last duplicate entry (in order specified by the [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) section) is returned.\r\n\r\nIf the provided `value` is NOT valid, then an `Error` is thrown.\r\n\r\n```ts\r\nEnumWrapper.prototype.getKeyOrThrow(\r\n    value: ValueType | null | undefined\r\n): KeyType\r\n```\r\n\r\n#### EnumWrapper.prototype.getKeyOrDefault\r\n\r\nPerforms a reverse lookup to get the key that corresponds to the provided `value`.\r\n\r\nIf the enum has duplicate values matching the provided `value`, then the key for the last duplicate entry (in order specified by the [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) section) is returned.\r\n\r\nIf the provided `value` is NOT valid, then `defaultKey` is returned.\r\n\r\nThis method is overloaded so that its return type is as specific as possible, depending on the type of the `defaultKey` param.\r\n\r\n```ts\r\nEnumWrapper.prototype.getKeyOrDefault(\r\n    value: ValueType | null | undefined,\r\n    defaultKey?: KeyType | string\r\n): KeyType | string | undefined\r\n```\r\n\r\n### Lookup Value by Key\r\n\r\n#### EnumWrapper.prototype.getValueOrThrow\r\n\r\nReturns the value corresponding to the provided `key`.\r\n\r\nIf the provided `key` is NOT valid, then an `Error` is thrown.\r\n\r\n```ts\r\nEnumWrapper.prototype.getValueOrThrow(\r\n    key: string | null | undefined\r\n): EnumType\r\n```\r\n\r\n#### EnumWrapper.prototype.getValueOrDefault\r\n\r\nReturns the value corresponding to the provided `key`.\r\n\r\nIf the provided `key` is NOT valid, then `defaultValue` is returned.\r\n\r\nThis method is overloaded so that its return type is as specific as possible, depending on the type of the `defaultValue` param.\r\n\r\n```ts\r\nEnumWrapper.prototype.getValueOrDefault(\r\n    key: string | null | undefined,\r\n    defaultValue?: EnumType | ValueType\r\n): EnumType | ValueType | undefined\r\n```\r\n","readmeFilename":"README.md","gitHead":"bb9e0f62155d1acce30dc522a16864b4d34e00d5","_id":"ts-enum-util@2.1.0","_npmVersion":"6.0.1","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-o7AG6BXm8kHg757MlV1m6ToXv25SFhGgXz9Eso5kutuPi2CCSX1eVs3MPcodKkn8yqV+/7OAGFQVdavEMU1YsA==","shasum":"aa671a8c351bba04dd3749de36bb7cb533edf2c2","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-2.1.0.tgz","fileCount":9,"unpackedSize":149599,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbMcHKCRA9TVsSAnZWagAAFc0P/jzoS9CGjLacfK0e8IZG\n5PHG4tysJeNip3rBcpzwbe97bwMMYHFXBZ7bsxXeVtUPqLddiLrsKR2KlICd\nPuRnMk111e72OAZuZKE7AVqe0TISBLRBVaSpCcVoALnnuH6dwTJpbmC1+q+V\nU11jOcRJJl6hjJ+XgEFmWPmP1xqYukvDNoh/4eP11fyyebFCKV+5uF1rokeR\nQbFGOUWUCV0zMUKes5gxoE2XvJ85M+rXy7jIzk9FRIKcJ+80Jy3r/A0wpxNK\nhskvjoPZjTW4s/dgRK2jGHzPG39dymjupsfNqLRja1HAoivrtYkMWTnFjHyD\nADcskthsLjpGH7ySLMYKGOiTXBSn3jfP0VlMrIDEkbHfZqeGGp2TqR+LdDdT\nc7nbNdDlp06olk90VGbKM+njtHKLw+EY7W0wR9wBk0SAdgulrVtpTI7r97UB\nZUvPfFtB+WZBPw6uEGbuEvr6mK5MxqkbA2ZkGpUrNo0/WZxoigygxLplVp1c\nJ3sXie/oP2Yq+f7bOgH4TeVVCv2ZyD+Tzg2/D7nmPozFEY6IIXm3a9sw+pa2\nlwIBVDmdELQFudwAfVH/hAZrBIqA+ClR08tEYqnf8VnrM7s9qvXVkanE/x7c\nMaR2EQoPNc3QClBuGm50W6a8vAsPdiizfJ7RWthk1VNyy4rqqIABXjKqdiym\nU4Ct\r\n=zDeq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDifC8v54Uw7X7Qy5BI4jeU/bK5R+MOGUbqywFZRidPEAIgCPAeqBjmXfLI1bTHN+khSCFbb3pzA6gc+CoRWIm6294="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_2.1.0_1529987530890_0.07721471771873856"},"_hasShrinkwrap":false},"3.1.0":{"name":"ts-enum-util","version":"3.1.0","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"files":["dist","src"],"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","prettier:test":"prettier --list-different \"{src,tests,type_tests}/**/*.ts\"","prettier:fix":"prettier --write \"{src,tests,type_tests}/**/*.ts\"","build:types":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --emitDeclarationOnly true --declarationMap true --outDir dist/types","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false --outDir dist/commonjs","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false -m es6 --outDir dist/es","build":"npm run clean:dist && run-p build:types build:es build:commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest","jest:coverage":"npm run clean:coverage && jest --coverage","dtslint:v2_8_plus":"dtslint type_tests/v2_8_plus","dtslint":"run-s clean:dist build:types dtslint:v2_8_plus","test":"run-s compile prettier:test lint dtslint jest","test:coverage":"run-s compile prettier:test lint dtslint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"23.0.0","@types/node":"10.3.0","coveralls":"3.0.1","dtslint":"0.3.0","jest":"23.1.0","npm-run-all":"4.1.3","prettier":"1.13.4","rimraf":"2.6.2","ts-jest":"22.4.6","tslint":"5.10.0","tslint-config-prettier":"1.13.0","typescript":"2.9.1"},"peerDependencies":{"typescript":">= 2.8.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"5b394ad1715f39e1d36505d9f364794877986cbe","_id":"ts-enum-util@3.1.0","_npmVersion":"6.0.1","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-X3rvaVckjES5KXheW8KdMiQmhWwGnNPpM5wDydz3mPhuym2qe7asWMlYHj0OOaHN7a2REgcT3JWpIAi7S8HoNA==","shasum":"60ff9242fe9e7468f488f0d471281abd3ed7fcdd","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-3.1.0.tgz","fileCount":10,"unpackedSize":157952,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbMcLhCRA9TVsSAnZWagAApfUQAIklUri6t4U6CDY/R0pX\nE/J2VvEITi8Ors/HWr7O4MftRNPQuGS5GkSmfDcrt6xnjpX0Dv5TivAArhO2\n9ksc/0FFhVS/Das8M+UL0sHegVz+aEmPI5Qs5J1f8OoXYkPSnhAMlzp9XjQ6\na4SgaD8eCzv2zeh2mvIK/SFbMh8uxib8xb1rsjbv62deeOpyCEX/9183sVVL\nl1awp3kRT5g8jK8zqgvIvPE79FQpvyo5IWxkhU+G18ZyX/GoofaWLFV6I+M7\nK9DMz/byeMSqW2KCk1R97y71IKrOxzHgdHVkizhveDUODxItl3lYccl5X0l/\nKGXqBNR3r3VPmATz96eAnvmI4Udzy1c8HZWAo1xV28mRso1pTd5kw+hfgyIU\ncE/ljpRXARX/6F1DFqboADR44I91fGMH3IqieWJfmDJ8tj3y0ltnoIBaFwow\ngVGg2QRco+5o8jI5KnQcdSbQh2HpByHfeWh0UldDalL5vL06+IyHi4Nfye1g\nXMe2t/5y1mx20b13O2l22DvjvRPAol/BdSqe/H6b3djOUdmDUmUFQIb03xZN\npTKkgwBlET2R0Zw8XF+87HXJCb2U3QkY5100Vl4kc5/OsFhLcFTC/BmMiseB\n2u5nT/yWq7KNlLE+nTbFZMF5SseJydk/l2KJCxHx8fn/IVYcCOs0K96EYvAI\n6jiH\r\n=Yh6t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAbgZNJZNPljlj+mBZ3ojpSpveYVdny3PsDHuggyWhtKAiEAuNBzo9VQyVpqEqJ/VdvV11FnXteWGh3zRs0CwDyP78U="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_3.1.0_1529987808993_0.6477194073112378"},"_hasShrinkwrap":false},"4.0.0-alpha.20181015":{"name":"ts-enum-util","version":"4.0.0-alpha.20181015","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","prettier:test":"prettier --list-different \"{src,tests,type_tests}/**/*.ts\"","prettier:fix":"prettier --write \"{src,tests,type_tests}/**/*.ts\"","build:types":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --emitDeclarationOnly true --declarationMap true --outDir dist/types","build:commonjs":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false --outDir dist/commonjs","build:es":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --declaration false -m es6 --outDir dist/es","build":"npm run clean:dist && run-p build:types build:es build:commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest","jest:coverage":"npm run clean:coverage && jest --coverage","dtslint:v2_8_plus":"dtslint type_tests/v2_8_plus","dtslint:v2_9_plus":"dtslint type_tests/v2_9_plus","dtslint":"run-s clean:dist build:types dtslint:v2_8_plus dtslint:v2_9_plus","test":"run-s compile prettier:test lint dtslint jest","test:coverage":"run-s compile prettier:test lint dtslint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"23.3.3","@types/node":"10.11.4","coveralls":"3.0.2","dtslint":"0.3.0","jest":"23.6.0","npm-run-all":"4.1.3","prettier":"1.14.3","rimraf":"2.6.2","ts-jest":"23.10.3","tslint":"5.11.0","tslint-config-prettier":"1.15.0","typescript":"3.1.1"},"peerDependencies":{"typescript":">= 2.8.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"aaea62c3089e7e0f94a1076189642df447e39dd9","readme":"[![npm version](https://img.shields.io/npm/v/ts-enum-util.svg)](https://www.npmjs.com/package/ts-enum-util)\r\n[![Join the chat at https://gitter.im/ts-enum-util/Lobby](https://badges.gitter.im/ts-enum-util/Lobby.svg)](https://gitter.im/ts-enum-util/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\r\n[![Build Status](https://travis-ci.org/UselessPickles/ts-enum-util.svg?branch=master)](https://travis-ci.org/UselessPickles/ts-enum-util)\r\n[![Coverage Status](https://coveralls.io/repos/github/UselessPickles/ts-enum-util/badge.svg?branch=master)](https://coveralls.io/github/UselessPickles/ts-enum-util?branch=master)\r\n\r\n# ts-enum-util\r\n\r\nStrictly typed utilities for working with TypeScript enums.\r\n\r\n# Contents\r\n\r\n<!-- TOC depthFrom:2 -->\r\n\r\n-   [What is it?](#what-is-it)\r\n-   [Other TypeScript Enum Projects](#other-typescript-enum-projects)\r\n-   [Installation](#installation)\r\n-   [Usage Examples](#usage-examples)\r\n    -   [Basic setup for all examples](#basic-setup-for-all-examples)\r\n    -   [Get an `EnumWrapper` instance for an enum](#get-an-enumwrapper-instance-for-an-enum)\r\n    -   [Get count of enum entries](#get-count-of-enum-entries)\r\n    -   [Get lists of enum data](#get-lists-of-enum-data)\r\n    -   [Lookup value by key](#lookup-value-by-key)\r\n    -   [Reverse lookup key by value](#reverse-lookup-key-by-value)\r\n    -   [Validate/convert enum keys](#validateconvert-enum-keys)\r\n    -   [Validate/convert enum values](#validateconvert-enum-values)\r\n    -   [Iteration and Mapping](#iteration-and-mapping)\r\n    -   [Wrapped enums are Array-Like](#wrapped-enums-are-array-like)\r\n    -   [Wrapped enums are Map-Like](#wrapped-enums-are-map-like)\r\n-   [Requirements](#requirements)\r\n-   [Limitations](#limitations)\r\n-   [Known Issues](#known-issues)\r\n    -   [`WeakMap` Polyfill](#weakmap-polyfill)\r\n-   [General Concepts](#general-concepts)\r\n    -   [Enum-Like Object](#enum-like-object)\r\n    -   [EnumWrapper](#enumwrapper)\r\n    -   [Specific Typing](#specific-typing)\r\n    -   [Map-Like Interface](#map-like-interface)\r\n    -   [Array-Like Interface](#array-like-interface)\r\n    -   [Guaranteed Order of Iteration](#guaranteed-order-of-iteration)\r\n    -   [Caching](#caching)\r\n-   [API Reference](#api-reference)\r\n    -   [Terminology](#terminology)\r\n    -   [$enum](#enum)\r\n    -   [Types](#types)\r\n        -   [EnumWrapper](#enumwrapper-1)\r\n        -   [EnumWrapper.Entry](#enumwrapperentry)\r\n        -   [EnumWrapper.Iteratee](#enumwrapperiteratee)\r\n    -   [Array-Like Interface](#array-like-interface-1)\r\n        -   [EnumWrapper.prototype.length](#enumwrapperprototypelength)\r\n        -   [EnumWrapper.prototype.[index]](#enumwrapperprototypeindex)\r\n    -   [Map-Like Interface](#map-like-interface-1)\r\n        -   [EnumWrapper.prototype.size](#enumwrapperprototypesize)\r\n        -   [EnumWrapper.prototype.keys](#enumwrapperprototypekeys)\r\n        -   [EnumWrapper.prototype.values](#enumwrapperprototypevalues)\r\n        -   [EnumWrapper.prototype.entries](#enumwrapperprototypeentries)\r\n        -   [EnumWrapper.prototype.@@iterator](#enumwrapperprototypeiterator)\r\n        -   [EnumWrapper.prototype.forEach](#enumwrapperprototypeforeach)\r\n    -   [Iteration](#iteration)\r\n        -   [EnumWrapper.prototype.forEach](#enumwrapperprototypeforeach-1)\r\n        -   [EnumWrapper.prototype.map](#enumwrapperprototypemap)\r\n    -   [Get Arrays of Enum Data](#get-arrays-of-enum-data)\r\n        -   [EnumWrapper.prototype.getKeys](#enumwrapperprototypegetkeys)\r\n        -   [EnumWrapper.prototype.getValues](#enumwrapperprototypegetvalues)\r\n        -   [EnumWrapper.prototype.getEntries](#enumwrapperprototypegetentries)\r\n    -   [Key Validation/Typecasting](#key-validationtypecasting)\r\n        -   [EnumWrapper.prototype.isKey](#enumwrapperprototypeiskey)\r\n        -   [EnumWrapper.prototype.asKeyOrThrow](#enumwrapperprototypeaskeyorthrow)\r\n        -   [EnumWrapper.prototype.asKeyOrDefault](#enumwrapperprototypeaskeyordefault)\r\n    -   [Value Validation/Typecasting](#value-validationtypecasting)\r\n        -   [EnumWrapper.prototype.isValue](#enumwrapperprototypeisvalue)\r\n        -   [EnumWrapper.prototype.asValueOrThrow](#enumwrapperprototypeasvalueorthrow)\r\n        -   [EnumWrapper.prototype.asValueOrDefault](#enumwrapperprototypeasvalueordefault)\r\n    -   [Lookup Key by Value](#lookup-key-by-value)\r\n        -   [EnumWrapper.prototype.getKeyOrThrow](#enumwrapperprototypegetkeyorthrow)\r\n        -   [EnumWrapper.prototype.getKeyOrDefault](#enumwrapperprototypegetkeyordefault)\r\n    -   [Lookup Value by Key](#lookup-value-by-key)\r\n        -   [EnumWrapper.prototype.getValueOrThrow](#enumwrapperprototypegetvalueorthrow)\r\n        -   [EnumWrapper.prototype.getValueOrDefault](#enumwrapperprototypegetvalueordefault)\r\n\r\n<!-- /TOC -->\r\n\r\n## What is it?\r\n\r\n`ts-enum-util` provides utilities to improve the usefulness of enums. Examples include:\r\n\r\n-   Get a list of an enum's keys, values, or key/value pairs.\r\n-   Lookup values by key with run-time key validation and optional result defaulting.\r\n-   Reverse lookup of keys by value (for string enums too!) with run-time value validation and optional result defaulting.\r\n-   Run-time validation that a specified value or key is valid for a given enum, with compile-time type guards.\r\n-   Treat an enum like an Array.\r\n-   Treat an enum like a Map.\r\n\r\nAll of these utilities are very specifically typed for each enum via generics and type inference.\r\n\r\n## Other TypeScript Enum Projects\r\n\r\n-   `ts-string-visitor` [[github](https://github.com/UselessPickles/ts-string-visitor), [npm](https://www.npmjs.com/package/ts-string-visitor)] - Generic TypeScript Visitor and Mapper for String Enums and String Literal Union Types\r\n\r\n## Installation\r\n\r\nInstall via [NPM](https://www.npmjs.com/package/ts-enum-util):\r\n\r\n```\r\nnpm i -s ts-enum-util\r\n```\r\n\r\n## Usage Examples\r\n\r\nSeveral small examples `ts-enum-util`'s capabilities to give you a quick overview of what it can do, as well as an organized \"by example\" reference.\r\n\r\nPay special attention to the comments indicating the compile-time type of various results. See [Specific Typing](#specific-typing) for more about data types.\r\n\r\nSee [API Reference](#api-reference) for more details about method signatures and behaviors.\r\n\r\n### Basic setup for all examples\r\n\r\n```ts\r\n// import the $enum helper function\r\nimport { $enum } from \"ts-enum-util\";\r\n\r\n// Example string enum\r\n// (basic numeric enums also supported)\r\n// (enums with a mix of numeric and string values also supported)\r\nenum RGB {\r\n    R = \"r\",\r\n    G = \"g\",\r\n    B = \"b\"\r\n}\r\n```\r\n\r\n### Get an `EnumWrapper` instance for an enum\r\n\r\nUse the [$enum](#enum) function to get an `EnumWrapper` instance for a particular enum.\r\nRead about how `EnumWrapper` instances are cached: [Caching](#caching).\r\n\r\n```ts\r\n// type: EnumWrapper<string, RGB>\r\nconst wrappedRgb = $enum(RGB);\r\n```\r\n\r\n### Get count of enum entries\r\n\r\nSee also:\r\n\r\n-   [Wrapped enums are Array-Like](#wrapped-enums-are-array-like)\r\n-   [Wrapped enums are Map-Like](#wrapped-enums-are-map-like)\r\n\r\n```ts\r\n// Part of the Map-like interface implementation\r\n// type: number\r\n// value: 3\r\nconst size = $enum(RGB).size;\r\n\r\n// Part of the Array-like interface implementation\r\n// type: number\r\n// value: 3\r\nconst length = $enum(RGB).length;\r\n```\r\n\r\n### Get lists of enum data\r\n\r\nSee also:\r\n\r\n-   [Guaranteed Order of Iteration](#guaranteed-order-of-iteration)\r\n-   [Wrapped enums are Array-Like](#wrapped-enums-are-array-like)\r\n-   [Wrapped enums are Map-Like](#wrapped-enums-are-map-like)\r\n\r\n```ts\r\n// type: (\"R\" | \"G\" | \"B\")[]\r\n// value: [\"R\", \"G\", \"B\"]\r\nconst keys = $enum(RGB).getKeys();\r\n\r\n// type: RGB[]\r\n// value: [\"r\", \"g\", \"b\"]\r\nconst values = $enum(RGB).getValues();\r\n\r\n// List of key/value pair tuples\r\n// type: [(\"R\" | \"G\" | \"B\"), RGB][]\r\n// value: [[\"R\", \"r\"], [\"G\", \"g\"], [\"B\", \"b\"]]\r\nconst entries = $enum(RGB).getEntries();\r\n```\r\n\r\n### Lookup value by key\r\n\r\n```ts\r\n// type: RGB\r\n// value: \"g\"\r\nconst value1 = $enum(RGB).getValueOrThrow(\"G\");\r\n\r\n// throws: Error(\"Unexpected value: blah. Expected one of: R,G,B\")\r\nconst value2 = $enum(RGB).getValueOrThrow(\"blah\");\r\n\r\n// type: RGB | undefined\r\n// value: undefined\r\nconst value3 = $enum(RGB).getValueOrDefault(\"blah\");\r\n\r\n// type: RGB\r\n// value: \"r\"\r\nconst value4 = $enum(RGB).getValueOrDefault(\"blah\", RGB.R);\r\n\r\n// type: string\r\n// value: \"BLAH!\"\r\nconst value5 = $enum(RGB).getValueOrDefault(\"blah\", \"BLAH!\");\r\n```\r\n\r\n### Reverse lookup key by value\r\n\r\n```ts\r\n// type: (\"R\" | \"G\" | \"B\")\r\n// value: \"G\"\r\nconst key1 = $enum(RGB).getKeyOrThrow(\"g\");\r\n\r\n// throws: Error(\"Unexpected value: blah. Expected one of: r,g,b\")\r\nconst key2 = $enum(RGB).getKeyOrThrow(\"blah\");\r\n\r\n// type: (\"R\" | \"G\" | \"B\") | undefined\r\n// value: undefined\r\nconst key3 = $enum(RGB).getKeyOrDefault(\"blah\");\r\n\r\n// type: (\"R\" | \"G\" | \"B\")\r\n// value: \"R\"\r\nconst key4 = $enum(RGB).getKeyOrDefault(\"blah\", \"R\");\r\n\r\n// type: string\r\n// value: \"BLAH!\"\r\nconst key4 = $enum(RGB).getKeyOrDefault(\"blah\", \"BLAH!\");\r\n```\r\n\r\n### Validate/convert enum keys\r\n\r\n```ts\r\n// Some arbitrary string\r\ndeclare const str: string;\r\n\r\n// Returns `true` if 'str' is a valid key of RGB\r\nif ($enum(RGB).isKey(str)) {\r\n    // isKey() is a type guard\r\n    // type of 'str' in here is (\"R\" | \"G\" | \"B\")\r\n}\r\n\r\n// type: (\"R\" | \"G\" | \"B\")\r\n// throws error if 'str' is not a valid key for RGB\r\nconst key1 = $enum(RGB).asKeyOrThrow(str);\r\n\r\n// type: (\"R\" | \"G\" | \"B\") | undefined\r\n// value is undefined if 'str' is not a valid key for RGB\r\nconst key2 = $enum(RGB).asKeyOrDefault(str);\r\n\r\n// type: (\"R\" | \"G\" | \"B\")\r\n// value is \"G\" if 'str' is not a valid key for RGB\r\nconst key3 = $enum(RGB).asKeyOrDefault(str, \"G\");\r\n```\r\n\r\n### Validate/convert enum values\r\n\r\n```ts\r\n// Some arbitrary string\r\ndeclare const str: string;\r\n\r\n// Returns `true` if 'str' is a valid value of RGB\r\nif ($enum(RGB).isValue(str)) {\r\n    // isValue() is a type guard\r\n    // type of 'str' in here is RGB\r\n}\r\n\r\n// type: RGB\r\n// throws error if 'str' is not a valid value for RGB\r\nconst value1 = $enum(RGB).asValueOrThrow(str);\r\n\r\n// type: RGB | undefined\r\n// value is undefined if 'str' is not a valid value for RGB\r\nconst value2 = $enum(RGB).asValueOrDefault(str);\r\n\r\n// type: RGB | undefined\r\n// value is RGB.G if 'str' is not a valid value for RGB\r\nconst value3 = $enum(RGB).asValueOrDefault(str, RGB.G);\r\n```\r\n\r\n### Iteration and Mapping\r\n\r\nSee also:\r\n\r\n-   [Guaranteed Order of Iteration](#guaranteed-order-of-iteration)\r\n\r\n```ts\r\nconst wrappedRgb = $enum(RGB);\r\n\r\n// iterate all entries in the enum\r\nwrappedRgb.forEach((value, key, wrappedEnum, index) => {\r\n    // type of value is RGB\r\n    // type of key is (\"R\" | \"G\" | \"B\")\r\n    // wrappedEnum is a reference to wrappedRgb\r\n    // index is based on sorted key order\r\n});\r\n\r\n// Convert all entries of the enum to an array of mapped values\r\n// value: [\"R: r\", \"G: g\", \"B: b\"]\r\nconst mapped = wrappedRgb.map((value, key, wrappedEnum, index) => {\r\n    // type of value is RGB\r\n    // type of key is (\"R\" | \"G\" | \"B\")\r\n    // wrappedEnum is a reference to wrappedRgb\r\n    // index is based on sorted key order\r\n    return `${key}: ${value}`;\r\n});\r\n```\r\n\r\n### Wrapped enums are Array-Like\r\n\r\nA wrapped enum can be treated like an array of enum \"entry\" tuples.\r\n\r\nSee also:\r\n\r\n-   [Array-Like Interface](#array-like-interface)\r\n-   [Guaranteed Order of Iteration](#guaranteed-order-of-iteration)\r\n\r\n```ts\r\nconst wrappedRgb = $enum(RGB);\r\n\r\n// type: number\r\n// value: 3\r\nconst length = wrappedRgb.length;\r\n\r\n// type: [(\"R\" | \"G\" | \"B\"), RGB]\r\n// value: [\"G\", \"g\"]\r\nconst entry = wrappedRgb[1];\r\n```\r\n\r\n### Wrapped enums are Map-Like\r\n\r\nA wrapped enum is similar to a read-only `Map` of enum name -> enum value.\r\n\r\nSee also:\r\n\r\n-   [Map-Like Interface](#map-like-interface) (has explanation of why there's no `get()` or `has()` method)\r\n-   [Guaranteed Order of Iteration](#guaranteed-order-of-iteration)\r\n\r\n```ts\r\nconst wrappedRgb = $enum(RGB);\r\n\r\n// type: number\r\n// value: 3\r\nconst size = wrappedRgb.size;\r\n\r\n// EnumWrapper is directly iterable like a Map\r\nfor (const [key, value] of wrappedRgb) {\r\n    // type of key: (\"R\" | \"G\" | \"B\")\r\n    // type of value: RGB\r\n}\r\n\r\nfor (const key of wrappedRgb.keys()) {\r\n    // type of key: (\"R\" | \"G\" | \"B\")\r\n}\r\n\r\nfor (const value of wrappedRgb.values()) {\r\n    // type of value: RGB\r\n}\r\n\r\nwrappedRgb.forEach((value, key, wrappedEnum, index) => {\r\n    // type of value is RGB\r\n    // type of key is (\"R\" | \"G\" | \"B\")\r\n    // wrappedEnum is a reference to wrappedRgb\r\n    // index is based on sorted key order\r\n    // NOTE: index param is extra compared to Map's forEach\r\n});\r\n```\r\n\r\n## Requirements\r\n\r\n-   _TypeScript 2.8+_: Due to a breaking change to `keyof` in TypeScript 2.9, this version of `ts-enum-util` is not compatible with TypeScript prior to 2.8. Use v2 of `ts-enum-util` if you require compatibility with earlier TypeScript versions.\r\n-   _ES6 Features_: The following ES6 features are used by `ts-enum-util`, so they must exist (either natively or via polyfill) in the run-time environment:\r\n    -   `Map`\r\n    -   `WeakMap`\r\n    -   `Symbol.iterator`\r\n    -   `Symbol.toStringTag`\r\n\r\n## Limitations\r\n\r\n-   Does not work with enums that are merged with a namespace containing values (variables, functions, etc.), or otherwise have any additional properties added to the enum's runtime object.\r\n-   Requires the `preserveConstEnums` TypeScript compiler option to work with `const enums`.\r\n-   For certain `Iterable` features of `WrappedEnum` to work, you must either compile with a target of `es6` or higher, or enable the `downlevelIteration` compiler option.\r\n\r\n## Known Issues\r\n\r\n### `WeakMap` Polyfill\r\n\r\n`WeakMap` polyfills typically store values directly on the \"key\" object (the run-time `enum` object, in this case) as a non-enumerable \"secret\" (randomly generated) property. This allows for quick O(1) constant time lookups and garbage collection of the value along with the key object, but does add a property to the object. The `WeakMap` secret property will NOT be iterated in `for ... in` loops, and will NOT be included in the results of `Object.keys()`, but it WILL be included in the result of `Object.getOwnPropertyNames()`.\r\n\r\nIt's hard to imagine this actually causing any problems, and all mainstream browsers have natively supported `WeakMap` since about 2014-2015, so I have decided to go ahead with relying on `WeakMap`. If you run into a problem caused by this, please [report an issue on github](https://github.com/UselessPickles/ts-enum-util/issues).\r\n\r\nRead more about the use of `WeakMap` for caching `EnumWrapper` instances here: [Caching](#caching)\r\n\r\n## General Concepts\r\n\r\n### Enum-Like Object\r\n\r\n`ts-enum-util` technically works with any \"enum-like\" object, which is any object whose property values are of type `string` or `number`.\r\n\r\nThe most obvious example is a TypeScript `enum`. It can be a standard enum of numeric values, a string enum, or even an enum with a mix of numeric and string values.\r\n\r\n### EnumWrapper\r\n\r\nThe bulk of `ts-enum-util`'s functionality is implemented via an `EnumWrapper` class, which is instantiated with a reference to an enum-like object and implements all the useful utility methods for that enum.\r\n\r\nYou likely won't ever directly reference the `EnumWrapper` class because it's much more convenient to use the [$enum](#enum) function to obtain a reference to an `EnumWrapper` instance.\r\n\r\n### Specific Typing\r\n\r\nThe various methods of `ts-enum-util` are generic and overloaded to ensure that params and results are as specifically-typed as possible. This is acheived through generics, type inference, and overloading of the `$enum` function signature that is used to obtain an `EnumWrapper` instance for a particular enum.\r\n\r\nFor example, when obtaining a key or keys from an `EnumWrapper`, the data type will be a string literal union containing only the specific key names that exist in the enum.\r\n\r\nThis helps maximize the usefulness of `ts-enum-util` by making it compatible with other strictly typed code related to enums.\r\n\r\n### Map-Like Interface\r\n\r\nA subset of `EnumWrapper`'s interface overlaps with much of the ES6 `Map` interface. `EnumWrapper` is similar to a read-only `Map` of enum values, keyed by the enum names. The following Map-like features are implemented:\r\n\r\n-   [size](#enumwrapperprototypesize) property.\r\n-   [keys](#enumwrapperprototypekeys), [values](#enumwrapperprototypevalues), and [entries](#enumwrapperprototypeentries) methods.\r\n-   [forEach](#enumwrapperprototypeforeach) method.\r\n-   [@@iterator](#enumwrapperprototypeiterator) method (`EnumWrapper` is iterable!).\r\n\r\nNOTE: The `Map` interface's `has()` and `get()` methods are intentionally NOT implemented in the interest of clarity and consistency of naming with respect to other `EnumWrapper`-specific methods. The equivalent methods are [isKey](#enumwrapperprototypeiskey) and [getValueOrDefault](#enumwrapperprototypegetvalueordefault) (with second param omitted).\r\n\r\n### Array-Like Interface\r\n\r\n`EnumWrapper` implements the `ArrayLike` interface. It is usable as a readonly array of [EnumWrapper.Entry](#enumwrapperentry). This allows you to pass an `EnumWrapper` instance to any method that is designed read/iterate an array-like value, such as most of [lodash](#https://lodash.com/)'s methods for collections and arrays.\r\n\r\n### Guaranteed Order of Iteration\r\n\r\nECMAScript does not guarantee a specific order when iterating properties/keys of objects. While many implementations do consistently iterate object properties/keys in the order in which they were added to the object, it is not safe to rely upon an assumption that all implementations will do the same.\r\n\r\n`EnumWrapper` sorts the keys of the enum and uses this sorted order to guarantee consistent ordering of all array/iterator results across all implementations. Just beware that the order may not be what you expect.\r\n\r\nExample:\r\n\r\n```ts\r\n// enum defined with keys alphabetically out of order\r\nenum ABC = {\r\n    B,\r\n    A,\r\n    C\r\n}\r\n\r\n// keys are sorted: [\"A\", \"B\", \"C\"]\r\nconst values = $enum(ABC).getKeys();\r\n\r\n// values are ordered by sorted key order: [1, 0, 2]\r\nconst values = $enum(ABC).getValues();\r\n```\r\n\r\n### Caching\r\n\r\n`EnumWrapper` instances are cached using an ES6 `WeakMap` for quick subsequent retrieval via the [$enum](#enum) function. This allows you to easily access the `EnumWrapper` functionality for a given enum via the `$enum` function throughout your codebase without worrying about storing a reference to an `EnumWrapper` that is accessible by all of the relevant code.\r\n\r\nThe use of the `WeakMap` means that even if you use `ts-enum-util` on temporary, dynamically-generated, enum-like objects, there will be no excessive cache bloat or memory leaks. A cached `EnumWrapper` instance will be garbage collected when the enum-like object it is mapped to is garbage collected.\r\n\r\nAlthough `WeakMap` lookups can be extremely efficient (constant time lookups in typical implementations), beware that the ECMAScript specification only requires lookups to be \"on average\" less than O(n) linear time. As such, you should still excercise caution against needlessly obtaining cached references via `$enum` when making heavy use of `EnumWrapper` functionality. Consider storing the result of `$enum()` in a local variable before making multiple calls to its methods, especially if the `EnumWrapper`'s features are used within a loop.\r\n\r\nDespite the above warning, it is noteworthy that even the worst case implementation still produces extremely quick lookups for a relatively small number of items (like the number of enums that you are likely have in a project). For example, see [this performance test](https://www.measurethat.net/Benchmarks/Show/2513/5/map-keyed-by-object) of lookups into maps containing 500 entries, including a simple `Map` polyfill implementation.\r\n\r\nRead about a potential [`WeakMap` Polyfill issue](#weakmap-polyfill).\r\n\r\nRead more about `WeakMap` on the [MDN website](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap).\r\n\r\n## API Reference\r\n\r\nAlso see the source code or the distributed `index.d.ts` file for complete details of method signatures/overloads, detailed method/param documentation, etc.\r\n\r\nSee [Usage Examples](#usage-examples) if you prefer a \"by example\" reference.\r\n\r\n### Terminology\r\n\r\nThroughout this reference, the following aliases for types will be used:\r\n\r\n-   `EnumLike`: An enum-like object type. See [Enum-Like Object](#enum-like-object).\r\n-   `KeyType`: The type of the enum's keys. This is usually a string literal union type of the enum's names, but may also simply be `string` if an `EnumWrapper` was created for an object whose possible property names are not known at compile time.\r\n-   `EnumType`: The specific enum type of the enum values. This is usually the enum type itself, but may also simply be the same as `ValueType` (see below) if a `EnumWrapper` was created for an object that is not actually an enum, but is only \"enum-like\".\r\n-   `ValueType`: The widened type of the enum's values. Will be `number`, `string`, or `number | string`, depending on whether the wrapped enum-like object contains only number, only string, or both number and string values.\r\n\r\n### $enum\r\n\r\nThis is where it all begins. This method returns an [EnumWrapper](#enum-wrapper-1) instance that provides useful utilities for `enumObj`.\r\n\r\nSee [Caching](#caching) for more about caching of `EnumWrapper` instances.\r\n\r\n```ts\r\nfunction $enum(enumObj: EnumLike): EnumWrapper;\r\n```\r\n\r\n-   `enumObj` - An enum or \"enum-like\" object.\r\n\r\n### Types\r\n\r\n#### EnumWrapper\r\n\r\nThis is the class that implements all the enum utilities. It's a generic class that requires an overloaded helper function to properly instantiate, so the constructor is private. Use [$enum()](#enum) to get/create an instance of `EnumWrapper`.\r\n\r\n```ts\r\nclass EnumWrapper\r\n```\r\n\r\n#### EnumWrapper.Entry\r\n\r\nA generic type alias for a tuple containing a key and value pair, representing a complete \"entry\" in the enum. The tuple is defined as `Readonly` to prevent accidental corruption of the `EnumWrapper` instance's data.\r\n\r\n```ts\r\ntype EnumWrapper.Entry = Readonly<[KeyType, EnumType]>\r\n```\r\n\r\n#### EnumWrapper.Iteratee\r\n\r\nA generic type alias for a function signature to be used in iteration methods. This is compliant with the signature of an iteratee for a `Map<KeyType, EnumType>.forEach()` method, but also has an additional `index` param at the end of the parameter list.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\ntype EnumWrapper.Iteratee<R> = (\r\n    value: EnumType,\r\n    key: KeyType,\r\n    enumWrapper: EnumWrapper,\r\n    index: number\r\n) => R\r\n```\r\n\r\n-   `R` - Generic type param for the return type of the function. The signifigance of the return type/value depends on teh context in which the iteratee is being used.\r\n-   `value` - The value of the enum entry.\r\n-   `key` - The key of the enum entry.\r\n-   `enumWrapper` - A reference to the `EnumWrapper` instance that is being iterated.\r\n-   `index` - The index of the enum entry\r\n\r\n### Array-Like Interface\r\n\r\nSee also: [Array-Like Interface](#array-like-interface)\r\n\r\n#### EnumWrapper.prototype.length\r\n\r\nA read-only property containing the number of entries in the enum.\r\n\r\n```ts\r\nreadonly EnumWrapper.prototype.length: number\r\n```\r\n\r\n#### EnumWrapper.prototype.[index]\r\n\r\nThe index signature is implemented on `EnumWrapper` to allow you to access `[key, value]` tuples by index like an array. The values accessed by indexing are readonly.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nreadonly EnumWrapper.prototype.[index: number]: EnumWrapper.Entry\r\n```\r\n\r\n### Map-Like Interface\r\n\r\nSee also: [Map-Like Interface](#map-like-interface)\r\n\r\n#### EnumWrapper.prototype.size\r\n\r\nA read-only property containing the number of entries in the enum.\r\n\r\n```ts\r\nreadonly EnumWrapper.prototype.size: number\r\n```\r\n\r\n#### EnumWrapper.prototype.keys\r\n\r\nReturns an `Iterator` that will iterate all keys of the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.keys(): IterableIterator<KeyType>\r\n```\r\n\r\n#### EnumWrapper.prototype.values\r\n\r\nReturns an `Iterator` that will iterate all values of the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.values(): IterableIterator<EnumType>\r\n```\r\n\r\n#### EnumWrapper.prototype.entries\r\n\r\nReturns an `Iterator` that will iterate all [key, value] pairs of the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.entries(): IterableIterator<EnumWrapper.Entry>\r\n```\r\n\r\n#### EnumWrapper.prototype.@@iterator\r\n\r\nSame as [EnumWrapper.prototype.entries](#enumwrapperprototypeentries).\r\n\r\nAllows an `EnumWrapper` to be directly iterated as a collection of `[key, value]` tuples.\r\n\r\n```ts\r\nEnumWrapper.prototype.@@iterator(): IterableIterator<EnumWrapper.Entry>\r\n```\r\n\r\n#### EnumWrapper.prototype.forEach\r\n\r\nIterates every entry in the enum and calls the provided `iteratee` function.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.forEach(\r\n    iteratee: EnumWrapper.Iteratee,\r\n    context?: any\r\n): void\r\n```\r\n\r\n-   `iteratee`: See [EnumWrapper.Iteratee](#enumwraperriteratee). The return value of this function is ignored.\r\n-   `context`: If provided, then the value will be used as the `this` context when executing `iteratee`.\r\n\r\n### Iteration\r\n\r\n#### EnumWrapper.prototype.forEach\r\n\r\nSee [EnumWrapper.prototype.forEach](#enumwrapperprototypeforeach) in the [Map-Like Interface](#map-like-interface-1) section.\r\n\r\n#### EnumWrapper.prototype.map\r\n\r\nBuilds and returns a new array containing the results of calling the provided `iteratee` function on every entry in the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.map<R>(\r\n    iteratee: EnumWrapper.Iteratee,\r\n    context?: any\r\n): R[]\r\n```\r\n\r\n-   `R`: Generic type param that indicates the type of entries in the resulting array. If not specified, then it will be inferred from the return type of `iteratee`.\r\n-   `iteratee`: See [EnumWrapper.Iteratee](#enumwraperriteratee).\r\n-   `context`: If provided, then the value will be used as the `this` context when executing `iteratee`.\r\n\r\n### Get Arrays of Enum Data\r\n\r\n#### EnumWrapper.prototype.getKeys\r\n\r\nReturns an array of all keys in the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.getKeys(): KeyType[]\r\n```\r\n\r\n#### EnumWrapper.prototype.getValues\r\n\r\nReturns an array of all values in the enum. If the enum contains any duplicate values, then so will the returned array.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.getValues(): EnumType[]\r\n```\r\n\r\n#### EnumWrapper.prototype.getEntries\r\n\r\nReturns a list of `[key, value]` tuples representing all entries in the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.getEntries(): EnumWrapper.Entry[]\r\n```\r\n\r\n### Key Validation/Typecasting\r\n\r\n#### EnumWrapper.prototype.isKey\r\n\r\n```ts\r\nReturns `true` if the provided `key` is a valid key for the enum.\r\n\r\nAlso acts as a type guard to tell the compiler that the provided `key` is the more specific `KeyType` type.\r\nEnumWrapper.prototype.isKey(\r\n    key: string | null | undefined\r\n): key is KeyType\r\n```\r\n\r\n#### EnumWrapper.prototype.asKeyOrThrow\r\n\r\nIf the provided `key` is a valid key for the enum, then the `key` is returned, but cast to the more specific `KeyType` type.\r\n\r\nIf the provided `key` is NOT valid, then an `Error` is thrown.\r\n\r\n```ts\r\nEnumWrapper.prototype.asKeyOrThrow(\r\n    key: string | null | undefined\r\n): KeyType\r\n```\r\n\r\n#### EnumWrapper.prototype.asKeyOrDefault\r\n\r\nIf the provided `key` is a valid key for the enum, then the `key` is returned, but cast to the more specific `KeyType` type.\r\n\r\nIf the provided `key` is NOT valid, then `defaultKey` is returned.\r\n\r\nThis method is overloaded so that its return type is as specific as possible, depending on the type of the `defaultKey` param.\r\n\r\n```ts\r\nEnumWrapper.prototype.asKeyOrDefault(\r\n    key: string | null | undefined,\r\n    defaultKey?: KeyType | string\r\n): KeyType | string | undefined\r\n```\r\n\r\n### Value Validation/Typecasting\r\n\r\n#### EnumWrapper.prototype.isValue\r\n\r\nReturns `true` if the provided `value` is a valid value for the enum.\r\n\r\nAlso acts as a type guard to tell the compiler that the provided `value` is the more specific `EnumType` type.\r\n\r\n```ts\r\nEnumWrapper.prototype.isValue(\r\n    value: ValueType | null | undefined\r\n): key is EnumType\r\n```\r\n\r\n#### EnumWrapper.prototype.asValueOrThrow\r\n\r\nIf the provided `value` is a valid value for the enum, then the `value` is returned, but cast to the more specific `EnumType` type.\r\n\r\nIf the provided `value` is NOT valid, then an `Error` is thrown.\r\n\r\n```ts\r\nEnumWrapper.prototype.asValueOrThrow(\r\n    value: ValueType | null | undefined\r\n): EnumType\r\n```\r\n\r\n#### EnumWrapper.prototype.asValueOrDefault\r\n\r\nIf the provided `value` is a valid value for the enum, then the `value` is returned, but cast to the more specific `EnumType` type.\r\n\r\nIf the provided `value` is NOT valid, then `defaultValue` is returned.\r\n\r\nThis method is overloaded so that its return type is as specific as possible, depending on the type of the `defaultValue` param.\r\n\r\n```ts\r\nEnumWrapper.prototype.asValueOrDefault(\r\n    value: ValueType | null | undefined,\r\n    defaultValue?: EnumType | ValueType\r\n): EnumType | ValueType | undefined\r\n```\r\n\r\n### Lookup Key by Value\r\n\r\n#### EnumWrapper.prototype.getKeyOrThrow\r\n\r\nPerforms a reverse lookup to get the key that corresponds to the provided `value`.\r\n\r\nIf the enum has duplicate values matching the provided `value`, then the key for the last duplicate entry (in order specified by the [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) section) is returned.\r\n\r\nIf the provided `value` is NOT valid, then an `Error` is thrown.\r\n\r\n```ts\r\nEnumWrapper.prototype.getKeyOrThrow(\r\n    value: ValueType | null | undefined\r\n): KeyType\r\n```\r\n\r\n#### EnumWrapper.prototype.getKeyOrDefault\r\n\r\nPerforms a reverse lookup to get the key that corresponds to the provided `value`.\r\n\r\nIf the enum has duplicate values matching the provided `value`, then the key for the last duplicate entry (in order specified by the [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) section) is returned.\r\n\r\nIf the provided `value` is NOT valid, then `defaultKey` is returned.\r\n\r\nThis method is overloaded so that its return type is as specific as possible, depending on the type of the `defaultKey` param.\r\n\r\n```ts\r\nEnumWrapper.prototype.getKeyOrDefault(\r\n    value: ValueType | null | undefined,\r\n    defaultKey?: KeyType | string\r\n): KeyType | string | undefined\r\n```\r\n\r\n### Lookup Value by Key\r\n\r\n#### EnumWrapper.prototype.getValueOrThrow\r\n\r\nReturns the value corresponding to the provided `key`.\r\n\r\nIf the provided `key` is NOT valid, then an `Error` is thrown.\r\n\r\n```ts\r\nEnumWrapper.prototype.getValueOrThrow(\r\n    key: string | null | undefined\r\n): EnumType\r\n```\r\n\r\n#### EnumWrapper.prototype.getValueOrDefault\r\n\r\nReturns the value corresponding to the provided `key`.\r\n\r\nIf the provided `key` is NOT valid, then `defaultValue` is returned.\r\n\r\nThis method is overloaded so that its return type is as specific as possible, depending on the type of the `defaultValue` param.\r\n\r\n```ts\r\nEnumWrapper.prototype.getValueOrDefault(\r\n    key: string | null | undefined,\r\n    defaultValue?: EnumType | ValueType\r\n): EnumType | ValueType | undefined\r\n```\r\n","readmeFilename":"README.md","_id":"ts-enum-util@4.0.0-alpha.20181015","_npmVersion":"6.4.0","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-rcuUEj0OBsRmV0M0Quh9FLY5g3lxbOK5SA2/RqhNLpQEFVl8PZ8QM7trcVkmEndEzAcpyy2O20jQXxy0NR44bQ==","shasum":"dfed23fd0f53938997ca29b4a199cbdb07ad9d82","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-4.0.0-alpha.20181015.tgz","fileCount":80,"unpackedSize":272057,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbxVvZCRA9TVsSAnZWagAACpEP/24E3Ys4FXOUKrDpoT8w\nzPIDthWa1gHLz/Qym3W+iZnrjPQOacXBmGQnC+FbgbBi8CNrwz7KRUrtpnKn\nug7CpTi0UVVOZJrYyhxNIAMqzG7ApD3EXAFta6oF8q7Df99Fy4PCS+7cWxS/\njk97gNkMLuwcT1lMQ9+0VDpom7tACQ/A4opQanrx7bKmW3J68mw27/pGrM/x\nRB5F8Fz/86A/VILUdrI1MM0owSgB+9o7fATe87Pu8Nzdpn2J9dwxjS1iYn0i\n3dqVOR1UAf6ls4ocNwGy8agt53p+T4iR+hOSg9ypcgrxLvae1uqQnxXYp85q\niPYUHEqK+axRvDGprMZCdtW3ygkboU9Rb5ejuLBAM4pJeT/Ky8iwdKefgppW\n+vjEdycK4sEwRd2YayOv5wTA9FSghPaUi+hS6jh8HBSuQqq1AXSEnDlNhgae\n6Q26/p7S0DFUmTDddlZn0eCV89gpqvQnyfpBQJCUkTj8UvBU8doGCPBMBhwN\nMIXFtp4KsNpZ6S74pB+Z2HhiMr66n5iOVk2sgft/EGWttQBu94OP6BeEW1yL\n1sJYcTUJtJWjOa0ZiRh50fux47r8tAGVf/rPmKjgxoB19x4etk1ZkkUSpRoQ\nuG67AXrxNgxLFvk2PFAgamANYe/quJnB7QVtoJ9vfVgcM1ip8ZFimSrswtAZ\nKPAd\r\n=H7OO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDkkOtKwjoFLqh+E9xx6KsCSnNM6gnEe0NEpMdszk7kUAiEAhe+8aK6KNGkKEHwLefbiv+8GIJEr8mewDyIvXOSWreY="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_4.0.0-alpha.20181015_1539660760743_0.8514873036380544"},"_hasShrinkwrap":false},"4.0.0-alpha.20190310":{"name":"ts-enum-util","version":"4.0.0-alpha.20190310","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","prettier:test":"prettier --list-different \"{src,tests,type_tests}/**/*.ts\"","prettier:fix":"prettier --write \"{src,tests,type_tests}/**/*.ts\"","build:types":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --emitDeclarationOnly true --declarationMap true --outDir dist/types","build:commonjs":"tsc --project src/tsconfig.json --pretty --removeComments --noErrorTruncation --declaration false --outDir dist/commonjs","build:es":"tsc --project src/tsconfig.json --pretty --removeComments --noErrorTruncation --declaration false -m es6 --outDir dist/es","build":"npm run clean:dist && run-p build:types build:es build:commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest","jest:coverage":"npm run clean:coverage && jest --coverage","dtslint:v2_9_plus":"dtslint type_tests/v2_9_plus","dtslint":"run-s clean:dist build:types dtslint:v2_9_plus","test":"run-s compile prettier:test lint dtslint jest","test:coverage":"run-s compile prettier:test lint dtslint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"24.0.9","@types/node":"10.12.18","coveralls":"3.0.3","dtslint":"0.5.3","jest":"24.1.0","npm-run-all":"4.1.5","prettier":"1.16.4","rimraf":"2.6.3","ts-jest":"24.0.0","tslint":"5.13.1","tslint-config-prettier":"1.18.0","typescript":"3.3.3333"},"peerDependencies":{"typescript":">= 2.9.1"},"keywords":["typescript","string","number","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"83b15b532672b25bd32fd13a956af86f72f6573a","readme":"[![npm version](https://img.shields.io/npm/v/ts-enum-util.svg)](https://www.npmjs.com/package/ts-enum-util)\r\n[![Join the chat at https://gitter.im/ts-enum-util/Lobby](https://badges.gitter.im/ts-enum-util/Lobby.svg)](https://gitter.im/ts-enum-util/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\r\n[![Build Status](https://travis-ci.org/UselessPickles/ts-enum-util.svg?branch=master)](https://travis-ci.org/UselessPickles/ts-enum-util)\r\n[![Coverage Status](https://coveralls.io/repos/github/UselessPickles/ts-enum-util/badge.svg?branch=master)](https://coveralls.io/github/UselessPickles/ts-enum-util?branch=master)\r\n\r\n# ts-enum-util\r\n\r\nStrictly typed utilities for working with TypeScript enums.\r\n\r\n# Contents\r\n\r\n<!-- TOC depthFrom:2 -->autoauto- [What is it?](#what-is-it)auto- [Other TypeScript Enum Projects](#other-typescript-enum-projects)auto- [Installation](#installation)auto- [Usage Examples](#usage-examples)auto    - [Basic setup for all examples](#basic-setup-for-all-examples)auto    - [Get an `EnumWrapper` instance for an enum](#get-an-enumwrapper-instance-for-an-enum)auto    - [Get count of enum entries](#get-count-of-enum-entries)auto    - [Get lists of enum data](#get-lists-of-enum-data)auto    - [Lookup value by key](#lookup-value-by-key)auto    - [Reverse lookup key by value](#reverse-lookup-key-by-value)auto    - [Validate/convert enum keys](#validateconvert-enum-keys)auto    - [Validate/convert enum values](#validateconvert-enum-values)auto    - [Iteration and Mapping](#iteration-and-mapping)auto    - [Wrapped enums are Array-Like](#wrapped-enums-are-array-like)auto    - [Wrapped enums are Map-Like](#wrapped-enums-are-map-like)auto- [Requirements](#requirements)auto- [Limitations](#limitations)auto- [Known Issues](#known-issues)auto    - [`WeakMap` Polyfill](#weakmap-polyfill)auto- [General Concepts](#general-concepts)auto    - [Enum-Like Object](#enum-like-object)auto    - [EnumWrapper](#enumwrapper)auto    - [Specific Typing](#specific-typing)auto    - [Map-Like Interface](#map-like-interface)auto    - [Array-Like Interface](#array-like-interface)auto    - [Guaranteed Order of Iteration](#guaranteed-order-of-iteration)auto    - [Caching](#caching)auto- [API Reference](#api-reference)auto    - [Terminology](#terminology)auto    - [$enum](#enum)auto    - [Types](#types)auto        - [EnumWrapper](#enumwrapper-1)auto        - [EnumWrapper.Entry](#enumwrapperentry)auto        - [EnumWrapper.Iteratee](#enumwrapperiteratee)auto    - [Array-Like Interface](#array-like-interface-1)auto        - [EnumWrapper.prototype.length](#enumwrapperprototypelength)auto        - [EnumWrapper.prototype.[index]](#enumwrapperprototypeindex)auto    - [Map-Like Interface](#map-like-interface-1)auto        - [EnumWrapper.prototype.size](#enumwrapperprototypesize)auto        - [EnumWrapper.prototype.keys](#enumwrapperprototypekeys)auto        - [EnumWrapper.prototype.values](#enumwrapperprototypevalues)auto        - [EnumWrapper.prototype.entries](#enumwrapperprototypeentries)auto        - [EnumWrapper.prototype.@@iterator](#enumwrapperprototypeiterator)auto        - [EnumWrapper.prototype.forEach](#enumwrapperprototypeforeach)auto    - [Iteration](#iteration)auto        - [EnumWrapper.prototype.forEach](#enumwrapperprototypeforeach-1)auto        - [EnumWrapper.prototype.map](#enumwrapperprototypemap)auto    - [Get Arrays of Enum Data](#get-arrays-of-enum-data)auto        - [EnumWrapper.prototype.getKeys](#enumwrapperprototypegetkeys)auto        - [EnumWrapper.prototype.getValues](#enumwrapperprototypegetvalues)auto        - [EnumWrapper.prototype.getEntries](#enumwrapperprototypegetentries)auto    - [Key Validation/Typecasting](#key-validationtypecasting)auto        - [EnumWrapper.prototype.isKey](#enumwrapperprototypeiskey)auto        - [EnumWrapper.prototype.asKeyOrThrow](#enumwrapperprototypeaskeyorthrow)auto        - [EnumWrapper.prototype.asKeyOrDefault](#enumwrapperprototypeaskeyordefault)auto    - [Value Validation/Typecasting](#value-validationtypecasting)auto        - [EnumWrapper.prototype.isValue](#enumwrapperprototypeisvalue)auto        - [EnumWrapper.prototype.asValueOrThrow](#enumwrapperprototypeasvalueorthrow)auto        - [EnumWrapper.prototype.asValueOrDefault](#enumwrapperprototypeasvalueordefault)auto    - [Lookup Key by Value](#lookup-key-by-value)auto        - [EnumWrapper.prototype.getKeyOrThrow](#enumwrapperprototypegetkeyorthrow)auto        - [EnumWrapper.prototype.getKeyOrDefault](#enumwrapperprototypegetkeyordefault)auto    - [Lookup Value by Key](#lookup-value-by-key)auto        - [EnumWrapper.prototype.getValueOrThrow](#enumwrapperprototypegetvalueorthrow)auto        - [EnumWrapper.prototype.getValueOrDefault](#enumwrapperprototypegetvalueordefault)autoauto<!-- /TOC -->\r\n\r\n## What is it?\r\n\r\n`ts-enum-util` provides utilities to improve the usefulness of enums. Examples include:\r\n\r\n-   Get a list of an enum's keys, values, or key/value pairs.\r\n-   Lookup values by key with run-time key validation and optional result defaulting.\r\n-   Reverse lookup of keys by value (for string enums too!) with run-time value validation and optional result defaulting.\r\n-   Run-time validation that a specified value or key is valid for a given enum, with compile-time type guards.\r\n-   Treat an enum like an Array.\r\n-   Treat an enum like a Map.\r\n\r\nAll of these utilities are very specifically typed for each enum via generics and type inference.\r\n\r\n## Other TypeScript Enum Projects\r\n\r\n-   `ts-string-visitor` [[github](https://github.com/UselessPickles/ts-string-visitor), [npm](https://www.npmjs.com/package/ts-string-visitor)] - Generic TypeScript Visitor and Mapper for String Enums and String Literal Union Types\r\n\r\n## Installation\r\n\r\nInstall via [NPM](https://www.npmjs.com/package/ts-enum-util):\r\n\r\n```\r\nnpm i -s ts-enum-util\r\n```\r\n\r\n## Usage Examples\r\n\r\nSeveral small examples `ts-enum-util`'s capabilities to give you a quick overview of what it can do, as well as an organized \"by example\" reference.\r\n\r\nPay special attention to the comments indicating the compile-time type of various results. See [Specific Typing](#specific-typing) for more about data types.\r\n\r\nSee [API Reference](#api-reference) for more details about method signatures and behaviors.\r\n\r\n### Basic setup for all examples\r\n\r\n```ts\r\n// import the $enum helper function\r\nimport { $enum } from \"ts-enum-util\";\r\n\r\n// Example string enum\r\n// (basic numeric enums also supported)\r\n// (enums with a mix of numeric and string values also supported)\r\nenum RGB {\r\n    R = \"r\",\r\n    G = \"g\",\r\n    B = \"b\"\r\n}\r\n```\r\n\r\n### Get an `EnumWrapper` instance for an enum\r\n\r\nUse the [\\$enum](#enum) function to get an `EnumWrapper` instance for a particular enum.\r\nRead about how `EnumWrapper` instances are cached: [Caching](#caching).\r\n\r\n```ts\r\n// type: EnumWrapper<string, RGB>\r\nconst wrappedRgb = $enum(RGB);\r\n```\r\n\r\n### Get count of enum entries\r\n\r\nSee also:\r\n\r\n-   [Wrapped enums are Array-Like](#wrapped-enums-are-array-like)\r\n-   [Wrapped enums are Map-Like](#wrapped-enums-are-map-like)\r\n\r\n```ts\r\n// Part of the Map-like interface implementation\r\n// type: number\r\n// value: 3\r\nconst size = $enum(RGB).size;\r\n\r\n// Part of the Array-like interface implementation\r\n// type: number\r\n// value: 3\r\nconst length = $enum(RGB).length;\r\n```\r\n\r\n### Get lists of enum data\r\n\r\nSee also:\r\n\r\n-   [Guaranteed Order of Iteration](#guaranteed-order-of-iteration)\r\n-   [Wrapped enums are Array-Like](#wrapped-enums-are-array-like)\r\n-   [Wrapped enums are Map-Like](#wrapped-enums-are-map-like)\r\n\r\n```ts\r\n// type: (\"R\" | \"G\" | \"B\")[]\r\n// value: [\"R\", \"G\", \"B\"]\r\nconst keys = $enum(RGB).getKeys();\r\n\r\n// type: RGB[]\r\n// value: [\"r\", \"g\", \"b\"]\r\nconst values = $enum(RGB).getValues();\r\n\r\n// List of key/value pair tuples\r\n// type: [(\"R\" | \"G\" | \"B\"), RGB][]\r\n// value: [[\"R\", \"r\"], [\"G\", \"g\"], [\"B\", \"b\"]]\r\nconst entries = $enum(RGB).getEntries();\r\n```\r\n\r\n### Lookup value by key\r\n\r\n```ts\r\n// type: RGB\r\n// value: \"g\"\r\nconst value1 = $enum(RGB).getValueOrThrow(\"G\");\r\n\r\n// throws: Error(\"Unexpected value: blah. Expected one of: R,G,B\")\r\nconst value2 = $enum(RGB).getValueOrThrow(\"blah\");\r\n\r\n// type: RGB | undefined\r\n// value: undefined\r\nconst value3 = $enum(RGB).getValueOrDefault(\"blah\");\r\n\r\n// type: RGB\r\n// value: \"r\"\r\nconst value4 = $enum(RGB).getValueOrDefault(\"blah\", RGB.R);\r\n\r\n// type: string\r\n// value: \"BLAH!\"\r\nconst value5 = $enum(RGB).getValueOrDefault(\"blah\", \"BLAH!\");\r\n```\r\n\r\n### Reverse lookup key by value\r\n\r\n```ts\r\n// type: (\"R\" | \"G\" | \"B\")\r\n// value: \"G\"\r\nconst key1 = $enum(RGB).getKeyOrThrow(\"g\");\r\n\r\n// throws: Error(\"Unexpected value: blah. Expected one of: r,g,b\")\r\nconst key2 = $enum(RGB).getKeyOrThrow(\"blah\");\r\n\r\n// type: (\"R\" | \"G\" | \"B\") | undefined\r\n// value: undefined\r\nconst key3 = $enum(RGB).getKeyOrDefault(\"blah\");\r\n\r\n// type: (\"R\" | \"G\" | \"B\")\r\n// value: \"R\"\r\nconst key4 = $enum(RGB).getKeyOrDefault(\"blah\", \"R\");\r\n\r\n// type: string\r\n// value: \"BLAH!\"\r\nconst key4 = $enum(RGB).getKeyOrDefault(\"blah\", \"BLAH!\");\r\n```\r\n\r\n### Validate/convert enum keys\r\n\r\n```ts\r\n// Some arbitrary string\r\ndeclare const str: string;\r\n\r\n// Returns `true` if 'str' is a valid key of RGB\r\nif ($enum(RGB).isKey(str)) {\r\n    // isKey() is a type guard\r\n    // type of 'str' in here is (\"R\" | \"G\" | \"B\")\r\n}\r\n\r\n// type: (\"R\" | \"G\" | \"B\")\r\n// throws error if 'str' is not a valid key for RGB\r\nconst key1 = $enum(RGB).asKeyOrThrow(str);\r\n\r\n// type: (\"R\" | \"G\" | \"B\") | undefined\r\n// value is undefined if 'str' is not a valid key for RGB\r\nconst key2 = $enum(RGB).asKeyOrDefault(str);\r\n\r\n// type: (\"R\" | \"G\" | \"B\")\r\n// value is \"G\" if 'str' is not a valid key for RGB\r\nconst key3 = $enum(RGB).asKeyOrDefault(str, \"G\");\r\n```\r\n\r\n### Validate/convert enum values\r\n\r\n```ts\r\n// Some arbitrary string\r\ndeclare const str: string;\r\n\r\n// Returns `true` if 'str' is a valid value of RGB\r\nif ($enum(RGB).isValue(str)) {\r\n    // isValue() is a type guard\r\n    // type of 'str' in here is RGB\r\n}\r\n\r\n// type: RGB\r\n// throws error if 'str' is not a valid value for RGB\r\nconst value1 = $enum(RGB).asValueOrThrow(str);\r\n\r\n// type: RGB | undefined\r\n// value is undefined if 'str' is not a valid value for RGB\r\nconst value2 = $enum(RGB).asValueOrDefault(str);\r\n\r\n// type: RGB | undefined\r\n// value is RGB.G if 'str' is not a valid value for RGB\r\nconst value3 = $enum(RGB).asValueOrDefault(str, RGB.G);\r\n```\r\n\r\n### Iteration and Mapping\r\n\r\nSee also:\r\n\r\n-   [Guaranteed Order of Iteration](#guaranteed-order-of-iteration)\r\n\r\n```ts\r\nconst wrappedRgb = $enum(RGB);\r\n\r\n// iterate all entries in the enum\r\nwrappedRgb.forEach((value, key, wrappedEnum, index) => {\r\n    // type of value is RGB\r\n    // type of key is (\"R\" | \"G\" | \"B\")\r\n    // wrappedEnum is a reference to wrappedRgb\r\n    // index is based on sorted key order\r\n});\r\n\r\n// Convert all entries of the enum to an array of mapped values\r\n// value: [\"R: r\", \"G: g\", \"B: b\"]\r\nconst mapped = wrappedRgb.map((value, key, wrappedEnum, index) => {\r\n    // type of value is RGB\r\n    // type of key is (\"R\" | \"G\" | \"B\")\r\n    // wrappedEnum is a reference to wrappedRgb\r\n    // index is based on sorted key order\r\n    return `${key}: ${value}`;\r\n});\r\n```\r\n\r\n### Wrapped enums are Array-Like\r\n\r\nA wrapped enum can be treated like an array of enum \"entry\" tuples.\r\n\r\nSee also:\r\n\r\n-   [Array-Like Interface](#array-like-interface)\r\n-   [Guaranteed Order of Iteration](#guaranteed-order-of-iteration)\r\n\r\n```ts\r\nconst wrappedRgb = $enum(RGB);\r\n\r\n// type: number\r\n// value: 3\r\nconst length = wrappedRgb.length;\r\n\r\n// type: [(\"R\" | \"G\" | \"B\"), RGB]\r\n// value: [\"G\", \"g\"]\r\nconst entry = wrappedRgb[1];\r\n```\r\n\r\n### Wrapped enums are Map-Like\r\n\r\nA wrapped enum is similar to a read-only `Map` of enum name -> enum value.\r\n\r\nSee also:\r\n\r\n-   [Map-Like Interface](#map-like-interface) (has explanation of why there's no `get()` or `has()` method)\r\n-   [Guaranteed Order of Iteration](#guaranteed-order-of-iteration)\r\n\r\n```ts\r\nconst wrappedRgb = $enum(RGB);\r\n\r\n// type: number\r\n// value: 3\r\nconst size = wrappedRgb.size;\r\n\r\n// EnumWrapper is directly iterable like a Map\r\nfor (const [key, value] of wrappedRgb) {\r\n    // type of key: (\"R\" | \"G\" | \"B\")\r\n    // type of value: RGB\r\n}\r\n\r\nfor (const key of wrappedRgb.keys()) {\r\n    // type of key: (\"R\" | \"G\" | \"B\")\r\n}\r\n\r\nfor (const value of wrappedRgb.values()) {\r\n    // type of value: RGB\r\n}\r\n\r\nwrappedRgb.forEach((value, key, wrappedEnum, index) => {\r\n    // type of value is RGB\r\n    // type of key is (\"R\" | \"G\" | \"B\")\r\n    // wrappedEnum is a reference to wrappedRgb\r\n    // index is based on sorted key order\r\n    // NOTE: index param is extra compared to Map's forEach\r\n});\r\n```\r\n\r\n## Requirements\r\n\r\n-   _TypeScript 2.8+_: Due to a breaking change to `keyof` in TypeScript 2.9, this version of `ts-enum-util` is not compatible with TypeScript prior to 2.8. Use v2 of `ts-enum-util` if you require compatibility with earlier TypeScript versions.\r\n-   _ES6 Features_: The following ES6 features are used by `ts-enum-util`, so they must exist (either natively or via polyfill) in the run-time environment:\r\n    -   `Map`\r\n    -   `WeakMap`\r\n    -   `Symbol.iterator`\r\n    -   `Symbol.toStringTag`\r\n\r\n## Limitations\r\n\r\n-   Does not work with enums that are merged with a namespace containing values (variables, functions, etc.), or otherwise have any additional properties added to the enum's runtime object.\r\n-   Requires the `preserveConstEnums` TypeScript compiler option to work with `const enums`.\r\n-   For certain `Iterable` features of `WrappedEnum` to work, you must either compile with a target of `es6` or higher, or enable the `downlevelIteration` compiler option.\r\n\r\n## Known Issues\r\n\r\n### `WeakMap` Polyfill\r\n\r\n`WeakMap` polyfills typically store values directly on the \"key\" object (the run-time `enum` object, in this case) as a non-enumerable \"secret\" (randomly generated) property. This allows for quick O(1) constant time lookups and garbage collection of the value along with the key object, but does add a property to the object. The `WeakMap` secret property will NOT be iterated in `for ... in` loops, and will NOT be included in the results of `Object.keys()`, but it WILL be included in the result of `Object.getOwnPropertyNames()`.\r\n\r\nIt's hard to imagine this actually causing any problems, and all mainstream browsers have natively supported `WeakMap` since about 2014-2015, so I have decided to go ahead with relying on `WeakMap`. If you run into a problem caused by this, please [report an issue on github](https://github.com/UselessPickles/ts-enum-util/issues).\r\n\r\nRead more about the use of `WeakMap` for caching `EnumWrapper` instances here: [Caching](#caching)\r\n\r\n## General Concepts\r\n\r\n### Enum-Like Object\r\n\r\n`ts-enum-util` technically works with any \"enum-like\" object, which is any object whose property values are of type `string` or `number`.\r\n\r\nThe most obvious example is a TypeScript `enum`. It can be a standard enum of numeric values, a string enum, or even an enum with a mix of numeric and string values.\r\n\r\n### EnumWrapper\r\n\r\nThe bulk of `ts-enum-util`'s functionality is implemented via an `EnumWrapper` class, which is instantiated with a reference to an enum-like object and implements all the useful utility methods for that enum.\r\n\r\nYou likely won't ever directly reference the `EnumWrapper` class because it's much more convenient to use the [\\$enum](#enum) function to obtain a reference to an `EnumWrapper` instance.\r\n\r\n### Specific Typing\r\n\r\nThe various methods of `ts-enum-util` are generic and overloaded to ensure that params and results are as specifically-typed as possible. This is acheived through generics, type inference, and overloading of the `$enum` function signature that is used to obtain an `EnumWrapper` instance for a particular enum.\r\n\r\nFor example, when obtaining a key or keys from an `EnumWrapper`, the data type will be a string literal union containing only the specific key names that exist in the enum.\r\n\r\nThis helps maximize the usefulness of `ts-enum-util` by making it compatible with other strictly typed code related to enums.\r\n\r\n### Map-Like Interface\r\n\r\nA subset of `EnumWrapper`'s interface overlaps with much of the ES6 `Map` interface. `EnumWrapper` is similar to a read-only `Map` of enum values, keyed by the enum names. The following Map-like features are implemented:\r\n\r\n-   [size](#enumwrapperprototypesize) property.\r\n-   [keys](#enumwrapperprototypekeys), [values](#enumwrapperprototypevalues), and [entries](#enumwrapperprototypeentries) methods.\r\n-   [forEach](#enumwrapperprototypeforeach) method.\r\n-   [@@iterator](#enumwrapperprototypeiterator) method (`EnumWrapper` is iterable!).\r\n\r\nNOTE: The `Map` interface's `has()` and `get()` methods are intentionally NOT implemented in the interest of clarity and consistency of naming with respect to other `EnumWrapper`-specific methods. The equivalent methods are [isKey](#enumwrapperprototypeiskey) and [getValueOrDefault](#enumwrapperprototypegetvalueordefault) (with second param omitted).\r\n\r\n### Array-Like Interface\r\n\r\n`EnumWrapper` implements the `ArrayLike` interface. It is usable as a readonly array of [EnumWrapper.Entry](#enumwrapperentry). This allows you to pass an `EnumWrapper` instance to any method that is designed read/iterate an array-like value, such as most of [lodash](#https://lodash.com/)'s methods for collections and arrays.\r\n\r\n### Guaranteed Order of Iteration\r\n\r\nECMAScript does not guarantee a specific order when iterating properties/keys of objects. While many implementations do consistently iterate object properties/keys in the order in which they were added to the object, it is not safe to rely upon an assumption that all implementations will do the same.\r\n\r\n`EnumWrapper` sorts the keys of the enum and uses this sorted order to guarantee consistent ordering of all array/iterator results across all implementations. Just beware that the order may not be what you expect.\r\n\r\nExample:\r\n\r\n```ts\r\n// enum defined with keys alphabetically out of order\r\nenum ABC = {\r\n    B,\r\n    A,\r\n    C\r\n}\r\n\r\n// keys are sorted: [\"A\", \"B\", \"C\"]\r\nconst values = $enum(ABC).getKeys();\r\n\r\n// values are ordered by sorted key order: [1, 0, 2]\r\nconst values = $enum(ABC).getValues();\r\n```\r\n\r\n### Caching\r\n\r\n`EnumWrapper` instances are cached using an ES6 `WeakMap` for quick subsequent retrieval via the [\\$enum](#enum) function. This allows you to easily access the `EnumWrapper` functionality for a given enum via the `$enum` function throughout your codebase without worrying about storing a reference to an `EnumWrapper` that is accessible by all of the relevant code.\r\n\r\nThe use of the `WeakMap` means that even if you use `ts-enum-util` on temporary, dynamically-generated, enum-like objects, there will be no excessive cache bloat or memory leaks. A cached `EnumWrapper` instance will be garbage collected when the enum-like object it is mapped to is garbage collected.\r\n\r\nAlthough `WeakMap` lookups can be extremely efficient (constant time lookups in typical implementations), beware that the ECMAScript specification only requires lookups to be \"on average\" less than O(n) linear time. As such, you should still excercise caution against needlessly obtaining cached references via `$enum` when making heavy use of `EnumWrapper` functionality. Consider storing the result of `$enum()` in a local variable before making multiple calls to its methods, especially if the `EnumWrapper`'s features are used within a loop.\r\n\r\nDespite the above warning, it is noteworthy that even the worst case implementation still produces extremely quick lookups for a relatively small number of items (like the number of enums that you are likely have in a project). For example, see [this performance test](https://www.measurethat.net/Benchmarks/Show/2513/5/map-keyed-by-object) of lookups into maps containing 500 entries, including a simple `Map` polyfill implementation.\r\n\r\nRead about a potential [`WeakMap` Polyfill issue](#weakmap-polyfill).\r\n\r\nRead more about `WeakMap` on the [MDN website](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap).\r\n\r\n## API Reference\r\n\r\nAlso see the source code or the distributed `index.d.ts` file for complete details of method signatures/overloads, detailed method/param documentation, etc.\r\n\r\nSee [Usage Examples](#usage-examples) if you prefer a \"by example\" reference.\r\n\r\n### Terminology\r\n\r\nThroughout this reference, the following aliases for types will be used:\r\n\r\n-   `EnumLike`: An enum-like object type. See [Enum-Like Object](#enum-like-object).\r\n-   `KeyType`: The type of the enum's keys. This is usually a string literal union type of the enum's names, but may also simply be `string` if an `EnumWrapper` was created for an object whose possible property names are not known at compile time.\r\n-   `EnumType`: The specific enum type of the enum values. This is usually the enum type itself, but may also simply be the same as `ValueType` (see below) if a `EnumWrapper` was created for an object that is not actually an enum, but is only \"enum-like\".\r\n-   `ValueType`: The widened type of the enum's values. Will be `number`, `string`, or `number | string`, depending on whether the wrapped enum-like object contains only number, only string, or both number and string values.\r\n\r\n### \\$enum\r\n\r\nThis is where it all begins. This method returns an [EnumWrapper](#enum-wrapper-1) instance that provides useful utilities for `enumObj`.\r\n\r\nSee [Caching](#caching) for more about caching of `EnumWrapper` instances.\r\n\r\n```ts\r\nfunction $enum(enumObj: EnumLike): EnumWrapper;\r\n```\r\n\r\n-   `enumObj` - An enum or \"enum-like\" object.\r\n\r\n### Types\r\n\r\n#### EnumWrapper\r\n\r\nThis is the class that implements all the enum utilities. It's a generic class that requires an overloaded helper function to properly instantiate, so the constructor is private. Use [\\$enum()](#enum) to get/create an instance of `EnumWrapper`.\r\n\r\n```ts\r\nclass EnumWrapper\r\n```\r\n\r\n#### EnumWrapper.Entry\r\n\r\nA generic type alias for a tuple containing a key and value pair, representing a complete \"entry\" in the enum. The tuple is defined as `Readonly` to prevent accidental corruption of the `EnumWrapper` instance's data.\r\n\r\n```ts\r\ntype EnumWrapper.Entry = Readonly<[KeyType, EnumType]>\r\n```\r\n\r\n#### EnumWrapper.Iteratee\r\n\r\nA generic type alias for a function signature to be used in iteration methods. This is compliant with the signature of an iteratee for a `Map<KeyType, EnumType>.forEach()` method, but also has an additional `index` param at the end of the parameter list.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\ntype EnumWrapper.Iteratee<R> = (\r\n    value: EnumType,\r\n    key: KeyType,\r\n    enumWrapper: EnumWrapper,\r\n    index: number\r\n) => R\r\n```\r\n\r\n-   `R` - Generic type param for the return type of the function. The signifigance of the return type/value depends on teh context in which the iteratee is being used.\r\n-   `value` - The value of the enum entry.\r\n-   `key` - The key of the enum entry.\r\n-   `enumWrapper` - A reference to the `EnumWrapper` instance that is being iterated.\r\n-   `index` - The index of the enum entry\r\n\r\n### Array-Like Interface\r\n\r\nSee also: [Array-Like Interface](#array-like-interface)\r\n\r\n#### EnumWrapper.prototype.length\r\n\r\nA read-only property containing the number of entries in the enum.\r\n\r\n```ts\r\nreadonly EnumWrapper.prototype.length: number\r\n```\r\n\r\n#### EnumWrapper.prototype.[index]\r\n\r\nThe index signature is implemented on `EnumWrapper` to allow you to access `[key, value]` tuples by index like an array. The values accessed by indexing are readonly.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nreadonly EnumWrapper.prototype.[index: number]: EnumWrapper.Entry\r\n```\r\n\r\n### Map-Like Interface\r\n\r\nSee also: [Map-Like Interface](#map-like-interface)\r\n\r\n#### EnumWrapper.prototype.size\r\n\r\nA read-only property containing the number of entries in the enum.\r\n\r\n```ts\r\nreadonly EnumWrapper.prototype.size: number\r\n```\r\n\r\n#### EnumWrapper.prototype.keys\r\n\r\nReturns an `Iterator` that will iterate all keys of the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.keys(): IterableIterator<KeyType>\r\n```\r\n\r\n#### EnumWrapper.prototype.values\r\n\r\nReturns an `Iterator` that will iterate all values of the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.values(): IterableIterator<EnumType>\r\n```\r\n\r\n#### EnumWrapper.prototype.entries\r\n\r\nReturns an `Iterator` that will iterate all [key, value] pairs of the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.entries(): IterableIterator<EnumWrapper.Entry>\r\n```\r\n\r\n#### EnumWrapper.prototype.@@iterator\r\n\r\nSame as [EnumWrapper.prototype.entries](#enumwrapperprototypeentries).\r\n\r\nAllows an `EnumWrapper` to be directly iterated as a collection of `[key, value]` tuples.\r\n\r\n```ts\r\nEnumWrapper.prototype.@@iterator(): IterableIterator<EnumWrapper.Entry>\r\n```\r\n\r\n#### EnumWrapper.prototype.forEach\r\n\r\nIterates every entry in the enum and calls the provided `iteratee` function.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.forEach(\r\n    iteratee: EnumWrapper.Iteratee,\r\n    context?: any\r\n): void\r\n```\r\n\r\n-   `iteratee`: See [EnumWrapper.Iteratee](#enumwraperriteratee). The return value of this function is ignored.\r\n-   `context`: If provided, then the value will be used as the `this` context when executing `iteratee`.\r\n\r\n### Iteration\r\n\r\n#### EnumWrapper.prototype.forEach\r\n\r\nSee [EnumWrapper.prototype.forEach](#enumwrapperprototypeforeach) in the [Map-Like Interface](#map-like-interface-1) section.\r\n\r\n#### EnumWrapper.prototype.map\r\n\r\nBuilds and returns a new array containing the results of calling the provided `iteratee` function on every entry in the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.map<R>(\r\n    iteratee: EnumWrapper.Iteratee,\r\n    context?: any\r\n): R[]\r\n```\r\n\r\n-   `R`: Generic type param that indicates the type of entries in the resulting array. If not specified, then it will be inferred from the return type of `iteratee`.\r\n-   `iteratee`: See [EnumWrapper.Iteratee](#enumwraperriteratee).\r\n-   `context`: If provided, then the value will be used as the `this` context when executing `iteratee`.\r\n\r\n### Get Arrays of Enum Data\r\n\r\n#### EnumWrapper.prototype.getKeys\r\n\r\nReturns an array of all keys in the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.getKeys(): KeyType[]\r\n```\r\n\r\n#### EnumWrapper.prototype.getValues\r\n\r\nReturns an array of all values in the enum. If the enum contains any duplicate values, then so will the returned array.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.getValues(): EnumType[]\r\n```\r\n\r\n#### EnumWrapper.prototype.getEntries\r\n\r\nReturns a list of `[key, value]` tuples representing all entries in the enum.\r\n\r\nSee [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) for details about the ordering.\r\n\r\n```ts\r\nEnumWrapper.prototype.getEntries(): EnumWrapper.Entry[]\r\n```\r\n\r\n### Key Validation/Typecasting\r\n\r\n#### EnumWrapper.prototype.isKey\r\n\r\nReturns `true` if the provided `key` is a valid key for the enum.\r\n\r\nAlso acts as a type guard to tell the compiler that the provided `key` is the more specific `KeyType` type.\r\n\r\n```ts\r\nEnumWrapper.prototype.isKey(\r\n    key: string | null | undefined\r\n): key is KeyType\r\n```\r\n\r\n#### EnumWrapper.prototype.asKeyOrThrow\r\n\r\nIf the provided `key` is a valid key for the enum, then the `key` is returned, but cast to the more specific `KeyType` type.\r\n\r\nIf the provided `key` is NOT valid, then an `Error` is thrown.\r\n\r\n```ts\r\nEnumWrapper.prototype.asKeyOrThrow(\r\n    key: string | null | undefined\r\n): KeyType\r\n```\r\n\r\n#### EnumWrapper.prototype.asKeyOrDefault\r\n\r\nIf the provided `key` is a valid key for the enum, then the `key` is returned, but cast to the more specific `KeyType` type.\r\n\r\nIf the provided `key` is NOT valid, then `defaultKey` is returned.\r\n\r\nThis method is overloaded so that its return type is as specific as possible, depending on the type of the `defaultKey` param.\r\n\r\n```ts\r\nEnumWrapper.prototype.asKeyOrDefault(\r\n    key: string | null | undefined,\r\n    defaultKey?: KeyType | string\r\n): KeyType | string | undefined\r\n```\r\n\r\n### Value Validation/Typecasting\r\n\r\n#### EnumWrapper.prototype.isValue\r\n\r\nReturns `true` if the provided `value` is a valid value for the enum.\r\n\r\nAlso acts as a type guard to tell the compiler that the provided `value` is the more specific `EnumType` type.\r\n\r\n```ts\r\nEnumWrapper.prototype.isValue(\r\n    value: ValueType | null | undefined\r\n): key is EnumType\r\n```\r\n\r\n#### EnumWrapper.prototype.asValueOrThrow\r\n\r\nIf the provided `value` is a valid value for the enum, then the `value` is returned, but cast to the more specific `EnumType` type.\r\n\r\nIf the provided `value` is NOT valid, then an `Error` is thrown.\r\n\r\n```ts\r\nEnumWrapper.prototype.asValueOrThrow(\r\n    value: ValueType | null | undefined\r\n): EnumType\r\n```\r\n\r\n#### EnumWrapper.prototype.asValueOrDefault\r\n\r\nIf the provided `value` is a valid value for the enum, then the `value` is returned, but cast to the more specific `EnumType` type.\r\n\r\nIf the provided `value` is NOT valid, then `defaultValue` is returned.\r\n\r\nThis method is overloaded so that its return type is as specific as possible, depending on the type of the `defaultValue` param.\r\n\r\n```ts\r\nEnumWrapper.prototype.asValueOrDefault(\r\n    value: ValueType | null | undefined,\r\n    defaultValue?: EnumType | ValueType\r\n): EnumType | ValueType | undefined\r\n```\r\n\r\n### Lookup Key by Value\r\n\r\n#### EnumWrapper.prototype.getKeyOrThrow\r\n\r\nPerforms a reverse lookup to get the key that corresponds to the provided `value`.\r\n\r\nIf the enum has duplicate values matching the provided `value`, then the key for the last duplicate entry (in order specified by the [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) section) is returned.\r\n\r\nIf the provided `value` is NOT valid, then an `Error` is thrown.\r\n\r\n```ts\r\nEnumWrapper.prototype.getKeyOrThrow(\r\n    value: ValueType | null | undefined\r\n): KeyType\r\n```\r\n\r\n#### EnumWrapper.prototype.getKeyOrDefault\r\n\r\nPerforms a reverse lookup to get the key that corresponds to the provided `value`.\r\n\r\nIf the enum has duplicate values matching the provided `value`, then the key for the last duplicate entry (in order specified by the [Guaranteed Order of Iteration](#guaranteed-order-of-iteration) section) is returned.\r\n\r\nIf the provided `value` is NOT valid, then `defaultKey` is returned.\r\n\r\nThis method is overloaded so that its return type is as specific as possible, depending on the type of the `defaultKey` param.\r\n\r\n```ts\r\nEnumWrapper.prototype.getKeyOrDefault(\r\n    value: ValueType | null | undefined,\r\n    defaultKey?: KeyType | string\r\n): KeyType | string | undefined\r\n```\r\n\r\n### Lookup Value by Key\r\n\r\n#### EnumWrapper.prototype.getValueOrThrow\r\n\r\nReturns the value corresponding to the provided `key`.\r\n\r\nIf the provided `key` is NOT valid, then an `Error` is thrown.\r\n\r\n```ts\r\nEnumWrapper.prototype.getValueOrThrow(\r\n    key: string | null | undefined\r\n): EnumType\r\n```\r\n\r\n#### EnumWrapper.prototype.getValueOrDefault\r\n\r\nReturns the value corresponding to the provided `key`.\r\n\r\nIf the provided `key` is NOT valid, then `defaultValue` is returned.\r\n\r\nThis method is overloaded so that its return type is as specific as possible, depending on the type of the `defaultValue` param.\r\n\r\n```ts\r\nEnumWrapper.prototype.getValueOrDefault(\r\n    key: string | null | undefined,\r\n    defaultValue?: EnumType | ValueType\r\n): EnumType | ValueType | undefined\r\n```\r\n","readmeFilename":"README.md","_id":"ts-enum-util@4.0.0-alpha.20190310","_npmVersion":"6.4.0","_nodeVersion":"8.9.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-/GB4rfPk6djSmP3s6c2wy/Hc5g/Egr2LtxwluMtKuRbl/HfjJmkAo+zyiseU6LctGMR4Dq4iT99OIV+iFr5bhw==","shasum":"720bd8c75b50f86ded99c03353d39523c81be3ce","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-4.0.0-alpha.20190310.tgz","fileCount":101,"unpackedSize":249287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJchc6qCRA9TVsSAnZWagAAwoMP/3nhR81endAPcNzKBv1Y\nD0OBLEAyph+hg/bBGg1t+kzW4e2VHIOI67bVI1ERxhbBNaYr+jq7MZrdpOcG\nKtJyxIvZrnyRm5ElExf7g+retTfcci7OW0+QfvfdBouFdY4DuY+xy+KwUXm7\n1bTB07gx7z5WZyQwXDEGZhAInFFd88ff7lfrUoVIY4UGpfFf/JDuUj9auKAT\nF2JTXX+DxVDHXt1JBV9Qt4Og6+J1OEeUYMdWxrIXc6G3oBro9MhfztQbF2H0\ncu2wlyTNJ5aPfAmoevBBprV2mW+1DNOm4XqXZ1mq6QBH0zy0EmeyFnx+6h9K\ni/2ggDCB73M6BbAyZDwD95iHxv+JMAvLaSZsCbUx4zZ8ds3Cvy15EUyUAkBC\ndOtpo6FAdC2Q1OoWdN99KYTw+Ra+qN5yNplLnVNRStNKsVSzHL1Ku1Hh5FF5\nvOc3piTfe+i1FG0/bO76paqvWzDbK49l7RU28VnlHJ/whTYzIBcQtfrha8I/\nqoi+/HxHVDHVUkDtSikx3lv2YrdW0IXDq95WADbzahYQINhLDJeMn6PR74DK\nAUnQ9ZwSSlq1aQsoBUYokq0JzPAPCPh1uucKEmr9hNeXAGP9Q/iHLkG5jaNj\nAzwgbB1kiq35sMcbujNf9apLYOw8QLuk4pNaC5Bm90kOdHesCLAZo6GIBFv8\nn/or\r\n=mrdM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAnfAmPmYQS6EZljomN8h4uGk7GWAkXSnc/KRjzblUDKAiBqZlvAqkRp31DBJJyPpbYvTOBbMjb9cfSIbzlZ8PyIJQ=="}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_4.0.0-alpha.20190310_1552273065547_0.7525982247806782"},"_hasShrinkwrap":false},"4.0.0":{"name":"ts-enum-util","version":"4.0.0","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","prettier:test":"prettier --list-different \"{src,tests,type_tests}/**/*.ts\"","prettier:fix":"prettier --write \"{src,tests,type_tests}/**/*.ts\"","build:types":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --emitDeclarationOnly true --declarationMap true --outDir dist/types","build:commonjs":"tsc --project src/tsconfig.json --pretty --removeComments --noErrorTruncation --declaration false --outDir dist/commonjs","build:es":"tsc --project src/tsconfig.json --pretty --removeComments --noErrorTruncation --declaration false -m es6 --outDir dist/es","build":"npm run clean:dist && run-p build:types build:es build:commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest","jest:coverage":"npm run clean:coverage && jest --coverage","dtslint:v2_9_plus":"dtslint type_tests/v2_9_plus","dtslint":"run-s clean:dist build:types dtslint:v2_9_plus","test":"run-s compile prettier:test lint dtslint jest","test:coverage":"run-s compile prettier:test lint dtslint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"24.0.9","@types/node":"10.12.18","coveralls":"3.0.3","dtslint":"0.5.3","jest":"24.1.0","npm-run-all":"4.1.5","prettier":"1.16.4","rimraf":"2.6.3","ts-jest":"24.0.0","tslint":"5.13.1","tslint-config-prettier":"1.18.0","typescript":"3.3.3333"},"peerDependencies":{"typescript":">= 2.9.1"},"keywords":["typescript","string","number","literal","union","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"022b8122a0cf5a9887741910be54b20ac9267830","_id":"ts-enum-util@4.0.0","_npmVersion":"6.4.0","_nodeVersion":"10.15.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-3z49qxV6AhPkbNC1HVcER/3sgn8T8ty9wSdLRzX761U2lQG0Hf4slSw/+UMy9Bd42umxHOTAwklHA4dovh7Bqg==","shasum":"7e1a1fcbbec1bcefb0c1f972ca015777cecec227","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-4.0.0.tgz","fileCount":101,"unpackedSize":226906,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJclHNcCRA9TVsSAnZWagAA29EP/A3B+9TfXv6O02E5ZMq6\n8yfUXoq3SrIeKWDNWoEbtqyYYkgdC4BmfPQaHk2UIpkW+jDBLTh8nynY6CC5\nTsacpOBhhXgkkI192OoskQxngOh6s6DdyNjwAuSkOn1K3wabEp2cTiBPn3v/\nV/dW2rGd5tLSnEIBaVwQqwZGK+UBflvvRprbaYMXugx3mYGC7Y9543q4HHEW\nY+skxJe/oJqcLPXoXwegK/vlHFMgRvFmanukt3aukR3QtOf0UwmHPECNAMnn\n3+TYZYNwWbJOVcZROHNs81duYFo9y8QUf4qbH1N7pITg7kS3WTm3YyoqCjOQ\nRwbfXBweobL+Ao4DdDAJj+3zOI+43jp9m5dSTkb2rZ1rj2lVo/gRnzmRxtg5\nn+sDB8hWrF21TEDoVq0VJX5fxYRgg5SXnc5eujDySSb9N7XgZKnO5/Mdo5WF\nteoEhZTdoLpFHshKOUnJ4GtxStnGwud10GvukgqGRg0sDH58oF6g9vS3RXRA\nTG+mA0dd3v1Uh96OESTlKwKd7nqhJJX7REiAQ28Ycypxg5iIg4lneg3iOaFk\n38E0S5Jj270JbtOaeWKTAONzVn66YN6aHa6cd5D+etRFY9zPRidYGpcbJUxL\nNTx7JcZ7tKrR6McA6qszFgpzlc8ipcczNz2PvkD37OACLgyJUIunBppiSaQH\nz9iY\r\n=OV07\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7QhYirYLLJaR0xXmCVCgufhPk/Z/Odf/WhiiCi6QryQIhAK4sSJ0LwCoFo3Hf5YvIpvpblSvJyWIxrJog6akYYpRn"}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_4.0.0_1553232730330_0.22981914017553584"},"_hasShrinkwrap":false},"4.0.1":{"name":"ts-enum-util","version":"4.0.1","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","prettier:test":"prettier --list-different \"{src,tests,type_tests}/**/*.ts\"","prettier:fix":"prettier --write \"{src,tests,type_tests}/**/*.ts\"","build:types":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --emitDeclarationOnly true --declarationMap true --outDir dist/types","build:commonjs":"tsc --project src/tsconfig.json --pretty --removeComments --noErrorTruncation --declaration false --outDir dist/commonjs","build:es":"tsc --project src/tsconfig.json --pretty --removeComments --noErrorTruncation --declaration false -m es6 --outDir dist/es","build":"npm run clean:dist && run-p build:types build:es build:commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest","jest:coverage":"npm run clean:coverage && jest --coverage","dtslint:v2_9_plus":"dtslint type_tests/v2_9_plus","dtslint":"run-s clean:dist build:types dtslint:v2_9_plus","test":"run-s compile prettier:test lint dtslint jest","test:coverage":"run-s compile prettier:test lint dtslint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"24.0.9","@types/node":"10.12.18","coveralls":"3.0.3","dtslint":"0.5.3","jest":"24.1.0","npm-run-all":"4.1.5","prettier":"1.16.4","rimraf":"2.6.3","ts-jest":"24.0.0","tslint":"5.13.1","tslint-config-prettier":"1.18.0","typescript":"3.3.3333"},"peerDependencies":{"typescript":">= 2.9.1"},"keywords":["typescript","string","number","literal","union","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"4a47bcf4e766e9224771f35674c6a7b0e7894e95","_id":"ts-enum-util@4.0.1","_npmVersion":"6.4.0","_nodeVersion":"10.15.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-ipCgRzaCp8jK8Ug/ePNvf2+YkW2qBNEKCeJu4sTsNL2/Vgzf6EqOIe8xNhUqK50e16ID9ShHYnAZo//jaKdZxA==","shasum":"22762b841ccac8c07ca1c0ebd5e53b28418727ae","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-4.0.1.tgz","fileCount":94,"unpackedSize":210801,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcwRiCCRA9TVsSAnZWagAA+acQAKTAD98EKZ0jaUaNcOfS\n4+kNPr8UXs76Qg2e1Xtnf+fC/OYOJKO4MrthsaiiBaHsoZU9RIFWG3nJJR6u\n7jfSaPA5nG/1ZNI6MLFwsW9RqbQKr4rH+Gj+0TumoluleiF5WCPi7Z19Zj/s\n3kMYr1dnNVT0hHmJ8P4v2j4UW4oPm5Io/ZjqerLA3QhoF2DTVCFlA7mO1TcD\nAPCtYsgpH3Ai4xbz11lDElVbiQDvjspwtE1bohO9o/PkYTLY1qjHARLX9UK5\nxHKQCWcq7k/ECQ6qFIJBACle358OJAmCYqD8NGcu8d1Q4G7Ul/e/xfGdm5/s\n1uqCH+BUltdex8oN7CPCZkPYk9EWq4SeFBhpNVJLN4hB9J5VahnvZHPcDX+G\nA2M/NPgsIhrOsJgG7W90VcPoUmC7msGZjwNDt1D8AbTdvzIwzeJ7GB4svSaa\nvIK1lq+ZcfBo/iL7v+l5+c5JPs9URiw6DU7u8SlbfS6ETYV//mNkGiENRMLl\nTWItgBm4ybGvVIKO/F3doF148ZX09pquQgOBCz+pKpPhXIiLGSPJMLg8tIOE\n6iRXM2yYERwW/u2L99fvFrA+qrpY9FdzL/OgENo/Qub3N2fqd7l43U/HupV5\nFuvNnjP5XZRZU+1Vxea+C0zW7ThaczbMScciSIQbLvVnz++MrcK38Umno2m9\ntw1i\r\n=jwcW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9TqFhKK/1E2bk314pY1Qr76DvQxfj4v4A/7+hNpptdQIhAMNS6RD0RVhyke53JR0ukJgYJSEOMb0wlG5jjtY0pi/c"}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_4.0.1_1556158593636_0.5478840146597199"},"_hasShrinkwrap":false},"5.0.0-beta.0":{"name":"ts-enum-util","version":"5.0.0-beta.0","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","prettier:test":"prettier --list-different \"{src,tests,type_tests}/**/*.ts\"","prettier:fix":"prettier --write \"{src,tests,type_tests}/**/*.ts\"","build:types":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --emitDeclarationOnly true --declarationMap true --outDir dist/types","build:commonjs":"tsc --project src/tsconfig.json --pretty --removeComments --noErrorTruncation --declaration false --outDir dist/commonjs","build:es":"tsc --project src/tsconfig.json --pretty --removeComments --noErrorTruncation --declaration false -m es6 --outDir dist/es","build":"npm run clean:dist && run-p build:types build:es build:commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest","jest:coverage":"npm run clean:coverage && jest --coverage","dtslint:v2_9_plus":"dtslint --expectOnly type_tests/v2_9_plus","dtslint:v3_2_plus":"dtslint --expectOnly type_tests/v3_2_plus","dtslint:v3_7_plus":"dtslint --expectOnly type_tests/v3_7_plus","dtslint:all":"run-s dtslint:v2_9_plus dtslint:v3_2_plus dtslint:v3_7_plus","dtslint":"run-s clean:dist build:types dtslint:all","test":"run-s compile prettier:test lint dtslint jest","test:coverage":"run-s compile prettier:test lint dtslint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"24.0.23","coveralls":"3.0.9","dtslint":"2.0.2","jest":"24.9.0","npm-run-all":"4.1.5","prettier":"1.19.1","rimraf":"3.0.0","ts-jest":"24.2.0","tslint":"5.20.1","tslint-config-prettier":"1.18.0","typescript":"3.7.2"},"peerDependencies":{"typescript":">= 2.9.1"},"keywords":["typescript","string","number","literal","union","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"5352ac90041249ffc434327703104cf403f7edb7","readme":"[![npm version](https://img.shields.io/npm/v/ts-enum-util.svg)](https://www.npmjs.com/package/ts-enum-util)\r\n[![Join the chat at https://gitter.im/ts-enum-util/Lobby](https://badges.gitter.im/ts-enum-util/Lobby.svg)](https://gitter.im/ts-enum-util/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\r\n[![Build Status](https://travis-ci.org/UselessPickles/ts-enum-util.svg?branch=master)](https://travis-ci.org/UselessPickles/ts-enum-util)\r\n[![Coverage Status](https://coveralls.io/repos/github/UselessPickles/ts-enum-util/badge.svg?branch=master)](https://coveralls.io/github/UselessPickles/ts-enum-util?branch=master)\r\n\r\n# ts-enum-util\r\n\r\nStrictly typed utilities for working with TypeScript enums (and string/number literal union types).\r\n\r\nNOTE: Be sure to read about supported TypeScript versions in the [Requirements](#requirements) section.\r\n\r\n# Contents\r\n\r\n<!-- TOC depthFrom:2 -->\r\n\r\n-   [What is it?](#what-is-it)\r\n    -   [Enum Wrapper Utilities](#enum-wrapper-utilities)\r\n    -   [Enum Value Visitor/Mapper](#enum-value-visitormapper)\r\n-   [Installation](#installation)\r\n-   [Getting Started](#getting-started)\r\n-   [Usage Documentation/Examples](#usage-documentationexamples)\r\n-   [Requirements](#requirements)\r\n-   [Why is the main export named `$enum`?](#why-is-the-main-export-named-enum)\r\n\r\n<!-- /TOC -->\r\n\r\n## What is it?\r\n\r\n`ts-enum-util` provides type-safe utilities to improve the usefulness of TypeScript enums.\r\nThere are two major and distinct aspects to `ts-enum-util`.\r\n\r\n### Enum Wrapper Utilities\r\n\r\nA wrapper around an enum, or \"enum-like object\", that provides a variety of type-safe\r\nutilities in terms of the run-time representation fo the enum's keys/values. Some\r\nexamples include:\r\n\r\n-   Get a list of an enum's keys, values, or key/value pairs.\r\n-   Look up values by key with run-time key validation and optional result defaulting.\r\n-   Reverse lookup of keys by value (for string enums too!) with run-time value validation and optional result defaulting.\r\n-   Run-time validation that a specified value or key is valid for a given enum, with compile-time type guards.\r\n-   Treat an enum similar to an Array of key/value tuples.\r\n-   Treat an enum similar to a Map of values.\r\n\r\nAll of these utilities are very specifically typed for each enum via generics and type inference.\r\n\r\n### Enum Value Visitor/Mapper\r\n\r\nA visitor pattern for processing a single value whose type is an enum, or union of\r\nstring/number literals. It's like a switch statement that forces you to implement\r\nevery possible case (including `null` or `undefined`, if relevant), avoiding bugs\r\nbecause you forgot to handle one of the enum's values, or because the enum\r\ndefinition was updated with a new value and you forgot to update existing code to\r\nhandle the new value.\r\n\r\nThe more generalized \"visit\" functionallity has you associate a different function\r\nwith each possible value of an enum or string/number literal union.\r\nThe appropriate function is executed (and its return value returned) based on\r\nwhich value the argument is at run-time.\r\n\r\nA streamlined \"map\" functionality has you simply associate values (of any type)\r\nwith each possible value of an enum or string/number literal union.\r\nThe appropriate mapped value is returned based on which value the argument is at run-time.\r\n\r\n## Installation\r\n\r\nInstall via [NPM](https://www.npmjs.com/package/ts-enum-util):\r\n\r\n```\r\nnpm i -s ts-enum-util\r\n```\r\n\r\n## Getting Started\r\n\r\nImport `$enum`:\r\n\r\n```ts\r\nimport { $enum } from \"ts-enum-util\";\r\n```\r\n\r\nDefine an `enum`:\r\n\r\n```ts\r\nenum Color {\r\n    R,\r\n    G,\r\n    B\r\n}\r\n```\r\n\r\nUse `$enum()` as a function to access [Enum Wrapper Utilities](./docs/EnumWrapper.md) for your `enum`:\r\n\r\n```ts\r\n// type of \"values\": Color[]\r\n// value of \"values\": [0, 1, 2]\r\nconst values = $enum(Color).getValues();\r\n```\r\n\r\nUse `$enum.visitValue()` or `$enum.mapValue()` to access [Enum Value Visitor/Mapper](./docs/EnumValueVisitor.md) functionality:\r\n\r\n```ts\r\nfunction doColorAction(color: Color): void {\r\n    $enum.visitValue(color).with({\r\n        [Color.R]: () => {\r\n            window.alert(\"Red Alert!\");\r\n        },\r\n        [Color.G]: () => {\r\n            window.location = \"http://google.com\";\r\n        },\r\n        [Color.B]: () => {\r\n            console.log(\"Blue\");\r\n        }\r\n    });\r\n}\r\n\r\nfunction getColorLabel(color: Color | undefined): string {\r\n    return $enum.mapValue(color).with({\r\n        [Color.R]: \"Red\",\r\n        [Color.G]: \"Green\",\r\n        [Color.B]: \"Blue\",\r\n        [$enum.handleUndefined]: \"Unspecified\"\r\n    });\r\n}\r\n```\r\n\r\n## Usage Documentation/Examples\r\n\r\nTo keep the size of the README under control, usage documentation and examples have\r\nbeen split out to separate files:\r\n\r\n-   [Enum Wrapper Utilities](./docs/EnumWrapper.md)\r\n-   [Enum Value Visitor/Mapper](./docs/EnumValueVisitor.md)\r\n    -   [Migration Guide: from `ts-string-visitor`](./docs/migration_from_ts-string-visitor.md)\r\n\r\n## Requirements\r\n\r\n-   _TypeScript 2.9+_: `ts-enum-util` is all about strictly type-safe utilities\r\n    around TypeScript enums, so it would be much less useful in a plain JavaScript\r\n    project. More specifically, TypeScript 2.9 included advancements in handling\r\n    number literals as property names of object types, which is necessary for\r\n    implementing some `ts-enum-util` functionality consistently for both string and\r\n    number enum types.\r\n    -   _Stuck with an older version of TypeScript_?\r\n        -   For Value Visitor/Mapper functionality, check out `ts-string-visitor`\r\n            ([npm](https://www.npmjs.com/package/ts-string-visitor),\r\n            [github](https://github.com/UselessPickles/ts-string-visitor)). NOTE:\r\n            numeric value visiting/mapping not supported!\r\n        -   For Enum Wrapper\r\n            functionality, check out v3 or v2 of `ts-enum-util`.\r\n-   _ES6 Features_: The following ES6 features are used by `ts-enum-util`, so they\r\n    must exist (either natively or via polyfill) in the run-time environment:\r\n    -   `WeakMap`\r\n    -   `Symbol`\r\n    -   `Symbol.iterator`\r\n    -   `Symbol.toStringTag`\r\n\r\n## Why is the main export named `$enum`?\r\n\r\nI wanted something short, simple, and easy to remember that was unlikely to conflict with anything else so that no one would have to alias it when importing it. By exporting a clear, memorable, and uniquely named \"thing\", this allows you to simply start writing code that uses `$enum` and most IDEs can take care of inserting the import { \\$enum } from \"ts-enum-util\"; for you (either automatically, or with a quick keyboard shortcut).\r\n\r\nI ended up using inspiration from the naming of jquery's `$()` function. Many javascript developers are familiar with jquery, and the fact that `$()` gives you a wrapper around a raw DOM element to expose additional/simplified functionality around the DOM element.\r\n\r\nSimilarly, `$enum()` gives you a wrapper around a raw enum to expose additional/simplified functionality around the enum.\r\n","readmeFilename":"README.md","_id":"ts-enum-util@5.0.0-beta.0","_npmVersion":"6.4.0","_nodeVersion":"10.15.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-KRkHm16qWojW7jYDHUGuWHni9rafjU/3x7Scks/xYLeA4D5KOlAXE30HU6XmkL09/m3ZRcM8Bnrehvx3BKSQgg==","shasum":"808ca322046d6900e816fee544f884f5434d3e64","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-5.0.0-beta.0.tgz","fileCount":101,"unpackedSize":215581,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3gXaCRA9TVsSAnZWagAAQvIP/3E/UsT9/yBqGrDjmCxG\nP81zFrMRJmvNJrTgr26ZPZ3OfcTLUktTgcnSv1Tx30CeokkqayzB3Foh392X\njokVD4SfO+v3k2ZzODTayAFFxxkH76Rc/zOGOp6LelT2W9mR4ZOIWak4oOGd\na56Rc+Oovts07W1p9ZJXcxHm+2B5ueth6NQysGnKCStKhM+wOpRL019T/BoF\neGiDUWIN7M5G3fyAnWuLCCpf4BXCmuj4xzgnPzFXS5K7sYHPC31A1i0LPHT3\nTaOaawvz6EDBXzUZI5tNBP9QJpEo8E6afOCxHMMrXC5c33lr3K733NFhk9Z8\nHw3qMEKahaPriHcwQ+tajV8LADOUAKUtuD8b1NOP1Ap1IVgt21Tn7X3yiyhf\ni70knF8RmioOQ39mdnHyd+weWAhr2uJqTRKt9HrSg/CluoEAhpv9Zmvwk69b\nrqgCqoGj1xOKh7q/1YpNpgr2RiDjKogZEYM9merJ7rH3ertSDgrQCcMIE0bh\n74fytKsXDztoO5kjt4QCd0btrpRFOucZIfP2Ds7EwDm2If5Qhn8xWPdDjQAR\ndl6mQo/TLtcJ8GpWPo89+Arvki0gTdOYlNHOTCARRBmh27ULY/eeWEeZZf4Y\nj4a8u2rRbQVG6NZUTds24pG7+CBJXCr/JCBVjpe39giGupS6MkuAzPMsO2Id\nOTSx\r\n=VgLZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9h8qrLRC20dJJESwDbkvQHiWXTbEk3MwGkDU3f11OHgIhAMBPcCsAr732HcPI5sPu7dTXtZRbMAGHm5Cfks1GrZ4E"}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_5.0.0-beta.0_1574831578197_0.9087861981790111"},"_hasShrinkwrap":false},"4.0.2":{"name":"ts-enum-util","version":"4.0.2","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","prettier:test":"prettier --list-different \"{src,tests,type_tests}/**/*.ts\"","prettier:fix":"prettier --write \"{src,tests,type_tests}/**/*.ts\"","build:types":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --emitDeclarationOnly true --declarationMap true --outDir dist/types","build:commonjs":"tsc --project src/tsconfig.json --pretty --removeComments --noErrorTruncation --declaration false --outDir dist/commonjs","build:es":"tsc --project src/tsconfig.json --pretty --removeComments --noErrorTruncation --declaration false -m es6 --outDir dist/es","build":"npm run clean:dist && run-p build:types build:es build:commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest","jest:coverage":"npm run clean:coverage && jest --coverage","dtslint:v2_9_plus":"dtslint --expectOnly type_tests/v2_9_plus","dtslint":"run-s clean:dist build:types dtslint:v2_9_plus","test":"run-s compile prettier:test lint dtslint jest","test:coverage":"run-s compile prettier:test lint dtslint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"24.0.23","coveralls":"3.0.9","dtslint":"2.0.2","jest":"24.9.0","npm-run-all":"4.1.5","prettier":"1.19.1","rimraf":"3.0.0","ts-jest":"24.2.0","tslint":"5.20.1","tslint-config-prettier":"1.18.0","typescript":"3.7.2"},"keywords":["typescript","string","number","literal","union","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"e49717abb08322249919f02a4424365095715d2d","_id":"ts-enum-util@4.0.2","_npmVersion":"6.4.0","_nodeVersion":"10.15.3","_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"dist":{"integrity":"sha512-BB5qjvHYgYgOB/CaoA1Cy/B2QNnZ+nVBrJ15VV/AXGWx+AO83k5wgeLOJvkSLoKKavvH/M8Wj4ZbgROjsuYwzw==","shasum":"2587a6fa8e8629f3715009e5090d52df9456f7e2","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-4.0.2.tgz","fileCount":94,"unpackedSize":211772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2v4FCRA9TVsSAnZWagAAiOgP/0o1uhQw4vXwh3ZBXJu6\nsPS1HxUczlQ0imPbHrE6vqCfGSUQWRkN4LI7eDaFdxJwhGcsKFZ3bkUOui0j\nzhifG2KkLslvEmG0LL7r17pMatBCfRCFhbVWkIiB0ruka4sjK15HPPAn22CR\nSVSPkjWNLg0xSEZ1qlCAeo4P2VROIuUfMnTF7vGViv1heM4/K5SbknSv+SUa\n9Sl+SC8T/JCVteNiIxM+/9llDBWa5/7ScupQDq1VRkddmYfg2HtnZqO55W/0\nEceX3xLzrswxtmfYVUBYyaXE9l/zcWdPQriEHv2b0kQhT63MpixQP/nYXKWR\nZiFeITQ1RJyhBbOQRePd+6JF70rgkt/UG/I2wDXzqY9R9qtBtcgifS2Gr4nh\n+0IJKbJHpzs4v6j32oZPXQw3na3uYBakFa2B15xZ9G8nDlA5xcdQn7FbJlp6\n86hThPwam9tNXzmYyygUVyNdROnisnAZOPrQZZMoI74A+qoKJKc285JpgNZn\nb2+e9gWdR/ZeEYb9HAr3dmuyeroiSiQWXT+crkWTfjL4lsJk/AQB+B2fFVar\n8KBKBecuuQxdoedNJ/pzsZDRE8ery/7EX7fW9CYk48Dv9AsVE2CDEFFsrV/E\nTWaH5i73a8arHDxaM8HHqgJsDwJSvIs8wWftG5BqJSaAiF0dFWYAFlXR0gOz\n+nrY\r\n=9S9S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD21vHrNbp1l5HKiCpPTcijhXe+OkOR7JEYKnz3aqdUlQIhAI34o0WJu3l8B3ChyUhuU08i5HZRebrl8z+2uDAPuNFM"}]},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_4.0.2_1591410181012_0.34516206236851676"},"_hasShrinkwrap":false},"4.1.0":{"name":"ts-enum-util","version":"4.1.0","description":"TypeScript Enum Utilities","repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"homepage":"https://github.com/UselessPickles/ts-enum-util","bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"main":"dist/commonjs/index.js","jsnext:main":"dist/es/index.js","module":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage","clean:pack":"rimraf ts-enum-util-*.tgz","compile":"tsc --project tsconfig.json --noEmit --pretty --noErrorTruncation","lint":"tslint --config tslint.json --project tsconfig.json","lint:fix":"npm run lint -- --fix","prettier:test":"prettier --list-different \"{src,tests,type_tests}/**/*.ts\"","prettier:fix":"prettier --write \"{src,tests,type_tests}/**/*.ts\"","build:types":"tsc --project src/tsconfig.json --pretty --noErrorTruncation --emitDeclarationOnly true --declarationMap true --outDir dist/types","build:commonjs":"tsc --project src/tsconfig.json --pretty --removeComments --noErrorTruncation --declaration false --outDir dist/commonjs","build:es":"tsc --project src/tsconfig.json --pretty --removeComments --noErrorTruncation --declaration false -m es6 --outDir dist/es","build":"npm run clean:dist && run-p build:types build:es build:commonjs","pack":"run-p clean:pack build && npm pack","jest":"jest","jest:coverage":"npm run clean:coverage && jest --coverage","dtslint:v2_9_plus":"dtslint --expectOnly --localTs node_modules/typescript/lib type_tests/v2_9_plus","dtslint":"run-s clean:dist build:types dtslint:v2_9_plus","test":"run-s compile prettier:test lint dtslint jest","test:coverage":"run-s compile prettier:test lint dtslint jest:coverage","build:travis":"run-p test:coverage build && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"license":"MIT","devDependencies":{"@types/jest":"26.0.18","coveralls":"3.1.0","dtslint":"4.0.7","jest":"26.6.3","npm-run-all":"4.1.5","prettier":"1.19.1","rimraf":"3.0.2","ts-jest":"26.4.4","tslint":"5.20.1","tslint-config-prettier":"1.18.0","typescript":"4.1.2"},"keywords":["typescript","string","number","literal","union","enum","util"],"jest":{"cacheDirectory":"./jest_cache","transform":{"^.+\\.ts$":"ts-jest"},"collectCoverageFrom":["src/**/*.{js,ts}","!**/node_modules/**"],"coverageReporters":["text","lcov"],"testRegex":"((\\.|/)(test|spec))\\.(ts|js)$","moduleFileExtensions":["ts","js"]},"gitHead":"98a99655ab2a0077b4630e3dac47a903d3e92c6c","_id":"ts-enum-util@4.1.0","_nodeVersion":"14.15.1","_npmVersion":"7.0.14","dist":{"integrity":"sha512-kIs48itmNehkzLk0YJW/LfI2+VFYlyscGsY+oDNCnxrDfkex/OfYUV1ip7L7YIN7ppSqj2VmOOssiW81Rno9QA==","shasum":"d9d87f730a5c0bf72bad409e3ac431a9b0b6a878","tarball":"https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-4.1.0.tgz","fileCount":94,"unpackedSize":215614,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXaswjHh7yu9ohonWmsXd7N0SeuRZ/KIQC3hC9cebo2gIgaXStUJzEBn6jxAVffbo9dweOOmeHFJ8fcy2UZ6J53jM="}]},"_npmUser":{"name":"uselesspickles","email":"jlau@uselesspickles.com"},"directories":{},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-enum-util_4.1.0_1712956028669_0.03479687289726652"},"_hasShrinkwrap":false}},"time":{"created":"2018-02-15T05:25:10.436Z","0.0.1":"2018-02-15T05:25:11.185Z","modified":"2024-04-12T21:07:09.008Z","0.0.2":"2018-02-16T05:20:29.418Z","0.0.3":"2018-02-16T06:14:28.469Z","0.0.4":"2018-02-16T17:45:43.474Z","0.0.5":"2018-02-16T19:19:09.939Z","0.0.6":"2018-02-17T06:50:32.398Z","0.0.7":"2018-02-17T08:00:47.184Z","0.0.8":"2018-02-17T16:59:35.037Z","0.0.9":"2018-02-18T17:26:05.852Z","0.0.10":"2018-02-18T17:46:53.895Z","0.0.11":"2018-02-19T00:52:56.268Z","0.0.12":"2018-02-19T01:04:42.451Z","0.0.13":"2018-02-19T01:38:28.709Z","0.1.0":"2018-02-19T05:34:28.985Z","0.2.0":"2018-02-20T04:07:55.373Z","0.2.1":"2018-02-21T07:12:58.230Z","0.2.2":"2018-02-21T07:15:38.323Z","1.0.0":"2018-02-21T23:22:09.647Z","2.0.0":"2018-02-24T04:51:55.754Z","2.0.1":"2018-03-07T06:41:59.230Z","2.0.2":"2018-03-10T05:45:33.071Z","2.0.3":"2018-06-01T00:44:02.415Z","3.0.0":"2018-06-01T01:48:57.491Z","3.0.1":"2018-06-01T02:04:36.199Z","3.0.2":"2018-06-01T02:38:15.841Z","3.0.3":"2018-06-02T14:59:11.536Z","3.0.4":"2018-06-03T03:18:33.854Z","2.0.4":"2018-06-03T03:58:30.109Z","2.0.5":"2018-06-06T03:36:21.879Z","3.0.5":"2018-06-06T03:41:20.477Z","3.0.6":"2018-06-07T04:32:47.190Z","2.1.0":"2018-06-26T04:32:10.971Z","3.1.0":"2018-06-26T04:36:49.093Z","4.0.0-alpha.20181015":"2018-10-16T03:32:40.920Z","4.0.0-alpha.20190310":"2019-03-11T02:57:45.667Z","4.0.0":"2019-03-22T05:32:10.533Z","4.0.1":"2019-04-25T02:16:33.764Z","5.0.0-beta.0":"2019-11-27T05:12:58.423Z","4.0.2":"2020-06-06T02:23:01.148Z","4.1.0":"2024-04-12T21:07:08.837Z"},"maintainers":[{"name":"uselesspickles","email":"jlau@uselesspickles.com"}],"description":"TypeScript Enum Utilities","homepage":"https://github.com/UselessPickles/ts-enum-util","keywords":["typescript","string","number","literal","union","enum","util"],"repository":{"type":"git","url":"git+https://github.com/UselessPickles/ts-enum-util.git"},"author":{"name":"Jeff Lau","email":"jlau@uselesspickles.com","url":"http://www.uselesspickles.com"},"bugs":{"url":"https://github.com/UselessPickles/ts-enum-util/issues"},"license":"MIT","readme":"[![npm version](https://img.shields.io/npm/v/ts-enum-util.svg)](https://www.npmjs.com/package/ts-enum-util)\r\n[![Join the chat at https://gitter.im/ts-enum-util/Lobby](https://badges.gitter.im/ts-enum-util/Lobby.svg)](https://gitter.im/ts-enum-util/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\r\n[![Build Status](https://travis-ci.org/UselessPickles/ts-enum-util.svg?branch=master)](https://travis-ci.org/UselessPickles/ts-enum-util)\r\n[![Coverage Status](https://coveralls.io/repos/github/UselessPickles/ts-enum-util/badge.svg?branch=master)](https://coveralls.io/github/UselessPickles/ts-enum-util?branch=master)\r\n\r\n# ts-enum-util\r\n\r\nStrictly typed utilities for working with TypeScript enums (and string/number literal union types).\r\n\r\nNOTE: Be sure to read about supported TypeScript versions in the [Requirements](#requirements) section.\r\n\r\n# Contents\r\n\r\n<!-- TOC depthFrom:2 -->\r\n\r\n-   [What is it?](#what-is-it)\r\n    -   [Enum Wrapper Utilities](#enum-wrapper-utilities)\r\n    -   [Enum Value Visitor/Mapper](#enum-value-visitormapper)\r\n-   [Installation](#installation)\r\n-   [Getting Started](#getting-started)\r\n-   [Usage Documentation/Examples](#usage-documentationexamples)\r\n-   [Requirements](#requirements)\r\n-   [Why is the main export named `$enum`?](#why-is-the-main-export-named-enum)\r\n\r\n<!-- /TOC -->\r\n\r\n## What is it?\r\n\r\n`ts-enum-util` provides type-safe utilities to improve the usefulness of TypeScript enums.\r\nThere are two major and distinct aspects to `ts-enum-util`.\r\n\r\n### Enum Wrapper Utilities\r\n\r\nA wrapper around an enum, or \"enum-like object\", that provides a variety of type-safe\r\nutilities in terms of the run-time representation fo the enum's keys/values. Some\r\nexamples include:\r\n\r\n-   Get a list of an enum's keys, values, or key/value pairs.\r\n-   Look up values by key with run-time key validation and optional result defaulting.\r\n-   Reverse lookup of keys by value (for string enums too!) with run-time value validation and optional result defaulting.\r\n-   Run-time validation that a specified value or key is valid for a given enum, with compile-time type guards.\r\n-   Treat an enum similar to an Array of key/value tuples.\r\n-   Treat an enum similar to a Map of values.\r\n\r\nAll of these utilities are very specifically typed for each enum via generics and type inference.\r\n\r\n### Enum Value Visitor/Mapper\r\n\r\nA visitor pattern for processing a single value whose type is an enum, or union of\r\nstring/number literals. It's like a switch statement that forces you to implement\r\nevery possible case (including `null` or `undefined`, if relevant), avoiding bugs\r\nbecause you forgot to handle one of the enum's values, or because the enum\r\ndefinition was updated with a new value and you forgot to update existing code to\r\nhandle the new value.\r\n\r\nThe more generalized \"visit\" functionallity has you associate a different function\r\nwith each possible value of an enum or string/number literal union.\r\nThe appropriate function is executed (and its return value returned) based on\r\nwhich value the argument is at run-time.\r\n\r\nA streamlined \"map\" functionality has you simply associate values (of any type)\r\nwith each possible value of an enum or string/number literal union.\r\nThe appropriate mapped value is returned based on which value the argument is at run-time.\r\n\r\n## Installation\r\n\r\nInstall via [NPM](https://www.npmjs.com/package/ts-enum-util):\r\n\r\n```\r\nnpm i -s ts-enum-util\r\n```\r\n\r\n## Getting Started\r\n\r\nImport `$enum`:\r\n\r\n```ts\r\nimport { $enum } from \"ts-enum-util\";\r\n```\r\n\r\nDefine an `enum`:\r\n\r\n```ts\r\nenum Color {\r\n    R,\r\n    G,\r\n    B\r\n}\r\n```\r\n\r\nUse `$enum()` as a function to access [Enum Wrapper Utilities](./docs/EnumWrapper.md) for your `enum`:\r\n\r\n```ts\r\n// type of \"values\": Color[]\r\n// value of \"values\": [0, 1, 2]\r\nconst values = $enum(Color).getValues();\r\n```\r\n\r\nUse `$enum.visitValue()` or `$enum.mapValue()` to access [Enum Value Visitor/Mapper](./docs/EnumValueVisitor.md) functionality:\r\n\r\n```ts\r\nfunction doColorAction(color: Color): void {\r\n    $enum.visitValue(color).with({\r\n        [Color.R]: () => {\r\n            window.alert(\"Red Alert!\");\r\n        },\r\n        [Color.G]: () => {\r\n            window.location = \"http://google.com\";\r\n        },\r\n        [Color.B]: () => {\r\n            console.log(\"Blue\");\r\n        }\r\n    });\r\n}\r\n\r\nfunction getColorLabel(color: Color | undefined): string {\r\n    return $enum.mapValue(color).with({\r\n        [Color.R]: \"Red\",\r\n        [Color.G]: \"Green\",\r\n        [Color.B]: \"Blue\",\r\n        [$enum.handleUndefined]: \"Unspecified\"\r\n    });\r\n}\r\n```\r\n\r\n## Usage Documentation/Examples\r\n\r\nTo keep the size of the README under control, usage documentation and examples have\r\nbeen split out to separate files:\r\n\r\n-   [Enum Wrapper Utilities](./docs/EnumWrapper.md)\r\n-   [Enum Value Visitor/Mapper](./docs/EnumValueVisitor.md)\r\n    -   [Migration Guide: from `ts-string-visitor`](./docs/migration_from_ts-string-visitor.md)\r\n\r\n## Requirements\r\n\r\n-   _TypeScript 2.9+_: `ts-enum-util` is all about strictly type-safe utilities\r\n    around TypeScript enums, so it would be much less useful in a plain JavaScript\r\n    project. More specifically, TypeScript 2.9 included advancements in handling\r\n    number literals as property names of object types, which is necessary for\r\n    implementing some `ts-enum-util` functionality consistently for both string and\r\n    number enum types.\r\n    -   _Stuck with an older version of TypeScript_?\r\n        -   For Value Visitor/Mapper functionality, check out `ts-string-visitor`\r\n            ([npm](https://www.npmjs.com/package/ts-string-visitor),\r\n            [github](https://github.com/UselessPickles/ts-string-visitor)). NOTE:\r\n            numeric value visiting/mapping not supported!\r\n        -   For Enum Wrapper\r\n            functionality, check out v3 or v2 of `ts-enum-util`.\r\n-   _ES6 Features_: The following ES6 features are used by `ts-enum-util`, so they\r\n    must exist (either natively or via polyfill) in the run-time environment:\r\n    -   `Map`\r\n    -   `WeakMap`\r\n    -   `Symbol`\r\n    -   `Symbol.iterator`\r\n    -   `Symbol.toStringTag`\r\n\r\n## Why is the main export named `$enum`?\r\n\r\nI wanted something short, simple, and easy to remember that was unlikely to conflict with anything else so that no one would have to alias it when importing it. By exporting a clear, memorable, and uniquely named \"thing\", this allows you to simply start writing code that uses `$enum` and most IDEs can take care of inserting the import { \\$enum } from \"ts-enum-util\"; for you (either automatically, or with a quick keyboard shortcut).\r\n\r\nI ended up using inspiration from the naming of jquery's `$()` function. Many javascript developers are familiar with jquery, and the fact that `$()` gives you a wrapper around a raw DOM element to expose additional/simplified functionality around the DOM element.\r\n\r\nSimilarly, `$enum()` gives you a wrapper around a raw enum to expose additional/simplified functionality around the enum.\r\n","readmeFilename":"README.md"}