Socket
Socket
Sign inDemoInstall

datauri

Package Overview
Dependencies
3
Maintainers
3
Versions
37
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.5 to 1.1.0

2

api.js

@@ -102,3 +102,3 @@ 'use strict';

throw new Error(`The file ${ fileName } was not found!`);
throw new Error(`The file ${fileName} was not found!`);
}

@@ -105,0 +105,0 @@

@@ -1,1 +0,1 @@

{"version":"1.0.5","maintainers":[{"name":"Helder Santana","email":"heldr@me.com","url":"heldr.com"},{"name":"Ruy Adorno","url":"http://ruyadorno.com"},{"name":"Caio Gondim","email":"me@caiogondim.com","url":"https://caiogondim.com"}],"repository":{"type":"git","url":"git://github.com/data-uri/datauri.git"},"engines":{"node":">= 0.10"},"keywords":["datauri","data uri","data","uri","data-uri","optimization","uri","optimize","inline","png","jpg","woff","base64"],"author":"Helder Santana","license":"MIT","name":"datauri","dependencies":{"image-size":"^0.3.5","mimer":"^0.2.1","semver":"^5.0.3"},"description":"Create DataURI scheme easily"}
{"version":"1.1.0","maintainers":[{"name":"Helder Santana","email":"heldr@me.com","url":"http://heldr.com"},{"name":"Ruy Adorno","url":"http://ruyadorno.com"},{"name":"Caio Gondim","email":"me@caiogondim.com","url":"https://caiogondim.com"}],"repository":{"type":"git","url":"git://github.com/data-uri/datauri.git"},"engines":{"node":">= 0.10"},"keywords":["datauri","data uri","data","uri","data-uri","optimization","uri","optimize","inline","png","jpg","woff","base64"],"author":"Helder Santana","license":"MIT","name":"datauri","dependencies":{"image-size":"^0.6.2","mimer":"^0.3.2","semver":"^5.5.0"},"description":"Create DataURI scheme easily"}

@@ -8,3 +8,3 @@ 'use strict';

const SIZE_PROPS = key => /(width|height|background\-size)/g.test(key);
const PROP_VALUE = (size, key) => key === 'background-size' ? `${ size.width }px ${ size.height }px` : `${ size[key] }px`;
const PROP_VALUE = (size, key) => key === 'background-size' ? `${size.width}px ${size.height}px` : `${size[key]}px`;
const PROP_SIZE = function () {

@@ -15,7 +15,7 @@ for (var _len = arguments.length, prop = Array(_len), _key = 0; _key < _len; _key++) {

return `${ TAB }${ prop[1] }: ${ PROP_VALUE.apply(null, prop) };`;
return `${TAB}${prop[1]}: ${PROP_VALUE.apply(null, prop)};`;
};
const BASE_CSS = data => ['', `.${ data.class.replace(/\s+/gi, '_') } {`, `${ TAB }background-image: url('${ data.background }');`];
const BASE_CSS = data => ['', `.${data.class.replace(/\s+/gi, '_')} {`, `${TAB}background-image: url('${data.background}');`];
const SIZE = data => Object.keys(data).filter(SIZE_PROPS).map(PROP_SIZE.bind(null, data.dimensions));
exports.default = data => BASE_CSS(data).concat(SIZE(data), ['}']).join('\n');

@@ -7,2 +7,2 @@ "use strict";

exports.default = data => `data:${ data.mimetype };base64,${ data.base64 }`;
exports.default = data => `data:${data.mimetype};base64,${data.base64}`;
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc