{"_id":"zwitch","_rev":"2893880","name":"zwitch","description":"Handle values based on a property","dist-tags":{"latest":"2.0.4"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"time":{"modified":"2022-12-08T07:26:11.000Z","created":"2016-07-16T12:53:45.455Z","2.0.4":"2022-11-16T09:09:14.038Z","2.0.3":"2022-11-14T17:23:33.198Z","2.0.2":"2021-04-02T09:53:15.797Z","2.0.1":"2021-03-10T08:58:57.117Z","2.0.0":"2021-03-09T13:28:41.389Z","1.0.5":"2020-01-25T11:25:29.495Z","1.0.4":"2019-05-09T08:54:27.687Z","1.0.3":"2018-04-21T09:19:23.700Z","1.0.2":"2017-07-18T15:37:20.847Z","1.0.1":"2017-06-19T22:40:15.178Z","1.0.0":"2016-07-16T12:53:45.455Z"},"users":{},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"repository":{"type":"git","url":"git+https://github.com/wooorm/zwitch.git"},"versions":{"2.0.4":{"name":"zwitch","version":"2.0.4","description":"Handle values based on a property","license":"MIT","keywords":["handle","switch","property"],"repository":{"type":"git","url":"git+https://github.com/wooorm/zwitch.git"},"bugs":{"url":"https://github.com/wooorm/zwitch/issues"},"funding":{"type":"github","url":"https://github.com/sponsors/wooorm"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"index.d.ts","devDependencies":{"@types/node":"^18.0.0","c8":"^7.0.0","prettier":"^2.0.0","remark-cli":"^11.0.0","remark-preset-wooorm":"^9.0.0","tsd":"^0.24.0","type-coverage":"^2.0.0","typescript":"^4.0.0","xo":"^0.52.0"},"scripts":{"prepack":"npm run build && npm run format","build":"tsc --build --clean && tsc --build && tsd && type-coverage","format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node --conditions development test.js","test-coverage":"c8 --check-coverage --100 --reporter lcov npm run test-api","test":"npm run build && npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true},"remarkConfig":{"plugins":["preset-wooorm"]},"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreFiles":["index.d.ts"]},"gitHead":"7a4992d2fd34772bf7caf3f755ba9a767cf79771","homepage":"https://github.com/wooorm/zwitch#readme","_id":"zwitch@2.0.4","_nodeVersion":"19.0.0","_npmVersion":"8.19.2","dist":{"shasum":"c827d4b0acb76fc3e685a4c6ec2902d51070e9d7","size":4529,"noattachment":false,"key":"/zwitch/-/zwitch-2.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/zwitch/download/zwitch-2.0.4.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/zwitch_2.0.4_1668589753881_0.3148052657085556"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-11-16T09:28:03.334Z","publish_time":1668589754038,"_cnpm_publish_time":1668589754038},"2.0.3":{"name":"zwitch","version":"2.0.3","description":"Handle values based on a property","license":"MIT","keywords":["handle","switch","property"],"repository":{"type":"git","url":"git+https://github.com/wooorm/zwitch.git"},"bugs":{"url":"https://github.com/wooorm/zwitch/issues"},"funding":{"type":"github","url":"https://github.com/sponsors/wooorm"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"index.d.ts","devDependencies":{"@types/node":"^18.0.0","c8":"^7.0.0","prettier":"^2.0.0","remark-cli":"^11.0.0","remark-preset-wooorm":"^9.0.0","tsd":"^0.24.0","type-coverage":"^2.0.0","typescript":"^4.0.0","xo":"^0.52.0"},"scripts":{"prepack":"npm run build && npm run format","build":"tsc --build --clean && tsc --build && tsd && type-coverage","format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node --conditions development test.js","test-coverage":"c8 --check-coverage --100 --reporter lcov npm run test-api","test":"npm run build && npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true},"remarkConfig":{"plugins":["preset-wooorm"]},"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreFiles":["index.d.ts"]},"gitHead":"6a64dd977fb76e4aa3b7fdb2702e3b2392b67e10","homepage":"https://github.com/wooorm/zwitch#readme","_id":"zwitch@2.0.3","_nodeVersion":"19.0.0","_npmVersion":"8.19.2","dist":{"shasum":"fd16902a7119d139b6cf13fa41fc909e7936ea09","size":4552,"noattachment":false,"key":"/zwitch/-/zwitch-2.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/zwitch/download/zwitch-2.0.3.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/zwitch_2.0.3_1668446613002_0.920897431630743"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-11-14T17:47:02.757Z","publish_time":1668446613198,"_cnpm_publish_time":1668446613198},"2.0.2":{"name":"zwitch","version":"2.0.2","description":"Handle values based on a property","license":"MIT","keywords":["handle","switch","property"],"repository":{"type":"git","url":"git+https://github.com/wooorm/zwitch.git"},"bugs":{"url":"https://github.com/wooorm/zwitch/issues"},"funding":{"type":"github","url":"https://github.com/sponsors/wooorm"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"index.d.ts","devDependencies":{"@types/tape":"^4.0.0","c8":"^7.0.0","prettier":"^2.0.0","remark-cli":"^9.0.0","remark-preset-wooorm":"^8.0.0","rimraf":"^3.0.0","tape":"^5.0.0","type-coverage":"^2.0.0","typescript":"^4.0.0","xo":"^0.38.0"},"scripts":{"prepack":"npm run build && npm run format","build":"tsc && type-coverage","format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node test.js","test-coverage":"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js","test":"npm run build && npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"rules":{"no-var":"off","prefer-arrow-callback":"off","unicorn/prefer-reflect-apply":"off"}},"remarkConfig":{"plugins":["preset-wooorm"]},"typeCoverage":{"atLeast":100,"detail":true,"strict":true},"gitHead":"a4bbebd4832c9f15c41fdb41d55852b94771ef7d","homepage":"https://github.com/wooorm/zwitch#readme","_id":"zwitch@2.0.2","_nodeVersion":"15.11.0","_npmVersion":"7.6.2","dist":{"shasum":"91f8d0e901ffa3d66599756dde7f57b17c95dce1","size":3440,"noattachment":false,"key":"/zwitch/-/zwitch-2.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/zwitch/download/zwitch-2.0.2.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/zwitch_2.0.2_1617357195628_0.2388781746729176"},"_hasShrinkwrap":false,"publish_time":1617357195797,"_cnpm_publish_time":1617357195797},"2.0.1":{"name":"zwitch","version":"2.0.1","description":"Handle values based on a property","license":"MIT","keywords":["handle","switch","property"],"repository":{"type":"git","url":"git+https://github.com/wooorm/zwitch.git"},"bugs":{"url":"https://github.com/wooorm/zwitch/issues"},"funding":{"type":"github","url":"https://github.com/sponsors/wooorm"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"index.d.ts","devDependencies":{"@types/tape":"^4.0.0","c8":"^7.0.0","prettier":"^2.0.0","remark-cli":"^9.0.0","remark-preset-wooorm":"^8.0.0","rimraf":"^3.0.0","tape":"^5.0.0","typescript":"^4.0.0","xo":"^0.38.0"},"scripts":{"prepublishOnly":"npm run build && npm run format","prebuild":"rimraf \"*.d.ts\"","build":"tsc","format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node test.js","test-coverage":"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js","test":"npm run build && npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"rules":{"no-var":"off","prefer-arrow-callback":"off","unicorn/prefer-reflect-apply":"off"}},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"c10399ef6300709e9862be2a1044762b07f7458c","homepage":"https://github.com/wooorm/zwitch#readme","_id":"zwitch@2.0.1","_nodeVersion":"15.11.0","_npmVersion":"7.6.1","dist":{"shasum":"1a2abb75ae1e883d00b9189e1017c9f8f03829d6","size":3305,"noattachment":false,"key":"/zwitch/-/zwitch-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/zwitch/download/zwitch-2.0.1.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/zwitch_2.0.1_1615366736961_0.08423781601911906"},"_hasShrinkwrap":false,"publish_time":1615366737117,"_cnpm_publish_time":1615366737117},"2.0.0":{"name":"zwitch","version":"2.0.0","description":"Handle values based on a property","license":"MIT","keywords":["handle","switch","property"],"repository":{"type":"git","url":"git+https://github.com/wooorm/zwitch.git"},"bugs":{"url":"https://github.com/wooorm/zwitch/issues"},"funding":{"type":"github","url":"https://github.com/sponsors/wooorm"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"index.d.ts","devDependencies":{"@types/tape":"^4.0.0","c8":"^7.0.0","prettier":"^2.0.0","remark-cli":"^9.0.0","remark-preset-wooorm":"^8.0.0","rimraf":"^3.0.0","tape":"^5.0.0","typescript":"^4.0.0","xo":"^0.38.0"},"scripts":{"prepublishOnly":"npm run build && npm run format","prebuild":"rimraf \"*.d.ts\"","build":"tsc","format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node test.js","test-coverage":"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js","test":"npm run build && npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"rules":{"no-var":"off","prefer-arrow-callback":"off","unicorn/prefer-reflect-apply":"off"}},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"50e40e42ff65689abbfdc96e1b791b7764afa09e","homepage":"https://github.com/wooorm/zwitch#readme","_id":"zwitch@2.0.0","_nodeVersion":"15.11.0","_npmVersion":"7.6.1","dist":{"shasum":"0404abe6597a1927a87e1ea9bdd90ed71b5681e2","size":3266,"noattachment":false,"key":"/zwitch/-/zwitch-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/zwitch/download/zwitch-2.0.0.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/zwitch_2.0.0_1615296521226_0.8560484650519882"},"_hasShrinkwrap":false,"publish_time":1615296521389,"_cnpm_publish_time":1615296521389},"1.0.5":{"name":"zwitch","version":"1.0.5","description":"Handle values based on a property","license":"MIT","keywords":["handle","switch","property"],"repository":{"type":"git","url":"git+https://github.com/wooorm/zwitch.git"},"bugs":{"url":"https://github.com/wooorm/zwitch/issues"},"funding":{"type":"github","url":"https://github.com/sponsors/wooorm"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"dependencies":{},"devDependencies":{"browserify":"^16.0.0","nyc":"^15.0.0","prettier":"^1.0.0","remark-cli":"^7.0.0","remark-preset-wooorm":"^6.0.0","tape":"^4.0.0","tinyify":"^2.0.0","xo":"^0.25.0"},"scripts":{"format":"remark . -qfo && prettier --write \"**/*.js\" && xo --fix","build-bundle":"browserify . -s zwitch -o zwitch.js","build-mangle":"browserify . -s zwitch -p tinyify -o zwitch.min.js","build":"npm run build-bundle && npm run build-mangle","test-api":"node test","test-coverage":"nyc --reporter lcov tape test.js","test":"npm run format && npm run build && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"esnext":false,"rules":{"unicorn/prefer-reflect-apply":"off"},"ignores":["zwitch.js"]},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"f6ba8099287a53d8993a2458502b4fee890a1792","homepage":"https://github.com/wooorm/zwitch#readme","_id":"zwitch@1.0.5","_nodeVersion":"13.0.1","_npmVersion":"6.13.6","dist":{"shasum":"d11d7381ffed16b742f6af7b3f223d5cd9fe9920","size":2887,"noattachment":false,"key":"/zwitch/-/zwitch-1.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/zwitch/download/zwitch-1.0.5.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/zwitch_1.0.5_1579951529350_0.03247599308740723"},"_hasShrinkwrap":false,"publish_time":1579951529495,"_cnpm_publish_time":1579951529495},"1.0.4":{"name":"zwitch","version":"1.0.4","description":"Handle values based on a property","license":"MIT","keywords":["handle","switch","property"],"repository":{"type":"git","url":"git+https://github.com/wooorm/zwitch.git"},"bugs":{"url":"https://github.com/wooorm/zwitch/issues"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"dependencies":{},"devDependencies":{"browserify":"^16.0.0","nyc":"^14.0.0","prettier":"^1.12.1","remark-cli":"^6.0.0","remark-preset-wooorm":"^4.0.0","tape":"^4.0.0","tinyify":"^2.5.0","xo":"^0.24.0"},"scripts":{"format":"remark . -qfo && prettier --write \"**/*.js\" && xo --fix","build-bundle":"browserify . -s zwitch -o zwitch.js","build-mangle":"browserify . -s zwitch -p tinyify -o zwitch.min.js","build":"npm run build-bundle && npm run build-mangle","test-api":"node test","test-coverage":"nyc --reporter lcov tape test.js","test":"npm run format && npm run build && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"esnext":false,"ignores":["zwitch.js"]},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"675ed602bfe13ceae4df912bfdccdb4b4977498d","homepage":"https://github.com/wooorm/zwitch#readme","_id":"zwitch@1.0.4","_nodeVersion":"11.9.0","_npmVersion":"6.9.0","dist":{"shasum":"93b1b993b13c8926753a41afaf8f27bbfac6be8b","size":2824,"noattachment":false,"key":"/zwitch/-/zwitch-1.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/zwitch/download/zwitch-1.0.4.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/zwitch_1.0.4_1557392067597_0.7983893200717578"},"_hasShrinkwrap":false,"publish_time":1557392067687,"_cnpm_publish_time":1557392067687},"1.0.3":{"name":"zwitch","version":"1.0.3","description":"Handle values based on a property","license":"MIT","keywords":["handle","switch","property"],"repository":{"type":"git","url":"git+https://github.com/wooorm/zwitch.git"},"bugs":{"url":"https://github.com/wooorm/zwitch/issues"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"}],"files":["index.js"],"dependencies":{},"devDependencies":{"browserify":"^16.0.0","esmangle":"^1.0.1","nyc":"^11.0.0","prettier":"^1.12.1","remark-cli":"^5.0.0","remark-preset-wooorm":"^4.0.0","tape":"^4.0.0","xo":"^0.20.0"},"scripts":{"format":"remark . -qfo && prettier --write '**/*.js' && xo --fix","build-bundle":"browserify index.js --bare -s zwitch > zwitch.js","build-mangle":"esmangle < zwitch.js > zwitch.min.js","build":"npm run build-bundle && npm run build-mangle","test-api":"node test","test-coverage":"nyc --reporter lcov tape test.js","test":"npm run format && npm run build && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"esnext":false,"rules":{"no-var":"off","prefer-arrow-callback":"off"},"ignores":["zwitch.js"]},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"821d4d31e8ed7afaeca597049d8cfcf303950e69","homepage":"https://github.com/wooorm/zwitch#readme","_id":"zwitch@1.0.3","_npmVersion":"5.6.0","_nodeVersion":"9.5.0","_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"dist":{"shasum":"159fae4b3f737db1e42bf321d3423e4c96688a18","size":2801,"noattachment":false,"key":"/zwitch/-/zwitch-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/zwitch/download/zwitch-1.0.3.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/zwitch_1.0.3_1524302363633_0.1780684176270213"},"_hasShrinkwrap":false,"publish_time":1524302363700,"_cnpm_publish_time":1524302363700},"1.0.2":{"name":"zwitch","version":"1.0.2","description":"Handle values based on a property","license":"MIT","keywords":["handle","switch","property"],"repository":{"type":"git","url":"git+https://github.com/wooorm/zwitch.git"},"bugs":{"url":"https://github.com/wooorm/zwitch/issues"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"}],"files":["index.js"],"dependencies":{},"devDependencies":{"browserify":"^14.1.0","esmangle":"^1.0.1","nyc":"^11.0.0","remark-cli":"^3.0.0","remark-preset-wooorm":"^3.0.0","tape":"^4.0.0","xo":"^0.18.0"},"scripts":{"build-md":"remark . -qfo","build-bundle":"browserify index.js --bare -s zwitch > zwitch.js","build-mangle":"esmangle < zwitch.js > zwitch.min.js","build":"npm run build-md && npm run build-bundle && npm run build-mangle","lint":"xo","test-api":"node test","test-coverage":"nyc --reporter lcov tape test.js","test":"npm run build && npm run lint && npm run test-coverage"},"xo":{"space":true,"esnext":false,"ignores":["zwitch.js"]},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"9ffbaaee751f761dd8449e221c916e8ea3d2061d","homepage":"https://github.com/wooorm/zwitch#readme","_id":"zwitch@1.0.2","_shasum":"9b059541bfa844799fe2d903bde609de2503a041","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0","_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"dist":{"shasum":"9b059541bfa844799fe2d903bde609de2503a041","size":2686,"noattachment":false,"key":"/zwitch/-/zwitch-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/zwitch/download/zwitch-1.0.2.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/zwitch-1.0.2.tgz_1500392239794_0.8526203446090221"},"directories":{},"publish_time":1500392240847,"_hasShrinkwrap":false,"_cnpm_publish_time":1500392240847},"1.0.1":{"name":"zwitch","version":"1.0.1","description":"Handle values based on a property","license":"MIT","keywords":["handle","switch","property"],"repository":{"type":"git","url":"git+https://github.com/wooorm/zwitch.git"},"bugs":{"url":"https://github.com/wooorm/zwitch/issues"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"}],"files":["index.js"],"dependencies":{"x-is-object":"^0.1.0"},"devDependencies":{"browserify":"^14.1.0","esmangle":"^1.0.1","nyc":"^11.0.0","remark-cli":"^3.0.0","remark-preset-wooorm":"^3.0.0","tape":"^4.0.0","xo":"^0.18.0"},"scripts":{"build-md":"remark . -qfo","build-bundle":"browserify index.js --bare -s zwitch > zwitch.js","build-mangle":"esmangle < zwitch.js > zwitch.min.js","build":"npm run build-md && npm run build-bundle && npm run build-mangle","lint":"xo","test-api":"node test","test-coverage":"nyc --reporter lcov tape test.js","test":"npm run build && npm run lint && npm run test-coverage"},"xo":{"space":true,"esnext":false,"ignores":["zwitch.js"]},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"6d8c0ea3f0aec03021c48ad3073ea7ac754a32bb","homepage":"https://github.com/wooorm/zwitch#readme","_id":"zwitch@1.0.1","_shasum":"c408158374fd3c32239214df68636488681acfee","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0","_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"dist":{"shasum":"c408158374fd3c32239214df68636488681acfee","size":2701,"noattachment":false,"key":"/zwitch/-/zwitch-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/zwitch/download/zwitch-1.0.1.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/zwitch-1.0.1.tgz_1497912014248_0.368430303176865"},"directories":{},"publish_time":1497912015178,"_cnpm_publish_time":1497912015178,"_hasShrinkwrap":false},"1.0.0":{"name":"zwitch","version":"1.0.0","description":"Handle values based on a property","license":"MIT","keywords":["handle","switch","property"],"files":["index.js"],"repository":{"type":"git","url":"git+https://github.com/wooorm/zwitch.git"},"bugs":{"url":"https://github.com/wooorm/zwitch/issues"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"}],"dependencies":{"has":"^1.0.1","x-is-object":"^0.1.0"},"devDependencies":{"browserify":"^13.0.1","esmangle":"^1.0.1","nyc":"^7.0.0","remark-cli":"^1.0.0","remark-comment-config":"^4.0.0","remark-github":"^5.0.0","remark-lint":"^4.0.0","remark-validate-links":"^4.0.0","tape":"^4.0.0","xo":"^0.16.0"},"scripts":{"build-md":"remark . --quiet --frail","build-bundle":"browserify index.js --bare -s zwitch > zwitch.js","build-mangle":"esmangle < zwitch.js > zwitch.min.js","build":"npm run build-md && npm run build-bundle && npm run build-mangle","lint":"xo","test-api":"node test","test-coverage":"nyc --reporter lcov tape test.js","test":"npm run build && npm run lint && npm run test-coverage"},"xo":{"space":true,"ignores":["zwitch.js","zwitch.min.js"]},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"remarkConfig":{"output":true,"plugins":["comment-config","github","lint","validate-links"],"settings":{"bullet":"*"}},"gitHead":"751c1f7d1b4973f64f5a3796f2aa60431da0ef4c","homepage":"https://github.com/wooorm/zwitch#readme","_id":"zwitch@1.0.0","_shasum":"1ca2c5fe26445ac868b2f063454e89caad39df7b","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"dist":{"shasum":"1ca2c5fe26445ac868b2f063454e89caad39df7b","size":2995,"noattachment":false,"key":"/zwitch/-/zwitch-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/zwitch/download/zwitch-1.0.0.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/zwitch-1.0.0.tgz_1468673623211_0.36366994795389473"},"directories":{},"publish_time":1468673625455,"_cnpm_publish_time":1468673625455,"_hasShrinkwrap":false}},"readme":"# zwitch\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n\nHandle values based on a field.\n\n## Contents\n\n*   [What is this?](#what-is-this)\n*   [When should I use this?](#when-should-i-use-this)\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`zwitch(key[, options])`](#zwitchkey-options)\n    *   [`one(value[, rest…])`](#onevalue-rest)\n    *   [`function handler(value[, rest…])`](#function-handlervalue-rest)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Related](#related)\n*   [Contribute](#contribute)\n*   [Security](#security)\n*   [License](#license)\n\n## What is this?\n\nThis is a tiny package that lets you `switch` between some field on objects.\n\n## When should I use this?\n\nThis package is very useful when mapping one AST to another.\nIt’s a lot like a `switch` statement on one field, but it’s extensible.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 14.14+, 16.0+), install with [npm][]:\n\n```sh\nnpm install zwitch\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {zwitch} from 'https://esm.sh/zwitch@2'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {zwitch} from 'https://esm.sh/zwitch@2?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {zwitch} from 'zwitch'\n\nconst handle = zwitch('type', {invalid, unknown, handlers: {alpha: handleAlpha}})\n\nhandle({type: 'alpha'})\n\nfunction handleAlpha() { /* … */ }\n```\n\nOr, with a `switch` statement:\n\n```js\nconst field = 'type'\n\nfunction handle(value) {\n  let fn = invalid\n\n  if (value && typeof value === 'object' && field in value) {\n    switch (value[field]) {\n      case 'alpha':\n        fn = handleAlpha\n        break\n      default:\n        fn = unknown\n        break\n    }\n  }\n\n  return fn.apply(this, arguments)\n}\n\nhandle({type: 'alpha'})\n\nfunction handleAlpha() { /* … */ }\nfunction unknown() { /* … */ }\nfunction invalid() { /* … */ }\n```\n\n## API\n\nThis package exports the identifier `zwitch`.\nThere is no default export.\n\n### `zwitch(key[, options])`\n\nCreate a switch, based on a `key` (`string`).\n\n##### `options`\n\nOptions can be omitted and added later to `one`.\n\n###### `options.handlers`\n\nHandlers to use, stored on `one.handlers` (`Record<string, Function>`,\noptional).\n\n###### `options.unknown`\n\nHandler to use for unknown values, stored on `one.unknown` (`Function`,\noptional).\n\n###### `options.invalid`\n\nHandler to use for invalid values, stored on `one.invalid` (`Function`,\noptional).\n\n###### Returns\n\nSee [`one`][one] (`Function`).\n\n### `one(value[, rest…])`\n\nHandle one value.\nBased on the bound `key`, a respective handler will be called.\nIf `value` is not an object, or doesn’t have a `key` property, the special\n“invalid” handler will be called.\nIf `value` has an unknown `key`, the special “unknown” handler will be called.\n\nAll arguments, and the context object (`this`), are passed through to the\n[handler][], and it’s result is returned.\n\n###### `one.handlers`\n\nMap of [handler][]s (`Record<string, Function>`).\n\n###### `one.invalid`\n\nSpecial [`handler`][handler] called if a value doesn’t have a `key` property.\nIf not set, `undefined` is returned for invalid values.\n\n###### `one.unknown`\n\nSpecial [`handler`][handler] called if a value does not have a matching\nhandler.\nIf not set, `undefined` is returned for unknown values.\n\n### `function handler(value[, rest…])`\n\nHandle one value.\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the types `Handler`, `UnknownHandler`, `InvalidHandler`, and\n`Options`.\n\n## Compatibility\n\nThis package is at least compatible with all maintained versions of Node.js.\nAs of now, that is Node.js 14.14+ and 16.0+.\nIt also works in Deno and modern browsers.\n\n## Related\n\n*   [`mapz`](https://github.com/wooorm/mapz)\n    — functional map\n\n## Contribute\n\nYes please!\nSee [How to Contribute to Open Source][contribute].\n\n## Security\n\nThis package is safe.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n<!-- Definitions -->\n\n[build-badge]: https://github.com/wooorm/zwitch/workflows/main/badge.svg\n\n[build]: https://github.com/wooorm/zwitch/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/zwitch.svg\n\n[coverage]: https://codecov.io/github/wooorm/zwitch\n\n[downloads-badge]: https://img.shields.io/npm/dm/zwitch.svg\n\n[downloads]: https://www.npmjs.com/package/zwitch\n\n[size-badge]: https://img.shields.io/bundlephobia/minzip/zwitch.svg\n\n[size]: https://bundlephobia.com/result?p=zwitch\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[typescript]: https://www.typescriptlang.org\n\n[contribute]: https://opensource.guide/how-to-contribute/\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[one]: #onevalue-rest\n\n[handler]: #function-handlervalue-rest\n","_attachments":{},"homepage":"https://github.com/wooorm/zwitch#readme","bugs":{"url":"https://github.com/wooorm/zwitch/issues"},"license":"MIT"}