@jclind/ingredient-parser 1.2.5 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  import { IngredientResponse, OptionsType } from '../../types.js';
2
- declare const ingredientParser: (ingrString: string, spoonacularAPIKey: string, options: OptionsType) => Promise<IngredientResponse>;
2
+ declare const ingredientParser: (ingrString: string, spoonacularAPIKey: string, options?: OptionsType) => Promise<IngredientResponse>;
3
3
  export default ingredientParser;
@@ -25,7 +25,7 @@ const parseIngredientString_js_1 = require("./parseIngredientString.js");
25
25
  const getIngredientInfo_js_1 = require("./getIngredientInfo.js");
26
26
  const ingredientParser = (ingrString, spoonacularAPIKey, options) => __awaiter(void 0, void 0, void 0, function* () {
27
27
  // const parsedIngr: ParsedIngredient = parse(ingrString, 'eng')
28
- const parsedIngr = (0, parseIngredientString_js_1.parseIngredientString)(ingrString);
28
+ const parsedIngr = (0, parseIngredientString_js_1.parseIngredientString)(ingrString.toLowerCase());
29
29
  let ingrData = null;
30
30
  try {
31
31
  ingrData = yield (0, getIngredientInfo_js_1.getIngredientInfo)(parsedIngr.ingredient || '', spoonacularAPIKey);
@@ -34,6 +34,7 @@ const parseStringConsecutiveTs = (ingrStr) => {
34
34
  const parsedIngrNoTs = (0, recipe_ingredient_parser_v3_1.parse)(removeTTsIngrName, 'eng');
35
35
  console.log(parsedIngrNoTs);
36
36
  const correctIngrStr = replaceModifiedWords(modifiedWords, (_a = parsedIngrNoTs.ingredient) !== null && _a !== void 0 ? _a : '');
37
+ console.log(correctIngrStr);
37
38
  const parsedIngr = Object.assign(Object.assign({}, parsedIngrNoTs), { ingredient: correctIngrStr });
38
39
  return parsedIngr;
39
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jclind/ingredient-parser",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "Parses given sentence including ingredient information and attempts to return quantity, measurement and ingredient data",
5
5
  "keywords": [
6
6
  "recipe",