Skip to content

Commit

Permalink
Import only used lodash methods
Browse files Browse the repository at this point in the history
  • Loading branch information
thewebartisan7 committed Oct 25, 2022
1 parent b37a077 commit ecd7d54
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
const {match} = require('posthtml/lib/api');
const parseAttrs = require('posthtml-attrs-parser');
const styleToObject = require('style-to-object');
const {omit, keys, union, each, has, extend} = require('lodash');
const omit = require('lodash/omit');
const keys = require('lodash/keys');
const union = require('lodash/union');
const each = require('lodash/each');
const has = require('lodash/has');
const extend = require('lodash/extend');

/**
* Map component attributes that it's not defined as locals to first element of node
Expand Down
9 changes: 7 additions & 2 deletions src/locals.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
'use strict';

const merge = require('deepmerge');
const scriptDataLocals = require('posthtml-expressions/lib/locals');
const {pick, keys, defaults, each, extend} = require('lodash');
const merge = require('deepmerge');
const pick = require('lodash/pick');
const keys = require('lodash/keys');
const defaults = require('lodash/defaults');
const each = require('lodash/each');
const extend = require('lodash/extend');

const attributeTypes = ['merge', 'computed', 'aware'];

/**
Expand Down
3 changes: 2 additions & 1 deletion src/slots.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

const {match} = require('posthtml/lib/api');
const {render} = require('posthtml-render');
const {each, omit} = require('lodash');
const each = require('lodash/each');
const omit = require('lodash/omit');

/**
* Set filled slots
Expand Down

0 comments on commit ecd7d54

Please sign in to comment.