New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@xo-union/util-snippet-generator

Package Overview
Dependencies
Maintainers
1
Versions
149
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xo-union/util-snippet-generator - npm Package Compare versions

Comparing version 1.1.0-alpha.f7f0184f to 1.1.0

LICENSE

16

lib/index.js

@@ -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"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc