posthtml-component 1.0.0-beta.11 → 1.0.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "posthtml-component",
3
- "version": "1.0.0-beta.11",
3
+ "version": "1.0.0-beta.12",
4
4
  "description": "PostHTML Components Blade-like with slots, attributes as props and custom tag",
5
5
  "license": "MIT",
6
6
  "repository": "thewebartisan7/posthtml-components",
package/readme.md CHANGED
@@ -109,7 +109,7 @@ See also the `docs-src` folder where you can find more examples. You can run `np
109
109
  | **push** | `push` | String value for `<push>` tag name. |
110
110
  | **stack** | `stack` | String value for `<stack>` tag name. |
111
111
  | **propsScriptAttribute** | `props` | String value used as attribute in `<script props>` parsed by the plugin to retrieve props of the component. |
112
- | **propsContext** | `props` | String value used as object name inside the script to process process before passed to the component. |
112
+ | **propsContext** | `props` | String value used as object name inside the script to process props before passed to the component. |
113
113
  | **propsAttribute** | `props` | String value for props attribute to define props as JSON. |
114
114
  | **propsSlot** | `props` | String value used to retrieve the props passed to slot via `$slots.slotName.props`. |
115
115
  | **expressions** | `{}` | Object to configure `posthtml-expressions`. You can pre-set locals or customize the delimiters for example. |
package/src/index.js CHANGED
@@ -10,8 +10,19 @@ const processProps = require('./process-props');
10
10
  const processAttributes = require('./process-attributes');
11
11
  const {processPushes, processStacks} = require('./process-stacks');
12
12
  const {setFilledSlots, processSlotContent, processFillContent} = require('./process-slots');
13
+ const defaults = require('lodash/defaults');
14
+ const assignWith = require('lodash/assignWith');
13
15
  const mergeWith = require('lodash/mergeWith');
14
16
  const template = require('lodash/template');
17
+ const get = require('lodash/get');
18
+ const has = require('lodash/has');
19
+ const isObjectLike = require('lodash/isObjectLike');
20
+ const isArray = require('lodash/isArray');
21
+ const isEmpty = require('lodash/isEmpty');
22
+ const isBoolean = require('lodash/isBoolean');
23
+ const isUndefined = require('lodash/isUndefined'); // value === undefined
24
+ const isNull = require('lodash/isNull'); // value === null
25
+ const isNil = require('lodash/isNil'); // value == null
15
26
 
16
27
  // const {inspect} = require('util');
17
28
  // const debug = true;
@@ -45,7 +56,21 @@ module.exports = (options = {}) => tree => {
45
56
  options.plugins = options.plugins || [];
46
57
  options.attrsParserRules = options.attrsParserRules || {};
47
58
  options.strict = typeof options.strict === 'undefined' ? true : options.strict;
48
- options.utilities = options.utilities || {merge: mergeWith, template};
59
+ options.utilities = options.utilities || {
60
+ defaults,
61
+ assign: assignWith,
62
+ merge: mergeWith,
63
+ template,
64
+ get,
65
+ has,
66
+ isObject: isObjectLike,
67
+ isArray,
68
+ isEmpty,
69
+ isBoolean,
70
+ isUndefined,
71
+ isNull,
72
+ isNil
73
+ };
49
74
 
50
75
  // Merge customizer callback passed to lodash mergeWith
51
76
  // for merge attribute `props` and all attributes starting with `merge:`