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