Skip to content

Commit

Permalink
Replace lodash with lodash-es
Browse files Browse the repository at this point in the history
  • Loading branch information
feedmeapples committed Mar 31, 2024
1 parent 6884727 commit f61ba68
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 46 deletions.
2 changes: 1 addition & 1 deletion packages/web/ThirdPartyLicenses.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"type": "model",
"license": "MIT"
},
"lodash": {
"lodash-es": {
"source": "https://lodash.com/",
"type": "code",
"license": "MIT"
Expand Down
98 changes: 57 additions & 41 deletions packages/web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@
},
"bundledDependencies": [],
"dependencies": {
"@types/lodash": "~4.14.0",
"@types/node": "~20.3.0",
"@types/ndarray": "~1.0.14",
"lodash": "~4.17.0",
"lodash-es": "^4.17.21",
"ndarray": "~1.0.0",
"onnxruntime-web": "~1.17.0",
"zod": "~3.21.0"
},
"devDependencies": {
"@types/lodash-es": "^4.17.12",
"assert": "~2.0.0",
"esbuild": "~0.18.0",
"glob": "~10.3.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/web/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ export {
};
export type { Config, ImageSource };

import lodash from 'lodash';
import { memoize } from 'lodash-es';
import ndarray from 'ndarray';
import { initInference, runInference } from './inference';
import { preload as preloadResources } from './resource';
import { Config, validateConfig } from './schema';
import * as utils from './utils';
import { ImageSource } from './utils';

const { memoize } = lodash;
const init = memoize(initInference, (config) => JSON.stringify(config));

async function preload(configuration?: Config): Promise<void> {
Expand Down

0 comments on commit f61ba68

Please sign in to comment.