Comparing version 5.1.3 to 5.2.0
export const DASH_ALPHA_REGEX = /-([a-z])/g; | ||
export const PROP_NAME_REGEX = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; | ||
export const ESCAPE_CHAR_REGEX = /\\(\\)?/g; |
/*! | ||
* celia.js v5.1.3 | ||
* celia.js v5.2.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* celia.js v5.1.3 | ||
* celia.js v5.2.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* celia.js v5.1.3 | ||
* celia.js v5.2.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* celia.js v5.1.3 | ||
* celia.js v5.2.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -8,2 +8,37 @@ * Released under the MIT License. | ||
function after (obj, method, fn) { | ||
var old = obj[method]; | ||
obj[method] = function () { | ||
old.apply(this, arguments); | ||
fn.call(this); | ||
}; | ||
} | ||
function around (obj, method, fn) { | ||
var old = obj[method]; | ||
obj[method] = function () { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return fn.call(this, old, args); | ||
}; | ||
} | ||
function before (obj, method, fn) { | ||
var old = obj[method]; | ||
obj[method] = function () { | ||
fn.call(this); | ||
old.apply(this, arguments); | ||
}; | ||
} | ||
var aop = { | ||
after: after, | ||
around: around, | ||
before: before | ||
}; | ||
var versions = { | ||
@@ -23,2 +58,4 @@ objectobject: 7, // IE7-8 | ||
var DASH_ALPHA_REGEX = /-([a-z])/g; | ||
var PROP_NAME_REGEX = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; | ||
var ESCAPE_CHAR_REGEX = /\\(\\)?/g; | ||
@@ -117,8 +154,5 @@ function camelCase (value) { | ||
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; | ||
var reEscapeChar = /\\(\\)?/g; | ||
function get (object, path, defaultValue) { | ||
var part; | ||
while (!isNil(object) && (part = rePropName.exec(path))) { | ||
while (!isNil(object) && (part = PROP_NAME_REGEX.exec(path))) { | ||
var match = part[0]; | ||
@@ -128,3 +162,3 @@ var number = part[1]; | ||
var subString = part[3]; | ||
var prop = quote ? subString.replace(reEscapeChar, '$1') : (number || match); | ||
var prop = quote ? subString.replace(ESCAPE_CHAR_REGEX, '$1') : (number || match); | ||
object = object[prop]; | ||
@@ -349,2 +383,3 @@ } | ||
var index = { | ||
aop: aop, | ||
browser: browser, | ||
@@ -351,0 +386,0 @@ camelCase: camelCase, |
/*! | ||
* celia.js v5.1.3 | ||
* celia.js v5.2.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
function after (obj, method, fn) { | ||
var old = obj[method]; | ||
obj[method] = function () { | ||
old.apply(this, arguments); | ||
fn.call(this); | ||
}; | ||
} | ||
function around (obj, method, fn) { | ||
var old = obj[method]; | ||
obj[method] = function () { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return fn.call(this, old, args); | ||
}; | ||
} | ||
function before (obj, method, fn) { | ||
var old = obj[method]; | ||
obj[method] = function () { | ||
fn.call(this); | ||
old.apply(this, arguments); | ||
}; | ||
} | ||
var aop = { | ||
after: after, | ||
around: around, | ||
before: before | ||
}; | ||
var versions = { | ||
@@ -20,2 +55,4 @@ objectobject: 7, // IE7-8 | ||
var DASH_ALPHA_REGEX = /-([a-z])/g; | ||
var PROP_NAME_REGEX = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; | ||
var ESCAPE_CHAR_REGEX = /\\(\\)?/g; | ||
@@ -114,8 +151,5 @@ function camelCase (value) { | ||
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; | ||
var reEscapeChar = /\\(\\)?/g; | ||
function get (object, path, defaultValue) { | ||
var part; | ||
while (!isNil(object) && (part = rePropName.exec(path))) { | ||
while (!isNil(object) && (part = PROP_NAME_REGEX.exec(path))) { | ||
var match = part[0]; | ||
@@ -125,3 +159,3 @@ var number = part[1]; | ||
var subString = part[3]; | ||
var prop = quote ? subString.replace(reEscapeChar, '$1') : (number || match); | ||
var prop = quote ? subString.replace(ESCAPE_CHAR_REGEX, '$1') : (number || match); | ||
object = object[prop]; | ||
@@ -346,2 +380,3 @@ } | ||
var index = { | ||
aop: aop, | ||
browser: browser, | ||
@@ -348,0 +383,0 @@ camelCase: camelCase, |
/*! | ||
* celia.js v5.1.3 | ||
* celia.js v5.2.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -12,2 +12,37 @@ * Released under the MIT License. | ||
function after (obj, method, fn) { | ||
var old = obj[method]; | ||
obj[method] = function () { | ||
old.apply(this, arguments); | ||
fn.call(this); | ||
}; | ||
} | ||
function around (obj, method, fn) { | ||
var old = obj[method]; | ||
obj[method] = function () { | ||
var args = [], len = arguments.length; | ||
while ( len-- ) args[ len ] = arguments[ len ]; | ||
return fn.call(this, old, args); | ||
}; | ||
} | ||
function before (obj, method, fn) { | ||
var old = obj[method]; | ||
obj[method] = function () { | ||
fn.call(this); | ||
old.apply(this, arguments); | ||
}; | ||
} | ||
var aop = { | ||
after: after, | ||
around: around, | ||
before: before | ||
}; | ||
var versions = { | ||
@@ -27,2 +62,4 @@ objectobject: 7, // IE7-8 | ||
var DASH_ALPHA_REGEX = /-([a-z])/g; | ||
var PROP_NAME_REGEX = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; | ||
var ESCAPE_CHAR_REGEX = /\\(\\)?/g; | ||
@@ -121,8 +158,5 @@ function camelCase (value) { | ||
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; | ||
var reEscapeChar = /\\(\\)?/g; | ||
function get (object, path, defaultValue) { | ||
var part; | ||
while (!isNil(object) && (part = rePropName.exec(path))) { | ||
while (!isNil(object) && (part = PROP_NAME_REGEX.exec(path))) { | ||
var match = part[0]; | ||
@@ -132,3 +166,3 @@ var number = part[1]; | ||
var subString = part[3]; | ||
var prop = quote ? subString.replace(reEscapeChar, '$1') : (number || match); | ||
var prop = quote ? subString.replace(ESCAPE_CHAR_REGEX, '$1') : (number || match); | ||
object = object[prop]; | ||
@@ -353,2 +387,3 @@ } | ||
var index = { | ||
aop: aop, | ||
browser: browser, | ||
@@ -355,0 +390,0 @@ camelCase: camelCase, |
/*! | ||
* celia.js v5.1.3 | ||
* celia.js v5.2.0 | ||
* (c) 2018-2019 Jesse Feng | ||
* Released under the MIT License. | ||
*/ | ||
var n,t;n=this,t=function(){"use strict";var n={objectobject:7,objectundefined:6};var t={msie:function(){return document.documentMode||n[typeof document.all+typeof XMLHttpRequest]}},e=/-([a-z])/g;function f(n){return null==n}function r(n){return"function"==typeof n}function o(n){return"number"==typeof n}function u(n){return!f(n)&&o(n.length)&&!r(n)}function a(n,t){return t?n.bind(t):n}function i(n,t,e,r,o){for(var u=a(r,o),i=t,c=void 0;!1!==c&&i<e;i++)c=u(n[i],i,n)}function c(n,t,e){i(n,0,n.length,t,e)}function s(n,t,e,r){var o=a(e,r);for(var u in t)if(!1===n(o,t[u],u))break}function p(r,n,t){s(function(n,t,e){return r.hasOwnProperty(e)&&n(t,e,r)},r,n,t)}function d(n,t,e){for(var r=a(t,e),o=0,u=void 0;!1!==u&&o<n;o++)u=r(o,o,o)}function l(n,t,e){n&&(u(n)?c(n,t,e):o(n)?d(n,t,e):p(n,t,e))}function v(n,t,e){return n&&d(n,t,e)}function b(n){return!f(n)&&"object"==typeof n}function g(n,t,e){return b(n)&&p(n,t,e)}function m(n){return void 0===n}var y=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,j=/\\(\\)?/g;function h(n,t,e){for(var r;!f(n)&&(r=y.exec(t));){var o=r[0],u=r[1],i=r[2],c=r[3];n=n[i?c.replace(j,"$1"):u||o]}return m(n)?e:n}var w="celia_uid_"+(1e9*Math.random()>>>0),x=0;var A=Object.prototype.toString;function O(n){return A.call(n)}function C(n){return"string"==typeof n}function E(n,t){return n[n.length]=t,n}function N(n,t,e,r){var o=[],u=a(e,r);return n(t,function(n,t){f(n=u(n,t))||E(o,n)}),o}var R={forNumber:v,map:function(n,t,e){return N(v,n,t,e)}};var U={assign:Object.assign||function(n){if(f(n))throw new TypeError("Cannot convert undefined or null to object");var e=Object(n);return i(arguments,1,arguments.length,function(n){g(n,function(n,t){e[t]=n})}),e},forIn:function(n,t,e){return b(n)&&function(r,n,t){s(function(n,t,e){return n(t,e,r)},r,n,t)}(n,t,e)},forOwn:g,get:h,map:function(n,t,e){return N(g,n,t,e)}};function F(n){return decodeURIComponent(n.replace(/\+/g," "))}var I=/([^=?&]+)=?([^&]*)/g,L=Array.isArray;var S={parse:function(n){var t={};if(C(n))for(var e;e=I.exec(n);){var r=e[1];if(e[0]!==r){var o=e[2],u=t[r];m(u)?t[r]=F(o):L(u)?E(u,F(o)):t[r]=[u,F(o)]}}return t},prefix:function(n,t){return n?(t||"?")+n:n},stringify:function(n,t,e){void 0===t&&(t="&"),void 0===e&&(e="=");var r=[];return g(n,function(n,t){n||!f(n)&&!isNaN(n)||(n=""),E(r,encodeURIComponent(t)+e+encodeURIComponent(n))}),r.length?r.join(t):""}};var k={};"Boolean,Number,String,Function,AsyncFunction,Array,Date,RegExp,Object,Error,Symbol".split(",").forEach(function(n){k["[object "+n+"]"]=n.toLowerCase()});var z={isAbsolute:function(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)},join:function(n){var t=arguments.length;f(n)?1<t&&(n=""):n=n.replace(/\/+$/,"");var e="";return i(arguments,1,t,function(n){n&&(e+="/",e+=n)}),e&&(n+=e.replace(/\/+/g,"/")),n}};return{browser:t,camelCase:function(n){return n.replace(e,function(n,t){return t.toUpperCase()})},each:l,forEach:function(n,t,e){return n&&c(n,t,e)},forNumber:v,forOwn:g,get:h,getUid:function(n){return n[w]||(n[w]=++x)},isArrayLike:u,isAsyncFunction:function(n){return"[object AsyncFunction]"===O(n)},isBoolean:function(n){return"boolean"==typeof n},isDate:function(n){return"[object Date]"===O(n)},isFunction:r,isNil:f,isNumber:o,isObject:b,isPromiseLike:function(n){return!!n&&r(n.then)},isRegExp:function(n){return"[object RegExp]"===O(n)},isString:C,isUndefined:m,isWindow:function(n){return n&&n===n.window},map:function(n,t,e){return N(l,n,t,e)},number:R,object:U,qs:S,sleep:function(t){return new Promise(function(n){setTimeout(n,t)})},type:function(n){return f(n)?n+"":b(n)||r(n)?k[O(n)]||"object":typeof n},url:z}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n=n||self).celia=t(); | ||
var n,t;n=this,t=function(){"use strict";var n={after:function(n,t,e){var r=n[t];n[t]=function(){r.apply(this,arguments),e.call(this)}},around:function(n,t,e){var r=n[t];n[t]=function(){for(var n=[],t=arguments.length;t--;)n[t]=arguments[t];return e.call(this,r,n)}},before:function(n,t,e){var r=n[t];n[t]=function(){e.call(this),r.apply(this,arguments)}}},t={objectobject:7,objectundefined:6};var e={msie:function(){return document.documentMode||t[typeof document.all+typeof XMLHttpRequest]}},r=/-([a-z])/g,f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g;function s(n){return null==n}function o(n){return"function"==typeof n}function i(n){return"number"==typeof n}function u(n){return!s(n)&&i(n.length)&&!o(n)}function p(n,t){return t?n.bind(t):n}function c(n,t,e,r,o){for(var i=p(r,o),u=t,c=void 0;!1!==c&&u<e;u++)c=i(n[u],u,n)}function l(n,t,e){c(n,0,n.length,t,e)}function d(n,t,e,r){var o=p(e,r);for(var i in t)if(!1===n(o,t[i],i))break}function v(r,n,t){d(function(n,t,e){return r.hasOwnProperty(e)&&n(t,e,r)},r,n,t)}function b(n,t,e){for(var r=p(t,e),o=0,i=void 0;!1!==i&&o<n;o++)i=r(o,o,o)}function g(n,t,e){n&&(u(n)?l(n,t,e):i(n)?b(n,t,e):v(n,t,e))}function y(n,t,e){return n&&b(n,t,e)}function m(n){return!s(n)&&"object"==typeof n}function h(n,t,e){return m(n)&&v(n,t,e)}function j(n){return void 0===n}function w(n,t,e){for(var r;!s(n)&&(r=f.exec(t));){var o=r[0],i=r[1],u=r[2],c=r[3];n=n[u?c.replace(a,"$1"):i||o]}return j(n)?e:n}var x="celia_uid_"+(1e9*Math.random()>>>0),A=0;var O=Object.prototype.toString;function C(n){return O.call(n)}function E(n){return"string"==typeof n}function N(n,t){return n[n.length]=t,n}function R(n,t,e,r){var o=[],i=p(e,r);return n(t,function(n,t){s(n=i(n,t))||N(o,n)}),o}var U={forNumber:y,map:function(n,t,e){return R(y,n,t,e)}};var F={assign:Object.assign||function(n){if(s(n))throw new TypeError("Cannot convert undefined or null to object");var e=Object(n);return c(arguments,1,arguments.length,function(n){h(n,function(n,t){e[t]=n})}),e},forIn:function(n,t,e){return m(n)&&function(r,n,t){d(function(n,t,e){return n(t,e,r)},r,n,t)}(n,t,e)},forOwn:h,get:w,map:function(n,t,e){return R(h,n,t,e)}};function I(n){return decodeURIComponent(n.replace(/\+/g," "))}var L=/([^=?&]+)=?([^&]*)/g,S=Array.isArray;var k={parse:function(n){var t={};if(E(n))for(var e;e=L.exec(n);){var r=e[1];if(e[0]!==r){var o=e[2],i=t[r];j(i)?t[r]=I(o):S(i)?N(i,I(o)):t[r]=[i,I(o)]}}return t},prefix:function(n,t){return n?(t||"?")+n:n},stringify:function(n,t,e){void 0===t&&(t="&"),void 0===e&&(e="=");var r=[];return h(n,function(n,t){n||!s(n)&&!isNaN(n)||(n=""),N(r,encodeURIComponent(t)+e+encodeURIComponent(n))}),r.length?r.join(t):""}};var z={};"Boolean,Number,String,Function,AsyncFunction,Array,Date,RegExp,Object,Error,Symbol".split(",").forEach(function(n){z["[object "+n+"]"]=n.toLowerCase()});var D={isAbsolute:function(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)},join:function(n){var t=arguments.length;s(n)?1<t&&(n=""):n=n.replace(/\/+$/,"");var e="";return c(arguments,1,t,function(n){n&&(e+="/",e+=n)}),e&&(n+=e.replace(/\/+/g,"/")),n}};return{aop:n,browser:e,camelCase:function(n){return n.replace(r,function(n,t){return t.toUpperCase()})},each:g,forEach:function(n,t,e){return n&&l(n,t,e)},forNumber:y,forOwn:h,get:w,getUid:function(n){return n[x]||(n[x]=++A)},isArrayLike:u,isAsyncFunction:function(n){return"[object AsyncFunction]"===C(n)},isBoolean:function(n){return"boolean"==typeof n},isDate:function(n){return"[object Date]"===C(n)},isFunction:o,isNil:s,isNumber:i,isObject:m,isPromiseLike:function(n){return!!n&&o(n.then)},isRegExp:function(n){return"[object RegExp]"===C(n)},isString:E,isUndefined:j,isWindow:function(n){return n&&n===n.window},map:function(n,t,e){return R(g,n,t,e)},number:U,object:F,qs:k,sleep:function(t){return new Promise(function(n){setTimeout(n,t)})},type:function(n){return s(n)?n+"":m(n)||o(n)?z[C(n)]||"object":typeof n},url:D}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n=n||self).celia=t(); |
/*! | ||
* celia.js v5.1.3 | ||
* celia.js v5.2.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* celia.js v5.1.3 | ||
* celia.js v5.2.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* celia.js v5.1.3 | ||
* celia.js v5.2.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* celia.js v5.1.3 | ||
* celia.js v5.2.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -79,8 +79,8 @@ * Released under the MIT License. | ||
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; | ||
var reEscapeChar = /\\(\\)?/g; | ||
var PROP_NAME_REGEX = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; | ||
var ESCAPE_CHAR_REGEX = /\\(\\)?/g; | ||
function get (object, path, defaultValue) { | ||
var part; | ||
while (!isNil(object) && (part = rePropName.exec(path))) { | ||
while (!isNil(object) && (part = PROP_NAME_REGEX.exec(path))) { | ||
var match = part[0]; | ||
@@ -90,3 +90,3 @@ var number = part[1]; | ||
var subString = part[3]; | ||
var prop = quote ? subString.replace(reEscapeChar, '$1') : (number || match); | ||
var prop = quote ? subString.replace(ESCAPE_CHAR_REGEX, '$1') : (number || match); | ||
object = object[prop]; | ||
@@ -93,0 +93,0 @@ } |
/*! | ||
* celia.js v5.1.3 | ||
* celia.js v5.2.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -83,8 +83,8 @@ * Released under the MIT License. | ||
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; | ||
var reEscapeChar = /\\(\\)?/g; | ||
var PROP_NAME_REGEX = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; | ||
var ESCAPE_CHAR_REGEX = /\\(\\)?/g; | ||
function get (object, path, defaultValue) { | ||
var part; | ||
while (!isNil(object) && (part = rePropName.exec(path))) { | ||
while (!isNil(object) && (part = PROP_NAME_REGEX.exec(path))) { | ||
var match = part[0]; | ||
@@ -94,3 +94,3 @@ var number = part[1]; | ||
var subString = part[3]; | ||
var prop = quote ? subString.replace(reEscapeChar, '$1') : (number || match); | ||
var prop = quote ? subString.replace(ESCAPE_CHAR_REGEX, '$1') : (number || match); | ||
object = object[prop]; | ||
@@ -97,0 +97,0 @@ } |
/*! | ||
* celia.js v5.1.3 | ||
* celia.js v5.2.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* celia.js v5.1.3 | ||
* celia.js v5.2.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* celia.js v5.1.3 | ||
* celia.js v5.2.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* celia.js v5.1.3 | ||
* celia.js v5.2.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* celia.js v5.1.3 | ||
* celia.js v5.2.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* celia.js v5.1.3 | ||
* celia.js v5.2.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* celia.js v5.1.3 | ||
* celia.js v5.2.0 | ||
* (c) 2018-2019 Jesse Feng | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
import isNil from './isNil'; | ||
import isUndefined from './isUndefined'; | ||
import { PROP_NAME_REGEX, ESCAPE_CHAR_REGEX } from './_internal/_regex'; | ||
const rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; | ||
const reEscapeChar = /\\(\\)?/g; | ||
export default function (object, path, defaultValue) { | ||
let part; | ||
while (!isNil(object) && (part = rePropName.exec(path))) { | ||
while (!isNil(object) && (part = PROP_NAME_REGEX.exec(path))) { | ||
const [match, number, quote, subString] = part; | ||
const prop = quote ? subString.replace(reEscapeChar, '$1') : (number || match); | ||
const prop = quote ? subString.replace(ESCAPE_CHAR_REGEX, '$1') : (number || match); | ||
object = object[prop]; | ||
@@ -13,0 +11,0 @@ } |
@@ -0,1 +1,2 @@ | ||
import aop from './aop.js'; | ||
import browser from './browser.js'; | ||
@@ -30,2 +31,3 @@ import camelCase from './camelCase.js'; | ||
export default { | ||
aop, | ||
browser, | ||
@@ -32,0 +34,0 @@ camelCase, |
{ | ||
"name": "celia", | ||
"version": "5.1.3", | ||
"version": "5.2.0", | ||
"description": "A modern JavaScript utility library delivering modularity, performance, & extras.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/celia.c.js", |
@@ -7,2 +7,4 @@ # celia | ||
[![NPM version](https://img.shields.io/npm/v/celia.svg?style=flat)](https://npmjs.org/package/celia) [![NPM Downloads](https://img.shields.io/npm/dm/celia.svg?style=flat)](https://npmjs.org/package/celia) | ||
--- | ||
@@ -91,2 +93,5 @@ | ||
- type | ||
- aop/after | ||
- aop/around | ||
- aop/before | ||
- browser/msie | ||
@@ -93,0 +98,0 @@ - number/forNumber |
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
73387
87
2232
110