Skip to content

Commit ecd7d54

Browse files
Import only used lodash methods
1 parent b37a077 commit ecd7d54

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

src/attributes.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
const {match} = require('posthtml/lib/api');
44
const parseAttrs = require('posthtml-attrs-parser');
55
const styleToObject = require('style-to-object');
6-
const {omit, keys, union, each, has, extend} = require('lodash');
6+
const omit = require('lodash/omit');
7+
const keys = require('lodash/keys');
8+
const union = require('lodash/union');
9+
const each = require('lodash/each');
10+
const has = require('lodash/has');
11+
const extend = require('lodash/extend');
712

813
/**
914
* Map component attributes that it's not defined as locals to first element of node

src/locals.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
'use strict';
22

3-
const merge = require('deepmerge');
43
const scriptDataLocals = require('posthtml-expressions/lib/locals');
5-
const {pick, keys, defaults, each, extend} = require('lodash');
4+
const merge = require('deepmerge');
5+
const pick = require('lodash/pick');
6+
const keys = require('lodash/keys');
7+
const defaults = require('lodash/defaults');
8+
const each = require('lodash/each');
9+
const extend = require('lodash/extend');
10+
611
const attributeTypes = ['merge', 'computed', 'aware'];
712

813
/**

src/slots.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
const {match} = require('posthtml/lib/api');
44
const {render} = require('posthtml-render');
5-
const {each, omit} = require('lodash');
5+
const each = require('lodash/each');
6+
const omit = require('lodash/omit');
67

78
/**
89
* Set filled slots

0 commit comments

Comments
 (0)