@jclind/ingredient-parser 1.0.41 → 1.0.42
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.
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{api → src/api}/requests.d.ts +1 -1
- package/dist/{funcs → src/funcs}/ingredientParser.d.ts +1 -1
- package/dist/{funcs → src/funcs}/parseIngredientString.d.ts +1 -1
- package/dist/types.d.ts +73 -0
- package/dist/types.js +2 -0
- package/package.json +2 -1
- /package/dist/{api → src/api}/http.d.ts +0 -0
- /package/dist/{api → src/api}/http.js +0 -0
- /package/dist/{api → src/api}/requests.js +0 -0
- /package/dist/{funcs → src/funcs}/calculatePrice.d.ts +0 -0
- /package/dist/{funcs → src/funcs}/calculatePrice.js +0 -0
- /package/dist/{funcs → src/funcs}/convertFractions.d.ts +0 -0
- /package/dist/{funcs → src/funcs}/convertFractions.js +0 -0
- /package/dist/{funcs → src/funcs}/getIngredientInfo.d.ts +0 -0
- /package/dist/{funcs → src/funcs}/getIngredientInfo.js +0 -0
- /package/dist/{funcs → src/funcs}/getSpoonacularIngrData.d.ts +0 -0
- /package/dist/{funcs → src/funcs}/getSpoonacularIngrData.js +0 -0
- /package/dist/{funcs → src/funcs}/ingredientParser.js +0 -0
- /package/dist/{funcs → src/funcs}/parseIngredientString.js +0 -0
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -15,6 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.ingredientParser = void 0;
|
|
18
|
-
const ingredientParser_1 = require("./funcs/ingredientParser");
|
|
18
|
+
const ingredientParser_1 = require("./src/funcs/ingredientParser");
|
|
19
19
|
exports.ingredientParser = ingredientParser_1.default;
|
|
20
|
-
__exportStar(require("
|
|
20
|
+
__exportStar(require("./types"), exports);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IngredientData } from '
|
|
1
|
+
import { IngredientData } from '../../types.js';
|
|
2
2
|
export declare const checkIngredient: (name: string) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
3
3
|
export declare const searchIngredient: (name: string, spoonacularAPIKey: string) => Promise<any>;
|
|
4
4
|
export declare const getIngredientInformation: (ingrId: number, unit: boolean, spoonacularAPIKey: string) => Promise<any>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ParsedIngredient } from '
|
|
1
|
+
import { ParsedIngredient } from '../../types.js';
|
|
2
2
|
export declare const parseIngredientString: (ingrStr: string) => ParsedIngredient;
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
type StringOrNull = string | null;
|
|
2
|
+
type NumberOrNull = number | null;
|
|
3
|
+
export type IngredientResponse = {
|
|
4
|
+
parsedIngredient: ParsedIngredient;
|
|
5
|
+
ingredientData: IngredientData;
|
|
6
|
+
id?: string;
|
|
7
|
+
} | {
|
|
8
|
+
error: {
|
|
9
|
+
message: string;
|
|
10
|
+
};
|
|
11
|
+
parsedIngredient: ParsedIngredient;
|
|
12
|
+
ingredientData: IngredientData | null;
|
|
13
|
+
id?: string;
|
|
14
|
+
};
|
|
15
|
+
export type ParsedIngredient = {
|
|
16
|
+
quantity: NumberOrNull;
|
|
17
|
+
unit: StringOrNull;
|
|
18
|
+
unitPlural: StringOrNull;
|
|
19
|
+
symbol: StringOrNull;
|
|
20
|
+
ingredient: StringOrNull;
|
|
21
|
+
originalIngredientString: string;
|
|
22
|
+
minQty: NumberOrNull;
|
|
23
|
+
maxQty: NumberOrNull;
|
|
24
|
+
comment: StringOrNull;
|
|
25
|
+
};
|
|
26
|
+
export interface IngredientData {
|
|
27
|
+
_id: string;
|
|
28
|
+
ingredientId: number;
|
|
29
|
+
originalName: string;
|
|
30
|
+
name: string;
|
|
31
|
+
amount: number;
|
|
32
|
+
possibleUnits: string[];
|
|
33
|
+
consistency: string;
|
|
34
|
+
shoppingListUnits: string[];
|
|
35
|
+
aisle: string;
|
|
36
|
+
image: string;
|
|
37
|
+
imagePath: string;
|
|
38
|
+
nutrition: Nutrition;
|
|
39
|
+
totalPriceUSACents: number;
|
|
40
|
+
}
|
|
41
|
+
export interface Nutrition {
|
|
42
|
+
nutrients: Nutrient[];
|
|
43
|
+
properties: Property[];
|
|
44
|
+
flavonoids: Flavonoid[];
|
|
45
|
+
caloricBreakdown: CaloricBreakdown;
|
|
46
|
+
weightPerServing: WeightPerServing;
|
|
47
|
+
}
|
|
48
|
+
export interface Nutrient {
|
|
49
|
+
name: string;
|
|
50
|
+
amount: number;
|
|
51
|
+
unit: string;
|
|
52
|
+
percentOfDailyNeeds: number;
|
|
53
|
+
}
|
|
54
|
+
export interface Property {
|
|
55
|
+
name: string;
|
|
56
|
+
amount: number;
|
|
57
|
+
unit: string;
|
|
58
|
+
}
|
|
59
|
+
export interface Flavonoid {
|
|
60
|
+
name: string;
|
|
61
|
+
amount: number;
|
|
62
|
+
unit: string;
|
|
63
|
+
}
|
|
64
|
+
export interface CaloricBreakdown {
|
|
65
|
+
percentProtein: number;
|
|
66
|
+
percentFat: number;
|
|
67
|
+
percentCarbs: number;
|
|
68
|
+
}
|
|
69
|
+
export interface WeightPerServing {
|
|
70
|
+
amount: number;
|
|
71
|
+
unit: string;
|
|
72
|
+
}
|
|
73
|
+
export {};
|
package/dist/types.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jclind/ingredient-parser",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.42",
|
|
4
4
|
"description": "Parses given sentence including ingredient information and attempts to return quantity, measurement and ingredient data",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"recipe",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"units"
|
|
10
10
|
],
|
|
11
11
|
"main": "dist/index.js",
|
|
12
|
+
"types": "dist/index.d.ts",
|
|
12
13
|
"files": [
|
|
13
14
|
"dist"
|
|
14
15
|
],
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|