Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

intertween

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

intertween - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

20

index.js

@@ -154,3 +154,3 @@ /**

/*function parseInterpolatables(sv, ev) {
function parseInterpolatables(sv, ev) {
var vs = [];

@@ -173,13 +173,3 @@ for (var i = 0, len = ev.length; i < len; i++) {

};
}*/
function parseInterpolatables (sv, ev) {
var vs = [];
for (var i = 0, len = ev.length; i < len; i++) {
var e = ev[i];
vs[i] = mainTween(i === 0 ? sv : ev[i - 1], e);
}
var lastItem = ev[ev.length - 1];
vs.push(mainTween(lastItem, lastItem));
return vs;
}
}

@@ -209,3 +199,3 @@ function arrayTween(sv, ev, d) {

sv[i] = typeof a === 'number' ? (((a + (b - a) * t) * d) | 0) /
d : typeof a === 'function' ? a(t) : b;
d : typeof a === 'function' ? a(t) : a.update ? a.update(t) : b;
if (r && t === 1) {

@@ -269,3 +259,3 @@ s[i] = b;

sv[i] = typeof a === 'number' ? (((a + (b - a) * t) * d) | 0) /
d : typeof a === 'function' ? a(t) : b;
d : typeof a === 'function' ? a(t) : a.update ? a.update(t) : b;
if (r && t === 1) {

@@ -288,3 +278,3 @@ s[i] = b;

objectTween(sv, ev, d) : typeof ev === 'string' ? stringTween(sv, ev, d) :
function (t) {
typeof ev === 'function' ? ev : function (t) {
var vv = typeof ev === 'number' ? (((sv + (ev - sv) * t) *

@@ -291,0 +281,0 @@ d) | 0) / d : sv

/*! InterTween - https://www.npmjs.com/package/intertween */
var u="undefined"!==typeof window?window:this;function C(){function z(b){return"string"!==typeof b?b:("string"===typeof b?b.replace(D,""):b).replace(E,F)}function A(b){var a=parseFloat(b);return"number"!==typeof a||isNaN(a)?b:a}function F(b,a){if(3===a.length){var c=a[0];var d=a[1];var h=a[2];a=c+c+d+d+h+h}c=parseInt(a,16);return"rgb("+(c>>16&255)+","+(c>>8&255)+","+(c&255)+")"}function n(b,a){if("number"!==typeof a){var c=G[a.substr(0,2)],d=a.substr(2);if(1===c)return b+parseFloat(a[0]+d);if(2===c)return b*+d;if(3===c)return b/+d;if(4===c)return+d/100*b}return a}function q(b,a,c){c=void 0!==c?c:1E4;if(!v.test(a))return a;var d=z(b).match(v).map(A),h=z(a).match(v).map(A);if(b=H(d,h,c))return b;var e=b=null,k=null,g=[];b=0;for(var f=h.length;b<f;b++){var m=h[b],p=d[b];g[b]="string"===typeof m&&1===m.indexOf("=")?a:null;I.test(m)?(e=b+2,k=b+11):J.test(m)&&(e=b,k=b+9);h[b]=p===m?null:null!==g[b]?n(p,m):"number"===typeof m?m-p:m}return function(a){for(var b="",f=0,m=h.length;f<m;f++){var p=d[f],l=h[f],B=g[f];b+="number"===typeof l?null!==e&&f>e&&f<k?p+l*a|0:((p+l*a)*c|0)/c:p;1===a&&null!==B&&(d[f]+=l,h[f]=n(d[f],B))}return b}}function w(b,a){for(var c=[],d=0,h=b.length;d<h;d++){var e=b[d];c[d]=l(e)?r(e,a):"object"===typeof e?t(e,a):"string"===typeof e?q(e,a):e}return function(a){for(var d=0,f=c.length;d<f;d++)b[d]=c[d](a);return b}}function x(b,a){for(var c=[],d=0,h=a.length;d<h;d++)c[d]=y(0===d?b:a[d-1],a[d]);d=a[a.length-1];c.push(y(d,d));return c}function r(b,a,c){c=void 0!==c?c:1E4;for(var d=b.slice(),h=[],e=0,k=a.length;e<k;e++){var g=d[e],f=a[e];h[e]="string"===typeof f&&1===f.indexOf("=")?f:null;d[e]=g===f?null:l(f)?l(g)&&f.length===g.length?r(g,f,c):x(g,f):l(g)?w(g,f):"object"===typeof f?t(g,f,c):"string"===typeof f?q(g,f,c):g;a[e]=null!==h[e]?n(g,f):f}return function(f){for(var e=0,g=a.length;e<g;e++){var k=d[e],m=a[e],l=h[e];null!==k&&(b[e]="number"===typeof k?((k+(m-k)*f)*c|0)/c:"function"===typeof k?k(f):m,l&&1===f&&(d[e]=m,a[e]=n(d[e],l)))}return b}}function H(b,a,c){c=void 0!==c?c:1E4;if(2===a.length&&2===b.length&&-1!==K.indexOf(a[1])){var d=+b[0],h=+a[0],e=a[1],k="string"===typeof a[0]&&1===a[0].indexOf("=")?a[0]:null;k&&(h=n(d,h));return function(a){var b=((d+(h-d)*a)*c|0)/c+e;k&&1===a&&(d=h,h=n(d,k));return b}}return!1}function t(b,a,c){c=void 0!==c?c:1E4;var d={},h={},e;for(e in a){h[e]=b[e];var k=h[e],g=a[e];d[e]="string"===typeof g&&1===g.indexOf("=")?g:null;h[e]=k===g?null:l(g)?l(k)&&g.length===k.length?r(k,g,c):x(k,g):l(k)?w(k,g):"object"===typeof g?t(k,g,c):"string"===typeof g?q(k,g,c):k;a[e]=null!==d[e]?n(k,g):g}return function(e){for(var f in a){var g=h[f],k=a[f],l=d[f];null!==g&&(b[f]="number"===typeof g?((g+(k-g)*e)*c|0)/c:"function"===typeof g?g(e):k,l&&1===e&&(h[f]=k,a[f]=n(h[f],l)))}return b}}function y(b,a,c){c=void 0!==c?c:1E4;var d="string"===typeof a&&"number"===typeof b&&1===a.indexOf("=")?a:null;d&&(a=n(b,d));return l(a)?l(b)&&b.length===a.length?r(b,a,c):x(b,a):l(b)?w(b,a):"object"===typeof a?t(b,a,c):"string"===typeof a?q(b,a,c):function(h){var e="number"===typeof a?((b+(a-b)*h)*c|0)/c:b;d&&1===h&&(b+=a,a=n(b,d));return e}}var J=/rgb/g,I=/argb/g,v=/\s+|([A-Za-z?().,{}:""[\]#]+)|([-+/*%]+=)?([-+*/%]+)?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,E=/^#([0-9a-f]{6}|[0-9a-f]{3})$/i,D=/\n|\r|\t/g,l=Array.isArray,G={"+=":1,"-=":1,"*=":2,"/=":3,"%=":4},K="px pt pc deg rad turn em ex cm mm dm inch in rem vw vh vmin vmax %".split(" ");return y}"function"===typeof define&&define.c?define([],C):"undefined"!==typeof module&&module.a?module.a=C():u.b=C();
var u="undefined"!==typeof window?window:this;
function C(){function z(b){return"string"!==typeof b?b:("string"===typeof b?b.replace(D,""):b).replace(E,F)}function A(b){var a=parseFloat(b);return"number"!==typeof a||isNaN(a)?b:a}function F(b,a){if(3===a.length){var c=a[0];var d=a[1];var h=a[2];a=c+c+d+d+h+h}c=parseInt(a,16);return"rgb("+(c>>16&255)+","+(c>>8&255)+","+(c&255)+")"}function n(b,a){if("number"!==typeof a){var c=G[a.substr(0,2)],d=a.substr(2);if(1===c)return b+parseFloat(a[0]+d);if(2===c)return b*+d;if(3===c)return b/+d;if(4===c)return+d/100*b}return a}function q(b,a,c){c=void 0!==c?c:1E4;if(!v.test(a))return a;var d=z(b).match(v).map(A),h=z(a).match(v).map(A);if(b=H(d,h,c))return b;var e=b=null,k=null,g=[];b=0;for(var f=h.length;b<f;b++){var m=h[b],p=d[b];g[b]="string"===typeof m&&1===m.indexOf("=")?a:null;I.test(m)?(e=b+2,k=b+11):J.test(m)&&(e=b,k=b+9);h[b]=p===m?null:null!==g[b]?n(p,m):"number"===typeof m?m-p:m}return function(a){for(var b="",f=0,m=h.length;f<m;f++){var p=d[f],l=h[f],B=g[f];b+="number"===typeof l?null!==e&&f>e&&f<k?p+l*a|0:((p+l*a)*c|0)/c:p;1===a&&null!==B&&(d[f]+=l,h[f]=n(d[f],B))}return b}}function w(b,a){for(var c=[],d=0,h=b.length;d<h;d++){var e=b[d];c[d]=l(e)?r(e,a):"object"===typeof e?t(e,a):"string"===typeof e?q(e,a):e}return function(a){for(var d=0,f=c.length;d<f;d++)b[d]=c[d](a);return b}}function x(b,a){for(var c=[],d=0,h=a.length;d<h;d++)c[d]=y(0===d?b:a[d-1],a[d]);d=a[a.length-1];c.push(y(d,d));var e=c.length-1;return function(a){a*=e;var b=Math.floor(a);return(0,c[b])(a-b)}}function r(b,a,c){c=void 0!==c?c:1E4;for(var d=b.slice(),h=[],e=0,k=a.length;e<k;e++){var g=d[e],f=a[e];h[e]="string"===typeof f&&1===f.indexOf("=")?f:null;d[e]=g===f?null:l(f)?l(g)&&f.length===g.length?r(g,f,c):x(g,f):l(g)?w(g,f):"object"===typeof f?t(g,f,c):"string"===typeof f?q(g,f,c):g;a[e]=null!==h[e]?n(g,f):f}return function(f){for(var e=0,g=a.length;e<g;e++){var k=d[e],m=a[e],l=h[e];null!==k&&(b[e]="number"===typeof k?((k+(m-k)*f)*c|0)/c:"function"===typeof k?k(f):k.update?k.update(f):m,l&&1===f&&(d[e]=m,a[e]=n(d[e],l)))}return b}}function H(b,a,c){c=void 0!==c?c:1E4;if(2===a.length&&2===b.length&&-1!==K.indexOf(a[1])){var d=+b[0],h=+a[0],e=a[1],k="string"===typeof a[0]&&1===a[0].indexOf("=")?a[0]:null;k&&(h=n(d,h));return function(a){var b=((d+(h-d)*a)*c|0)/c+e;k&&1===a&&(d=h,h=n(d,k));return b}}return!1}function t(b,a,c){c=void 0!==c?c:1E4;var d={},h={},e;for(e in a){h[e]=b[e];var k=h[e],g=a[e];d[e]="string"===typeof g&&1===g.indexOf("=")?g:null;h[e]=k===g?null:l(g)?l(k)&&g.length===k.length?r(k,g,c):x(k,g):l(k)?w(k,g):"object"===typeof g?t(k,g,c):"string"===typeof g?q(k,g,c):k;a[e]=null!==d[e]?n(k,g):g}return function(e){for(var f in a){var g=h[f],k=a[f],l=d[f];null!==g&&(b[f]="number"===typeof g?((g+(k-g)*e)*c|0)/c:"function"===typeof g?g(e):g.update?g.update(e):k,l&&1===e&&(h[f]=k,a[f]=n(h[f],l)))}return b}}function y(b,a,c){c=void 0!==c?c:1E4;var d="string"===typeof a&&"number"===typeof b&&1===a.indexOf("=")?a:null;d&&(a=n(b,d));return l(a)?l(b)&&b.length===a.length?r(b,a,c):x(b,a):l(b)?w(b,a):"object"===typeof a?t(b,a,c):"string"===typeof a?q(b,a,c):"function"===typeof a?a:function(h){var e="number"===typeof a?((b+(a-b)*h)*c|0)/c:b;d&&1===h&&(b+=a,a=n(b,d));return e}}var J=/rgb/g,I=/argb/g,v=/\s+|([A-Za-z?().,{}:""[\]#]+)|([-+/*%]+=)?([-+*/%]+)?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,E=/^#([0-9a-f]{6}|[0-9a-f]{3})$/i,D=/\n|\r|\t/g,l=Array.isArray,G={"+=":1,"-=":1,"*=":2,"/=":3,"%=":4},K="px pt pc deg rad turn em ex cm mm dm inch in rem vw vh vmin vmax %".split(" ");return y}"function"===typeof define&&define.c?define([],C):"undefined"!==typeof module&&module.a?module.a=C():u.b=C();
{
"name": "intertween",
"version": "0.0.6",
"version": "0.0.7",
"description": "The lightweight, fastest, smartest, effecient value interpolator with no-dependecy, zero-configuration and relative interpolation",

@@ -5,0 +5,0 @@ "main": "index.js",

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