Skip to content

Commit

Permalink
perf: remove lodash/camelCase for smaller bundle size (#595)
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 authored Aug 30, 2023
1 parent 4ab94f3 commit e09efde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion packages/icons-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"@ant-design/icons-svg": "^4.3.0",
"@babel/runtime": "^7.11.2",
"classnames": "^2.2.6",
"lodash": "^4.17.21",
"rc-util": "^5.31.1"
},
"devDependencies": {
Expand Down
5 changes: 4 additions & 1 deletion packages/icons-react/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { generate as generateColor } from '@ant-design/colors';
import type { AbstractNode, IconDefinition } from '@ant-design/icons-svg/lib/types';
import camelCase from 'lodash/camelCase';
import { updateCSS } from 'rc-util/lib/Dom/dynamicCSS';
import { getShadowRoot } from 'rc-util/lib/Dom/shadow';
import warn from 'rc-util/lib/warning';
import React, { useContext, useEffect } from 'react';
import IconContext from './components/Context';

function camelCase(input: string) {
return input.replace(/-(.)/g, (match, g) => g.toUpperCase());
}

export function warning(valid: boolean, message: string) {
warn(valid, `[@ant-design/icons] ${message}`);
}
Expand Down

0 comments on commit e09efde

Please sign in to comment.