Skip to content
This repository was archived by the owner on Nov 9, 2024. It is now read-only.

Commit 20fcd93

Browse files
committed
refactor: inline updateClassName utility in module
1 parent 9baf207 commit 20fcd93

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/className-plugin.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
import {updateClassName} from './utils';
1+
function updateClassName(box, action, classNames) {
2+
classNames.split(/\s+/).forEach(name => {
3+
if (name) {
4+
box.classList[action](name);
5+
}
6+
});
7+
}
28

39
export const classNamePlugin = {
410
name: 'className',

src/utils.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@ export function ssrSafeCreateDiv() {
1616
return isBrowser && document.createElement('div');
1717
}
1818

19-
export function updateClassName(box, action, classNames) {
20-
classNames.split(/\s+/).forEach(name => {
21-
if (name) {
22-
box.classList[action](name);
23-
}
24-
});
25-
}
26-
2719
export function toDataAttributes(attrs) {
2820
const dataAttrs = {
2921
'data-placement': attrs.placement,

0 commit comments

Comments
 (0)