Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove lodash/chunk #13022

Merged
merged 3 commits into from Mar 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/babel-helper-module-transforms/package.json
Expand Up @@ -22,7 +22,6 @@
"@babel/helper-validator-identifier": "workspace:^7.12.11",
"@babel/template": "workspace:^7.12.13",
"@babel/traverse": "workspace:^7.13.0",
"@babel/types": "workspace:^7.13.0",
"lodash": "^4.17.19"
"@babel/types": "workspace:^7.13.0"
}
}
9 changes: 8 additions & 1 deletion packages/babel-helper-module-transforms/src/index.js
@@ -1,7 +1,6 @@
import assert from "assert";
import * as t from "@babel/types";
import template from "@babel/template";
import chunk from "lodash/chunk";

import { isModule } from "@babel/helper-module-imports";

Expand Down Expand Up @@ -419,3 +418,11 @@ function buildInitStatement(metadata: ModuleMetadata, exportNames, initExpr) {
}, initExpr),
);
}

function chunk(array, size) {
const chunks = [];
for (let i = 0; i < array.length; i += size) {
chunks.push(array.slice(i, i + size));
}
return chunks;
}
1 change: 0 additions & 1 deletion yarn.lock
Expand Up @@ -673,7 +673,6 @@ __metadata:
"@babel/template": "workspace:^7.12.13"
"@babel/traverse": "workspace:^7.13.0"
"@babel/types": "workspace:^7.13.0"
lodash: ^4.17.19
languageName: unknown
linkType: soft

Expand Down