intertween
Advanced tools
Comparing version 0.0.14 to 0.0.15
@@ -6,3 +6,2 @@ /** | ||
* @license MIT-License | ||
* First Release at 20 August 2017, by @dalisoft | ||
*/ | ||
@@ -9,0 +8,0 @@ |
/*! InterTween - https://www.npmjs.com/package/intertween */ | ||
var v="undefined"!==typeof window?window:this;function C(){function A(b){return"string"!==typeof b?b:("string"===typeof b?b.replace(D,""):b).replace(E,F)}function B(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 k=a[2];a=c+c+d+d+k+k}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(!w.test(a))return a;var d=A(b).match(w).map(B),k=A(a).match(w).map(B);if(b=H(d,k,c))return b;var e=b=null,h=null,f=[];b=0;for(var g=k.length;b<g;b++){var m=k[b],p=d[b];f[b]="string"===typeof m&&1===m.indexOf("=")?a:null;I.test(m)?(e=b+2,h=b+11):J.test(m)&&(e=b,h=b+9);k[b]=p===m?null:null!==f[b]?n(p,m):"number"===typeof m?m-p:m}return function(a){for(var b="",g=0,m=k.length;g<m;g++){var p=d[g],r=k[g],l=f[g];b+="number"===typeof r?null!==e&&g>e&&g<h?p+r*a|0:((p+r*a)*c|0)/c:p;1===a&&null!==l&&(d[g]+=r,k[g]=n(d[g],l))}return b}}function x(b,a){for(var c=[],d=0,k=b.length;d<k;d++){var e=b[d];c[d]=l(e)?t(e,a):"object"===typeof e?u(e,a):"string"===typeof e?q(e,a):e}return function(a){for(var d=0,g=c.length;d<g;d++)b[d]=c[d](a);return b}}function y(b,a){for(var c=[],d=0,k=a.length;d<k;d++)c[d]=z(0===d?b:a[d-1],a[d]);d=a[a.length-1];c.push(z(d,d));var e=c.length-1;return function(a){a*=e;var b=Math.floor(a);return(0,c[b])(a-b)}}function t(b,a,c){c=void 0!==c?c:1E4;for(var d=b.slice(),k=[],e=0,h=a.length;e<h;e++){var f=d&&d[e],g=a[e];k[e]="string"===typeof g&&1===g.indexOf("=")?g:null;d[e]=g.nodeType?g:g.update?g:f===g?null:l(g)?l(f)&&g.length===f.length?t(f,g,c):y(f,g):l(f)?x(f,g):"object"===typeof g?u(f,g,c):"string"===typeof g?q(f,g,c):f;a[e]=null!==k[e]?n(f,g):g}var m=Math.min(b.length,a.length);return function(g){for(var f=0;f<m;f++){var e=d[f],h=a[f],p=k[f];null!==e&&(b[f]="number"===typeof e?((e+(h-e)*g)*c|0)/c:"function"===typeof e?e(g):e&&e.update?e.update(g):h&&h.update?h.update(g):h,p&&1===g&&(d[f]=h,a[f]=n(d[f],p)))}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],k=+a[0],e=a[1],h="string"===typeof a[0]&&1===a[0].indexOf("=")?a[0]:null;h&&(k=n(d,k));return function(a){var b=((d+(k-d)*a)*c|0)/c+e;h&&1===a&&(d=k,k=n(d,h));return b}}return!1}function u(b,a,c){c=void 0!==c?c:1E4;var d={},k={},e;for(e in a){k[e]=b&&b[e];var h=k[e],f=a[e];d[e]="string"===typeof f&&1===f.indexOf("=")?f:null;k[e]=f.nodeType?f:f.update?f:h===f?null:l(f)?l(h)&&f.length===h.length?t(h,f,c):y(h,f):l(h)?x(h,f):"object"===typeof f?u(h,f,c):"string"===typeof f?q(h,f,c):h;a[e]=null!==d[e]?n(h,f):f}return function(e){for(var f in a){var g=k[f],h=a[f],l=d[f];null!==g&&(b[f]="number"===typeof g?((g+(h-g)*e)*c|0)/c:"function"===typeof g?g(e):g&&g.update?g.update(e):h&&h.update?h.update(e):h,l&&1===e&&(k[f]=h,a[f]=n(k[f],l)))}return b}}function z(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 a.nodeType?a:b.nodeType?b:l(a)?l(b)&&b.length===a.length?t(b,a,c):y(b,a):l(b)?x(b,a):"object"===typeof a?u(b,a,c):"string"===typeof a?q(b,a,c):"function"===typeof a?a:function(k){var e="number"===typeof a?((b+(a-b)*k)*c|0)/c:b;d&&1===k&&(b+=a,a=n(b,d));return e}}var J=/rgb/g,I=/argb/g,w=/\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 z}"function"===typeof define&&define.c?define([],C):"undefined"!==typeof module&&module.a?module.a=C():v.b=C(); | ||
var v="undefined"!==typeof window?window:this;function C(){function A(b){return"string"!==typeof b?b:("string"===typeof b?b.replace(D,""):b).replace(E,F)}function B(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 k=a[2];a=c+c+d+d+k+k}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(!w.test(a))return a;var d=A(b).match(w).map(B),k=A(a).match(w).map(B);if(b=H(d,k,c))return b;var f=b=null,h=null,e=[];b=0;for(var g=k.length;b<g;b++){var m=k[b],p=d[b];e[b]="string"===typeof m&&1===m.indexOf("=")?a:null;I.test(m)?(f=b+2,h=b+11):J.test(m)&&(f=b,h=b+9);k[b]=p===m?null:null!==e[b]?n(p,m):"number"===typeof m?m-p:m}return function(a){for(var b="",g=0,p=k.length;g<p;g++){var m=d[g],r=k[g],l=e[g];b+="number"===typeof r?null!==f&&g>f&&g<h?m+r*a|0:((m+r*a)*c|0)/c:m;1===a&&null!==l&&(d[g]+=r,k[g]=n(d[g],l))}return b}}function x(b,a){for(var c=[],d=0,k=b.length;d<k;d++){var f=b[d];c[d]=l(f)?t(f,a):"object"===typeof f?u(f,a):"string"===typeof f?q(f,a):f}return function(a){for(var d=0,g=c.length;d<g;d++)b[d]=c[d](a);return b}}function y(b,a){for(var c=[],d=0,k=a.length;d<k;d++)c[d]=z(0===d?b:a[d-1],a[d]);d=a[a.length-1];c.push(z(d,d));var f=c.length-1;return function(a){a*=f;var b=Math.floor(a);return(0,c[b])(a-b)}}function t(b,a,c){c=void 0!==c?c:1E4;for(var d=b.slice(),k=[],f=0,h=a.length;f<h;f++){var e=d&&d[f],g=a[f];k[f]="string"===typeof g&&1===g.indexOf("=")?g:null;d[f]=g.nodeType?g:g.update?g:e===g?null:l(g)?l(e)&&g.length===e.length?t(e,g,c):y(e,g):l(e)?x(e,g):"object"===typeof e?u(e,g,c):"string"===typeof e?q(e,g,c):void 0!==e?e:g;a[f]=null!==k[f]?n(e,g):g}var m=Math.min(b.length,a.length);return function(g){for(var e=0;e<m;e++){var f=d[e],h=a[e],p=k[e];null!==f&&void 0!==f&&(b[e]="number"===typeof f?((f+(h-f)*g)*c|0)/c:"function"===typeof f?f(g):f&&f.update?f.update(g):h&&h.update?h.update(g):h,p&&1===g&&(d[e]=h,a[e]=n(d[e],p)))}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],k=+a[0],f=a[1],h="string"===typeof a[0]&&1===a[0].indexOf("=")?a[0]:null;h&&(k=n(d,k));return function(a){var b=((d+(k-d)*a)*c|0)/c+f;h&&1===a&&(d=k,k=n(d,h));return b}}return!1}function u(b,a,c){c=void 0!==c?c:1E4;var d={},k={},f;for(f in a){k[f]=b&&b[f];var h=k[f],e=a[f];d[f]="string"===typeof e&&1===e.indexOf("=")?e:null;k[f]=e.nodeType?e:e.update?e:h===e?null:l(e)?l(h)&&e.length===h.length?t(h,e,c):y(h,e):l(h)?x(h,e):"object"===typeof h?u(h,e,c):"string"===typeof h?q(h,e,c):void 0!==h?h:e;a[f]=null!==d[f]?n(h,e):e}return function(f){for(var e in a){var g=k[e],h=a[e],l=d[e];null!==g&&void 0!==g&&(b[e]="number"===typeof g?((g+(h-g)*f)*c|0)/c:"function"===typeof g?g(f):g&&g.update?g.update(f):h&&h.update?h.update(f):h,l&&1===f&&(k[e]=h,a[e]=n(k[e],l)))}return b}}function z(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 a.nodeType?a:b.nodeType?b:l(a)?l(b)&&b.length===a.length?t(b,a,c):y(b,a):l(b)?x(b,a):"object"===typeof a?u(b,a,c):"string"===typeof a?q(b,a,c):"function"===typeof a?a:function(k){var f="number"===typeof a?((b+(a-b)*k)*c|0)/c:b;d&&1===k&&(b+=a,a=n(b,d));return f}}var J=/rgb/g,I=/argb/g,w=/\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 z}"function"===typeof define&&define.c?define([],C):"undefined"!==typeof module&&module.a?module.a=C():v.b=C(); |
{ | ||
"name": "intertween", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"description": "The lightweight, fastest, smartest, effecient value interpolator with no-dependecy, zero-configuration and relative interpolation", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
270