|
2 | 2 | // SPDX-License-Identifier: Apache-2.0 |
3 | 3 | // SPDX-License-Identifier: MIT |
4 | 4 |
|
5 | | -import { map, find } from "lodash"; |
6 | 5 | import { TauriBuildConfig } from "./types/config"; |
7 | 6 | import { reactjs, reactts } from "./recipes/react"; |
8 | 7 | import { vuecli } from "./recipes/vue-cli"; |
@@ -47,23 +46,12 @@ export interface Recipe { |
47 | 46 |
|
48 | 47 | export const allRecipes: Recipe[] = [vanillajs, reactjs, reactts, vite, vuecli]; |
49 | 48 |
|
50 | | -export const recipeNames: Array<[string, string]> = map( |
51 | | - allRecipes, |
52 | | - (r: Recipe) => [r.shortName, r.descriptiveName] |
53 | | -); |
| 49 | +export const recipeNames: Array<[string, string]> = allRecipes.map(r => [r.shortName, r.descriptiveName]); |
54 | 50 |
|
55 | | -export const recipeByShortName = (name: string): Recipe | undefined => |
56 | | - find(allRecipes, (r: Recipe) => r.shortName === name); |
| 51 | +export const recipeByShortName = (name: string) => allRecipes.find(r => r.shortName === name); |
57 | 52 |
|
58 | | -export const recipeByDescriptiveName = (name: string): Recipe | undefined => |
59 | | - find(allRecipes, (r: Recipe) => r.descriptiveName === name); |
| 53 | +export const recipeByDescriptiveName = (name: string) => allRecipes.find(r => r.descriptiveName === name); |
60 | 54 |
|
61 | | -export const recipeShortNames: string[] = map( |
62 | | - allRecipes, |
63 | | - (r: Recipe) => r.shortName |
64 | | -); |
| 55 | +export const recipeShortNames = allRecipes.map(r => r.shortName); |
65 | 56 |
|
66 | | -export const recipeDescriptiveNames: string[] = map( |
67 | | - allRecipes, |
68 | | - (r: Recipe) => r.descriptiveName |
69 | | -); |
| 57 | +export const recipeDescriptiveNames = allRecipes.map(r => r.descriptiveName); |
0 commit comments