fela-beautifier
Advanced tools
Comparing version 5.0.13 to 5.0.14
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
import cssbeautify from 'cssbeautify'; | ||
import { objectReduce, objectEach } from 'fela-utils'; | ||
import forEach from 'lodash/forEach'; | ||
function addBeautifier(renderer, options) { | ||
renderer.subscribe(function () { | ||
return objectEach(renderer.nodes, function (node, key) { | ||
node.textContent = cssbeautify(node.textContent, options); | ||
function beautify() { | ||
forEach(renderer.nodes, function (node, key) { | ||
var beautifiedContent = cssbeautify(node.textContent, options); | ||
if (node.textContent !== beautifiedContent) { | ||
node.textContent = beautifiedContent; | ||
} | ||
}); | ||
}); | ||
setTimeout(beautify, 200); | ||
} | ||
beautify(); | ||
return renderer; | ||
@@ -14,0 +22,0 @@ } |
@@ -15,13 +15,23 @@ 'use strict'; | ||
var _felaUtils = require('fela-utils'); | ||
var _forEach = require('lodash/forEach'); | ||
var _forEach2 = _interopRequireDefault(_forEach); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function addBeautifier(renderer, options) { | ||
renderer.subscribe(function () { | ||
return (0, _felaUtils.objectEach)(renderer.nodes, function (node, key) { | ||
node.textContent = (0, _cssbeautify2.default)(node.textContent, options); | ||
function beautify() { | ||
(0, _forEach2.default)(renderer.nodes, function (node, key) { | ||
var beautifiedContent = (0, _cssbeautify2.default)(node.textContent, options); | ||
if (node.textContent !== beautifiedContent) { | ||
node.textContent = beautifiedContent; | ||
} | ||
}); | ||
}); | ||
setTimeout(beautify, 200); | ||
} | ||
beautify(); | ||
return renderer; | ||
@@ -28,0 +38,0 @@ } |
{ | ||
"name": "fela-beautifier", | ||
"version": "5.0.13", | ||
"version": "5.0.14", | ||
"description": "Fela enhancer to beautify CSS output", | ||
@@ -28,5 +28,5 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"cssbeautify": "0.3.1", | ||
"fela-utils": "^7.0.5" | ||
"cssbeautify": "^0.3.1", | ||
"lodash": "^4.17.4" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5889
60
+ Addedlodash@^4.17.4
+ Addedlodash@4.17.21(transitive)
- Removedfela-utils@^7.0.5
- Removedcss-in-js-utils@2.0.0(transitive)
- Removedfela-utils@7.0.5(transitive)
- Removedhyphenate-style-name@1.1.0(transitive)
Updatedcssbeautify@^0.3.1