@maizzle/framework 4.5.0 → 4.6.1

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.
@@ -1,7 +1,8 @@
1
1
  const posthtml = require('posthtml')
2
+ const {merge} = require('../utils/helpers')
2
3
  const parseAttrs = require('posthtml-attrs-parser')
3
4
  const defaultConfig = require('../generators/posthtml/defaultConfig')
4
- const {get, merge, forEach, intersection, keys, isEmpty} = require('lodash')
5
+ const {get, forEach, intersection, keys, isEmpty} = require('lodash')
5
6
 
6
7
  module.exports = async (html, config = {}, direct = false) => {
7
8
  const posthtmlOptions = merge(defaultConfig, get(config, 'build.posthtml.options', {}))
@@ -1,7 +1,8 @@
1
1
  const posthtml = require('posthtml')
2
2
  const isUrl = require('is-url-superb')
3
+ const {merge} = require('../utils/helpers')
3
4
  const baseUrl = require('posthtml-base-url')
4
- const {get, merge, isObject, isEmpty} = require('lodash')
5
+ const {get, isObject, isEmpty} = require('lodash')
5
6
  const defaultConfig = require('../generators/posthtml/defaultConfig')
6
7
 
7
8
  module.exports = async (html, config = {}, direct = false) => {
@@ -1,5 +1,6 @@
1
1
  const posthtml = require('posthtml')
2
- const {get, merge, isObject} = require('lodash')
2
+ const {get, isObject} = require('lodash')
3
+ const {merge} = require('../utils/helpers')
3
4
  const addAttributes = require('posthtml-extra-attributes')
4
5
  const defaultConfig = require('../generators/posthtml/defaultConfig')
5
6
 
@@ -1,5 +1,6 @@
1
1
  const posthtml = require('posthtml')
2
- const {get, omit, has, merge} = require('lodash')
2
+ const {get, omit, has} = require('lodash')
3
+ const {merge} = require('../../utils/helpers')
3
4
  const defaultFilters = require('./defaultFilters')
4
5
  const PostCSS = require('../../generators/postcss')
5
6
  const posthtmlContent = require('posthtml-content')
@@ -1,5 +1,6 @@
1
+ const {get} = require('lodash')
1
2
  const posthtml = require('posthtml')
2
- const {get, merge} = require('lodash')
3
+ const {merge} = require('../utils/helpers')
3
4
  const markdown = require('posthtml-markdownit')
4
5
  const defaultConfig = require('../generators/posthtml/defaultConfig')
5
6
 
@@ -1,6 +1,7 @@
1
+ const {get} = require('lodash')
1
2
  const posthtml = require('posthtml')
2
- const {get, merge} = require('lodash')
3
3
  const outlook = require('posthtml-mso')
4
+ const {merge} = require('../utils/helpers')
4
5
  const defaultConfig = require('../generators/posthtml/defaultConfig')
5
6
 
6
7
  module.exports = async (html, config) => {
@@ -1,6 +1,7 @@
1
1
  /* eslint-disable camelcase */
2
2
  const pretty = require('pretty')
3
- const {get, merge, isEmpty, isObject} = require('lodash')
3
+ const {merge} = require('../utils/helpers')
4
+ const {get, isEmpty, isObject} = require('lodash')
4
5
 
5
6
  module.exports = async (html, config = {}, direct = false) => {
6
7
  const defaultConfig = {
@@ -1,5 +1,6 @@
1
1
  const posthtml = require('posthtml')
2
- const {get, merge, isEmpty} = require('lodash')
2
+ const {get, isEmpty} = require('lodash')
3
+ const {merge} = require('../utils/helpers')
3
4
  const {removeWidows} = require('string-remove-widows')
4
5
  const defaultConfig = require('../generators/posthtml/defaultConfig')
5
6
 
@@ -1,5 +1,6 @@
1
+ const {get} = require('lodash')
1
2
  const posthtml = require('posthtml')
2
- const {get, merge} = require('lodash')
3
+ const {merge} = require('../utils/helpers')
3
4
  const defaultConfig = require('../generators/posthtml/defaultConfig')
4
5
 
5
6
  module.exports = async (html, config = {}, direct = false) => {
@@ -1,7 +1,7 @@
1
1
  const posthtml = require('posthtml')
2
- const {get, merge, isEmpty} = require('lodash')
2
+ const {get, isEmpty} = require('lodash')
3
3
  const parseAttrs = require('posthtml-attrs-parser')
4
- const {toStyleString} = require('../utils/helpers')
4
+ const {merge, toStyleString} = require('../utils/helpers')
5
5
  const defaultConfig = require('../generators/posthtml/defaultConfig')
6
6
 
7
7
  module.exports = async (html, config = {}, direct = false) => {
@@ -1,7 +1,7 @@
1
1
  const posthtml = require('posthtml')
2
- const {get, merge, isEmpty} = require('lodash')
2
+ const {get, isEmpty} = require('lodash')
3
3
  const parseAttrs = require('posthtml-attrs-parser')
4
- const {toStyleString} = require('../utils/helpers')
4
+ const {merge, toStyleString} = require('../utils/helpers')
5
5
  const defaultConfig = require('../generators/posthtml/defaultConfig')
6
6
 
7
7
  module.exports = async (html, config = {}, direct = false) => {
@@ -1,6 +1,7 @@
1
1
  const postcss = require('postcss')
2
2
  const posthtml = require('posthtml')
3
- const {get, merge, has, remove} = require('lodash')
3
+ const {merge} = require('../utils/helpers')
4
+ const {get, has, remove} = require('lodash')
4
5
  const parseAttrs = require('posthtml-attrs-parser')
5
6
  const matchHelper = require('posthtml-match-helper')
6
7
  const defaultConfig = require('../generators/posthtml/defaultConfig')
@@ -1,5 +1,6 @@
1
1
  const {comb} = require('email-comb')
2
- const {get, merge, isEmpty, isObject} = require('lodash')
2
+ const {merge} = require('../utils/helpers')
3
+ const {get, isEmpty, isObject} = require('lodash')
3
4
  const removeInlinedClasses = require('./removeInlinedSelectors')
4
5
 
5
6
  module.exports = async (html, config = {}, direct = false) => {
@@ -1,5 +1,6 @@
1
1
  const posthtml = require('posthtml')
2
- const {get, merge, isEmpty} = require('lodash')
2
+ const {get, isEmpty} = require('lodash')
3
+ const {merge} = require('../utils/helpers')
3
4
  const safeClassNames = require('posthtml-safe-class-names')
4
5
  const defaultConfig = require('../generators/posthtml/defaultConfig')
5
6
 
@@ -1,5 +1,6 @@
1
1
  const posthtml = require('posthtml')
2
- const {get, merge, isObject, isEmpty} = require('lodash')
2
+ const {merge} = require('../utils/helpers')
3
+ const {get, isObject, isEmpty} = require('lodash')
3
4
  const mergeInlineLonghand = require('posthtml-postcss-merge-longhand')
4
5
  const defaultConfig = require('../generators/posthtml/defaultConfig')
5
6
 
@@ -1,5 +1,6 @@
1
+ const {get} = require('lodash')
1
2
  const posthtml = require('posthtml')
2
- const {get, merge} = require('lodash')
3
+ const {merge} = require('../utils/helpers')
3
4
  const {conv} = require('color-shorthand-hex-to-six-digit')
4
5
  const defaultConfig = require('../generators/posthtml/defaultConfig')
5
6
 
@@ -1,5 +1,6 @@
1
1
  const posthtml = require('posthtml')
2
- const {get, merge, isEmpty} = require('lodash')
2
+ const {get, isEmpty} = require('lodash')
3
+ const {merge} = require('../utils/helpers')
3
4
  const urlParams = require('posthtml-url-parameters')
4
5
  const defaultConfig = require('../generators/posthtml/defaultConfig')
5
6
 
@@ -1,3 +1,5 @@
1
+ const {mergeWith} = require('lodash')
2
+
1
3
  module.exports = {
2
4
  requireUncached: module => {
3
5
  try {
@@ -9,5 +11,24 @@ module.exports = {
9
11
  },
10
12
  // https://github.com/lukeed/console-clear
11
13
  clearConsole: () => process.stdout.write('\x1B[H\x1B[2J'),
12
- toStyleString: (object = {}) => Object.entries(object).map(([k, v]) => `${k}: ${v}`).join('; ')
14
+ toStyleString: (object = {}) => Object.entries(object).map(([k, v]) => `${k}: ${v}`).join('; '),
15
+ merge: (...objects) => {
16
+ if (objects.length < 2) {
17
+ return objects[0]
18
+ }
19
+
20
+ let merged = {}
21
+
22
+ for (const object of objects) {
23
+ merged = mergeWith(merged, object, (existingValue, newValue) => {
24
+ if (Array.isArray(existingValue) && Array.isArray(newValue)) {
25
+ return [...existingValue, ...newValue]
26
+ }
27
+
28
+ return undefined
29
+ })
30
+ }
31
+
32
+ return merged
33
+ }
13
34
  }