Package Exports
- switchy
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (switchy) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Replace switch with switchy.
http://chimera.labs.oreilly.com/books/1234000000262/apa.html#dont_use_switch
Install
$ npm install --save switchyUsage
const switchy = require('switchy')
const chooseFruit = switchy({
apple() {
console.log('apple')
},
peach() {
console.log('peach')
},
default() {
console.log('no idea what you want')
}
})
chooseFruit('apple')
//=> apple
chooseFruit('watermelon')
//=> no idea what you wantLicense
MIT © EGOIST