@xo-union/util-snippet-generator
Advanced tools
Comparing version 1.1.0-alpha.f7f0184f to 1.1.0
@@ -5,14 +5,13 @@ 'use strict'; | ||
var _Object$keys = _interopDefault(require('babel-runtime/core-js/object/keys')); | ||
var _extends = _interopDefault(require('babel-runtime/helpers/extends')); | ||
var _objectSpread = _interopDefault(require('@babel/runtime/helpers/objectSpread')); | ||
var minifier = _interopDefault(require('html-minifier')); | ||
function createSnippetGenerator(template, defaultVariableMap) { | ||
return function generateProgressiveCode() { | ||
var createSnippetGenerator = function createSnippetGenerator(template, defaultVariableMap) { | ||
return function () { | ||
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | ||
variables = _ref.variables, | ||
_ref$minify = _ref.minify, | ||
minify = _ref$minify === undefined ? false : _ref$minify; | ||
minify = _ref$minify === void 0 ? false : _ref$minify; | ||
var finalVariables = _extends({}, defaultVariableMap, variables); | ||
var finalVariables = _objectSpread({}, defaultVariableMap, variables); | ||
@@ -23,3 +22,3 @@ var code = template.replace(/\{\{([A-Z_]+)\}\}/g, function (match, variable) { | ||
if (typeof ref === 'undefined') { | ||
throw new Error('Cannot find ' + variable + ' in ' + _Object$keys(finalVariables)); | ||
throw new Error("Cannot find ".concat(variable, " in given variables: ").concat(Object.keys(finalVariables))); | ||
} | ||
@@ -33,2 +32,3 @@ | ||
minifyJS: true, | ||
minifyCSS: true, | ||
collapseWhitespace: true, | ||
@@ -42,4 +42,4 @@ removeComments: true, | ||
}; | ||
} | ||
}; | ||
module.exports = createSnippetGenerator; |
{ | ||
"name": "@xo-union/util-snippet-generator", | ||
"version": "1.1.0-alpha.f7f0184f", | ||
"version": "1.1.0", | ||
"main": "lib/index.js", | ||
@@ -12,5 +12,6 @@ "files": [ | ||
"dependencies": { | ||
"babel-runtime": "^6.26.0", | ||
"@babel/runtime": "^7.0.0", | ||
"html-minifier": "^3.5.15" | ||
} | ||
}, | ||
"gitHead": "9679cfd6fb23dc77631995386bfb8ce3b0a366fa" | ||
} |
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
11649
2966
3
0
1
7
+ Added@babel/runtime@^7.0.0
+ Added@babel/runtime@7.26.7(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)
- Removedbabel-runtime@^6.26.0
- Removedbabel-runtime@6.26.0(transitive)
- Removedcore-js@2.6.12(transitive)
- Removedregenerator-runtime@0.11.1(transitive)