@jclind/ingredient-parser 1.0.27 → 1.0.28

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.
@@ -14,17 +14,14 @@ export const parseIngredientString = (ingrStr) => {
14
14
  // If there is no comma in the string don't include a comment
15
15
  if (commaIndex !== -1) {
16
16
  ingrText = convertFractions(ingrStr.substring(0, commaIndex).replace(parenRegex, ''));
17
- comment =
18
- ingrStr
19
- .replace(parenRegex, '')
20
- .substring(commaIndex + 1)
21
- .trim() + textInParenthesesStr;
17
+ comment = (ingrStr.replace(parenRegex, '').substring(commaIndex + 1) +
18
+ textInParenthesesStr).trim();
22
19
  }
23
20
  else {
24
21
  ingrText = convertFractions(ingrStr.replace(parenRegex, '').trim());
25
- comment = textInParenthesesStr;
22
+ comment = textInParenthesesStr.trim();
26
23
  }
27
- console.log(comment);
24
+ console.log(ingrText, comment, parenthesesStr);
28
25
  const parsedIngrRes = parse(ingrText, 'eng');
29
26
  if (!parsedIngrRes.ingredient) {
30
27
  return { ...parsedIngrRes, originalIngredientString: ingrStr, comment };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jclind/ingredient-parser",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "Parses given sentence including ingredient information and attemps to return quantity, measurement and ingredient data",
5
5
  "keywords": [
6
6
  "recipe",