From 72c9055b5a9ac04b6702545622913f81ec4e7634 Mon Sep 17 00:00:00 2001 From: Beef Date: Wed, 22 Mar 2023 21:24:55 +0000 Subject: [PATCH] [Metro > Common] Add lodash to common modules --- package.json | 1 + src/def.d.ts | 2 ++ src/lib/metro/common.ts | 5 ++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index b40a795..97a2c8b 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "@react-native-clipboard/clipboard": "1.10.0", "@swc/core": "^1.3.35", "@types/chroma-js": "^2.4.0", + "@types/lodash": "^4.14.191", "@types/react": "18.0.27", "@types/react-native": "0.70.6", "esbuild": "^0.17.11", diff --git a/src/def.d.ts b/src/def.d.ts index 1452ffc..90e9e98 100644 --- a/src/def.d.ts +++ b/src/def.d.ts @@ -4,6 +4,7 @@ import _RN from "react-native"; import _Clipboard from "@react-native-clipboard/clipboard"; import _moment from "moment"; import _chroma from "chroma-js"; +import _lodash from "lodash"; type MetroModules = { [id: number]: any }; @@ -363,6 +364,7 @@ interface VendettaObject { ReactNative: typeof _RN; moment: typeof _moment; chroma: typeof _chroma; + lodash: typeof _lodash; }; }; constants: { diff --git a/src/lib/metro/common.ts b/src/lib/metro/common.ts index 7143286..3ea726a 100644 --- a/src/lib/metro/common.ts +++ b/src/lib/metro/common.ts @@ -27,4 +27,7 @@ export { ReactNative } from "@lib/preinit"; export const moment = findByProps("isMoment") as typeof import("moment"); // chroma.js -export { chroma } from "@lib/preinit"; \ No newline at end of file +export { chroma } from "@lib/preinit"; + +// Lodash +export const lodash = findByProps("forEachRight") as typeof import("lodash"); \ No newline at end of file