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