Socket
Socket
Sign inDemoInstall

lens-core

Package Overview
Dependencies
1
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.6 to 0.0.7

164

dist/lens-core.umd.js
!(function(t, e) {
'object' == typeof exports && 'undefined' != typeof module
? e()
? e(require('workerize'))
: 'function' == typeof define && define.amd
? define(e)
: e();
})(0, function() {
? define(['workerize'], e)
: e(t.workerize);
})(this, function(a) {
'use strict';
function h(o, i, s) {
o.addEventListener('message', function(t) {
var e = t.data,
n = e.id;
if ('RPC' === e.type && null != n)
if (e.method) {
var r = i[e.method];
null == r
? o.postMessage({
type: 'RPC',
id: n,
error: 'NO_SUCH_METHOD'
})
: Promise.resolve()
.then(function() {
return r.apply(null, e.params);
})
.then(function(t) {
o.postMessage({
type: 'RPC',
id: n,
result: t
});
})
.catch(function(t) {
o.postMessage({
type: 'RPC',
id: n,
error: '' + t
});
});
} else {
var a = s[n];
if (null == a) throw Error('Unknown callback ' + n);
delete s[n],
e.error ? a[1](Error(e.error)) : a[0](e.result);
}
});
}
function r(t, e) {
function o(t, e) {
var n = document.createElement('canvas');
return (n.width = t), (n.height = e), n;
}
(exports.getCanvas = r),
(a = a && a.hasOwnProperty('default') ? a.default : a),
(exports.getCanvas = o),
(exports.convertImageDataToCanvasURL = function(t) {

@@ -67,88 +29,4 @@ var e = window.document.createElement('canvas'),

i = t.options,
s = t.nWorkers,
c = (function(t, e) {
var n,
o,
i,
r = this,
a = {},
s =
'__xpo' +
Math.random()
.toString()
.substring(2) +
'__';
'function' == typeof t &&
(t =
'(' +
Function.prototype.toString.call(t) +
')(' +
s +
')'),
(o = s),
(i = a),
(n = (n = (n = t).replace(
/^(\s*)export\s+default\s+/m,
function(t, e) {
return (
(i.default = !0), '' + e + o + '.default='
);
}
)).replace(
/^(\s*)export\s+((?:async\s*)?function(?:\s*\*)?|const|let|var)(\s+)([a-zA-Z$_][a-zA-Z0-9$_]*)/gm,
function(t, e, n, r, a) {
return (
(i[a] = !0),
'' + e + o + '.' + a + '=' + n + r + a
);
}
)),
(t =
'var ' +
o +
'={};\n' +
n +
'\n' +
o +
';\n(' +
Function.prototype.toString.call(h) +
')(self,' +
s +
',{})');
var c,
u = URL.createObjectURL(new Blob([t])),
l = new Worker(u, e),
p = l.terminate,
d = {},
f = 0;
for (c in ((l.kill = function(t) {
l.postMessage({ type: 'KILL', signal: t }),
setTimeout(l.terminate);
}),
(l.terminate = function() {
URL.revokeObjectURL(u), p.call(r);
}),
(l.call = function(r, a) {
return new Promise(function(t, e) {
var n = 'rpc' + ++f;
(d[n] = [t, e]),
l.postMessage({
type: 'RPC',
id: n,
method: r,
params: a
});
});
}),
(l.rpcMethods = {}),
h(l, l.rpcMethods, d),
(l.expose = function(t) {
l[c] = function() {
return l.call(t, [].slice.call(arguments));
};
}),
a))
c in l || l.expose(c);
return l;
})(
d = t.nWorkers,
h = a(
'\n var transform = ' +

@@ -158,15 +36,15 @@ n +

),
u = r(e.width, e.height),
l = u.getContext('2d');
l.putImageData(e, 0, 0), (s = s || 1);
var p = Math.floor(u.height / s);
u = o(e.width, e.height),
s = u.getContext('2d');
s.putImageData(e, 0, 0), (d = d || 1);
var c = Math.floor(u.height / d);
return new Promise(function(e) {
for (var n = 0, t = void 0, r = 0; r < s; r++) {
(t = p), r + 1 === s && (t = u.height - p * r);
var a = l.getImageData(0, p * r, u.width, t),
o = t * u.width * 4;
c.execute(a, r, o, i).then(function(t) {
l.putImageData(t.result, 0, p * t.index),
++n === s &&
e(l.getImageData(0, 0, u.width, u.height));
for (var n = 0, t = void 0, a = 0; a < d; a++) {
(t = c), a + 1 === d && (t = u.height - c * a);
var o = s.getImageData(0, c * a, u.width, t),
r = t * u.width * 4;
h.execute(o, a, r, i).then(function(t) {
s.putImageData(t.result, 0, c * t.index),
++n === d &&
e(s.getImageData(0, 0, u.width, u.height));
});

@@ -173,0 +51,0 @@ }

2

package.json
{
"name": "lens-core",
"version": "0.0.6",
"version": "0.0.7",
"description": "Core module for lens-filter",

@@ -5,0 +5,0 @@ "main": "dist/lens-core.umd.js",

Sorry, the diff of this file is not supported yet

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