Comparing version 0.0.4 to 0.0.5
@@ -127,2 +127,1 @@ export declare const data: ({ | ||
})[]; | ||
//# sourceMappingURL=cocktails.d.ts.map |
@@ -1291,2 +1291,1 @@ "use strict"; | ||
]; | ||
//# sourceMappingURL=cocktails.js.map |
@@ -128,2 +128,2 @@ export declare const findByGlass: (input: string) => string | ({ | ||
export declare const findByLiquor: (input: string) => string | string[]; | ||
//# sourceMappingURL=index.d.ts.map | ||
export declare const findByIngredients: (input: any[]) => string[]; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.findByLiquor = exports.findByGlass = void 0; | ||
exports.findByIngredients = exports.findByLiquor = exports.findByGlass = void 0; | ||
const cocktails_1 = require("../cocktails"); | ||
@@ -50,2 +50,25 @@ const logUtils_1 = require("../utils/logUtils"); | ||
exports.findByLiquor = findByLiquor; | ||
//# sourceMappingURL=index.js.map | ||
const findByIngredients = (input) => { | ||
let inputArrayWithoutHyphens = []; | ||
let outputArray = []; | ||
input.map(ingredient => { | ||
let ref = ingredient.replace("-", " "); | ||
inputArrayWithoutHyphens.push(ref); | ||
}); | ||
cocktails_1.data.map(drink => { | ||
var _a; | ||
let ingredientArray = []; | ||
(_a = drink.ingredients) === null || _a === void 0 ? void 0 : _a.map(ingredientList => { | ||
if (ingredientList.ingredient) { | ||
ingredientArray.push(utils_1.normalizeLiquor(ingredientList.ingredient)); | ||
} | ||
}); | ||
ingredientArray.every(i => inputArrayWithoutHyphens.includes(i)) && outputArray.push(drink.name); | ||
}); | ||
logUtils_1.logTitle(`Using these ingredients:`); | ||
inputArrayWithoutHyphens.map(d => logUtils_1.logBody(utils_1.capitalizeFirstLetter(d))); | ||
logUtils_1.logTitle(`\n You can make:`); | ||
outputArray.map(d => logUtils_1.logBody(d)); | ||
return outputArray; | ||
}; | ||
exports.findByIngredients = findByIngredients; |
#!/usr/bin/env node | ||
export {}; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -38,2 +38,7 @@ #!/usr/bin/env node | ||
}) | ||
.options('ingredients', { | ||
alias: 'i', | ||
description: 'find a cocktail by ingredients', | ||
type: 'array', | ||
}) | ||
.help() | ||
@@ -61,5 +66,6 @@ .alias('help', 'h') | ||
break; | ||
case 'i': | ||
argv.ingredients && find_1.findByIngredients(argv.ingredients); | ||
} | ||
} | ||
// log('All of the args', argv); | ||
//# sourceMappingURL=index.js.map | ||
// console.log('All of the args', argv); |
#!/usr/bin/env node | ||
export declare const makeByName: (input: string) => any; | ||
export declare const makeByRandom: () => any; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -36,2 +36,1 @@ #!/usr/bin/env node | ||
exports.makeByRandom = makeByRandom; | ||
//# sourceMappingURL=index.js.map |
@@ -18,2 +18,1 @@ export interface Result { | ||
export default logMakeOutput; | ||
//# sourceMappingURL=output.d.ts.map |
@@ -46,2 +46,1 @@ "use strict"; | ||
exports.default = logMakeOutput; | ||
//# sourceMappingURL=output.js.map |
@@ -5,2 +5,1 @@ export declare const spacer = " - "; | ||
export declare const log: (input: string) => void; | ||
//# sourceMappingURL=logUtils.d.ts.map |
@@ -21,2 +21,1 @@ "use strict"; | ||
exports.log = log; | ||
//# sourceMappingURL=logUtils.js.map |
export declare const getRandomInt: (max: number) => number; | ||
export declare const getCocktailName: (input: any) => string; | ||
export declare const normalizeLiquor: (input: string) => string; | ||
//# sourceMappingURL=utils.d.ts.map | ||
export declare function capitalizeFirstLetter(string: string): string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.normalizeLiquor = exports.getCocktailName = exports.getRandomInt = void 0; | ||
exports.capitalizeFirstLetter = exports.normalizeLiquor = exports.getCocktailName = exports.getRandomInt = void 0; | ||
const getRandomInt = (max) => { | ||
@@ -28,3 +28,3 @@ return Math.floor(Math.random() * Math.floor(max)); | ||
else { | ||
normalized = input; | ||
normalized = input.toLowerCase(); | ||
} | ||
@@ -34,2 +34,5 @@ return normalized; | ||
exports.normalizeLiquor = normalizeLiquor; | ||
//# sourceMappingURL=utils.js.map | ||
function capitalizeFirstLetter(string) { | ||
return string.charAt(0).toUpperCase() + string.slice(1); | ||
} | ||
exports.capitalizeFirstLetter = capitalizeFirstLetter; |
{ | ||
"name": "barcart", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "find cocktails based on what you have", | ||
@@ -5,0 +5,0 @@ "main": "cli.js", |
@@ -14,8 +14,9 @@ # barcart | ||
### Make | ||
* List instructions based on a drink name: `barcart make ${drinkName}` | ||
* List instructions based on a drink name: `barcart make manhattan` | ||
* List instructions for random drinks: `barcart make -r` | ||
### Find | ||
* List drinks based on glassware: `barcart find -g ${glassware}` | ||
* List drinks based on liquor: `barcart find -l ${liquor}` | ||
* List drinks based on glassware: `barcart find -g martini` | ||
* List drinks based on liquor: `barcart find -l rum` | ||
* List drinks based on ingredients: `barcart find -i vodka orange-juice` | ||
@@ -22,0 +23,0 @@ #### Notes: |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1854
44
67913
16