pathington
Advanced tools
Comparing version 1.1.4 to 1.1.5
# pathington CHANGELOG | ||
## 1.1.5 | ||
* Simplify valid key regex (reduce filesize) | ||
## 1.1.4 | ||
@@ -4,0 +8,0 @@ |
@@ -83,9 +83,8 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return DOTTY_WITH_BRACKETS_SYNTAX; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return INVALID_CHARACTERS; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return INVALID_FIRST_CHARACTER; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return MAX_CACHE_SIZE; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return NUMBER; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return QUOTED_KEY; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return VALID_QUOTES; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return WHITE_SPACE; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return MAX_CACHE_SIZE; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return NUMBER; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return QUOTED_KEY; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return VALID_QUOTES; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return VALID_KEY; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return WHITE_SPACE; }); | ||
/** | ||
@@ -114,12 +113,2 @@ * @constant {Object} CACHE | ||
/** | ||
* @constant {RegExp} INVALID_CHARACTERS | ||
*/ | ||
var INVALID_CHARACTERS = /[^\w$]/; | ||
/** | ||
* @constant {RegExp} INVALID_FIRST_CHARACTER | ||
*/ | ||
var INVALID_FIRST_CHARACTER = /[^A-Za-z_$]/; | ||
/** | ||
* @constant {number} MAX_CACHE_SIZE | ||
@@ -145,2 +134,7 @@ */ | ||
/** | ||
* @constant {RegExp} VALID_KEY | ||
*/ | ||
var VALID_KEY = /^\d+$|^[a-zA-Z_$][\w$]+$/; | ||
/** | ||
* @constant {RegExp} WHITE_SPACE | ||
@@ -183,3 +177,3 @@ */ | ||
if (!__WEBPACK_IMPORTED_MODULE_0__constants__["h" /* VALID_QUOTES */].test(quote)) { | ||
if (!__WEBPACK_IMPORTED_MODULE_0__constants__["g" /* VALID_QUOTES */].test(quote)) { | ||
throw new SyntaxError('quote ' + quote + ' passed is invalid, must be ", `, or \'.'); | ||
@@ -240,3 +234,3 @@ } | ||
var isNumericKey = function isNumericKey(key) { | ||
return !!key.length && __WEBPACK_IMPORTED_MODULE_0__constants__["f" /* NUMBER */].test(key); | ||
return !!key.length && __WEBPACK_IMPORTED_MODULE_0__constants__["d" /* NUMBER */].test(key); | ||
}; | ||
@@ -254,3 +248,3 @@ | ||
var isQuotedKey = function isQuotedKey(key) { | ||
return __WEBPACK_IMPORTED_MODULE_0__constants__["g" /* QUOTED_KEY */].test(key); | ||
return __WEBPACK_IMPORTED_MODULE_0__constants__["e" /* QUOTED_KEY */].test(key); | ||
}; | ||
@@ -281,3 +275,3 @@ | ||
var shouldBeInQuotes = function shouldBeInQuotes(key) { | ||
return __WEBPACK_IMPORTED_MODULE_0__constants__["c" /* INVALID_CHARACTERS */].test(key) || __WEBPACK_IMPORTED_MODULE_0__constants__["i" /* WHITE_SPACE */].test(key) || !!key[0] && __WEBPACK_IMPORTED_MODULE_0__constants__["d" /* INVALID_FIRST_CHARACTER */].test(key[0]); | ||
return __WEBPACK_IMPORTED_MODULE_0__constants__["h" /* WHITE_SPACE */].test(key) || !__WEBPACK_IMPORTED_MODULE_0__constants__["f" /* VALID_KEY */].test(key); | ||
}; | ||
@@ -331,3 +325,3 @@ | ||
if (__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* CACHE */].size > __WEBPACK_IMPORTED_MODULE_0__constants__["e" /* MAX_CACHE_SIZE */]) { | ||
if (__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* CACHE */].size > __WEBPACK_IMPORTED_MODULE_0__constants__["c" /* MAX_CACHE_SIZE */]) { | ||
__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* CACHE */].clear(); | ||
@@ -334,0 +328,0 @@ } |
@@ -1,1 +0,1 @@ | ||
!(function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("pathington",[],t):"object"==typeof exports?exports.pathington=t():e.pathington=t()})("undefined"!=typeof self?self:this,(function(){return (function(e){function t(n){if(r[n])return r[n].exports;var u=r[n]={i:n,l:!1,exports:{}};return e[n].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)})([(function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={clear:function(){n.results={},n.size=0},results:{},size:0},u=/"[^"]+"|`[^`]+`|'[^']+'|[^.[\]]+/g,o=/[^\w$]/,s=/[^A-Za-z_$]/,i=/^\d+$/i,f=/^"[^"]+"|`[^`]+`|'[^']+'$/,c=/^["'`]{1}$/,a=/\s/,p=function(e){return!!e.length&&i.test(e)},l=function(e){return f.test(e)},d=function(e){return"number"==typeof e||p(e)||l(e)},y=function(e){return o.test(e)||a.test(e)||!!e[0]&&s.test(e[0])},b=function(e){return function(t,r){var n=y(r)?""+e+r+e:r;return d(n)?t+"["+n+"]":t+"."+n}},h=function(e){var t=l(e)?e.substring(1,e.length-1):e;return p(t)?+t:t},m=function(e){return n.results[e]?n.results[e]:(n.size>500&&n.clear(),n.results[e]=e?e.match(u).map(h):[e],n.size++,n.results[e])};r.d(t,"create",(function(){return v})),r.d(t,"parse",(function(){return g}));var v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:'"';if(!Array.isArray(e))throw new ReferenceError("path passed must be an array");if(!c.test(t))throw new SyntaxError("quote "+t+" passed is invalid, must be \", `, or '.");var r=e.reduce(b(t),"");return"."===r[0]?r.slice(1):r},g=function(e){return"string"==typeof e?m(e):Array.isArray(e)?e.map(h):["number"==typeof e?e:""+e]}})])})); | ||
!(function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("pathington",[],t):"object"==typeof exports?exports.pathington=t():e.pathington=t()})("undefined"!=typeof self?self:this,(function(){return (function(e){function t(n){if(r[n])return r[n].exports;var u=r[n]={i:n,l:!1,exports:{}};return e[n].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)})([(function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={clear:function(){n.results={},n.size=0},results:{},size:0},u=/"[^"]+"|`[^`]+`|'[^']+'|[^.[\]]+/g,o=/^\d+$/i,i=/^"[^"]+"|`[^`]+`|'[^']+'$/,s=/^["'`]{1}$/,f=/^\d+$|^[a-zA-Z_$][\w$]+$/,c=/\s/,a=function(e){return!!e.length&&o.test(e)},p=function(e){return i.test(e)},l=function(e){return"number"==typeof e||a(e)||p(e)},d=function(e){return c.test(e)||!f.test(e)},y=function(e){return function(t,r){var n=d(r)?""+e+r+e:r;return l(n)?t+"["+n+"]":t+"."+n}},b=function(e){var t=p(e)?e.substring(1,e.length-1):e;return a(t)?+t:t},h=function(e){return n.results[e]?n.results[e]:(n.size>500&&n.clear(),n.results[e]=e?e.match(u).map(b):[e],n.size++,n.results[e])};r.d(t,"create",(function(){return m})),r.d(t,"parse",(function(){return v}));var m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:'"';if(!Array.isArray(e))throw new ReferenceError("path passed must be an array");if(!s.test(t))throw new SyntaxError("quote "+t+" passed is invalid, must be \", `, or '.");var r=e.reduce(y(t),"");return"."===r[0]?r.slice(1):r},v=function(e){return"string"==typeof e?h(e):Array.isArray(e)?e.map(b):["number"==typeof e?e:""+e]}})])})); |
@@ -24,12 +24,2 @@ /** | ||
/** | ||
* @constant {RegExp} INVALID_CHARACTERS | ||
*/ | ||
export var INVALID_CHARACTERS = /[^\w$]/; | ||
/** | ||
* @constant {RegExp} INVALID_FIRST_CHARACTER | ||
*/ | ||
export var INVALID_FIRST_CHARACTER = /[^A-Za-z_$]/; | ||
/** | ||
* @constant {number} MAX_CACHE_SIZE | ||
@@ -55,4 +45,9 @@ */ | ||
/** | ||
* @constant {RegExp} VALID_KEY | ||
*/ | ||
export var VALID_KEY = /^\d+$|^[a-zA-Z_$][\w$]+$/; | ||
/** | ||
* @constant {RegExp} WHITE_SPACE | ||
*/ | ||
export var WHITE_SPACE = /\s/; |
// constants | ||
import { CACHE, DOTTY_WITH_BRACKETS_SYNTAX, INVALID_CHARACTERS, INVALID_FIRST_CHARACTER, MAX_CACHE_SIZE, NUMBER, QUOTED_KEY, WHITE_SPACE } from './constants'; | ||
import { CACHE, DOTTY_WITH_BRACKETS_SYNTAX, MAX_CACHE_SIZE, NUMBER, QUOTED_KEY, VALID_KEY, WHITE_SPACE } from './constants'; | ||
@@ -53,3 +53,3 @@ /** | ||
export var shouldBeInQuotes = function shouldBeInQuotes(key) { | ||
return INVALID_CHARACTERS.test(key) || WHITE_SPACE.test(key) || !!key[0] && INVALID_FIRST_CHARACTER.test(key[0]); | ||
return WHITE_SPACE.test(key) || !VALID_KEY.test(key); | ||
}; | ||
@@ -56,0 +56,0 @@ |
@@ -27,12 +27,2 @@ "use strict"; | ||
/** | ||
* @constant {RegExp} INVALID_CHARACTERS | ||
*/ | ||
var INVALID_CHARACTERS = exports.INVALID_CHARACTERS = /[^\w$]/; | ||
/** | ||
* @constant {RegExp} INVALID_FIRST_CHARACTER | ||
*/ | ||
var INVALID_FIRST_CHARACTER = exports.INVALID_FIRST_CHARACTER = /[^A-Za-z_$]/; | ||
/** | ||
* @constant {number} MAX_CACHE_SIZE | ||
@@ -58,4 +48,9 @@ */ | ||
/** | ||
* @constant {RegExp} VALID_KEY | ||
*/ | ||
var VALID_KEY = exports.VALID_KEY = /^\d+$|^[a-zA-Z_$][\w$]+$/; | ||
/** | ||
* @constant {RegExp} WHITE_SPACE | ||
*/ | ||
var WHITE_SPACE = exports.WHITE_SPACE = /\s/; |
@@ -58,3 +58,3 @@ 'use strict'; | ||
var shouldBeInQuotes = exports.shouldBeInQuotes = function shouldBeInQuotes(key) { | ||
return _constants.INVALID_CHARACTERS.test(key) || _constants.WHITE_SPACE.test(key) || !!key[0] && _constants.INVALID_FIRST_CHARACTER.test(key[0]); | ||
return _constants.WHITE_SPACE.test(key) || !_constants.VALID_KEY.test(key); | ||
}; | ||
@@ -61,0 +61,0 @@ |
@@ -90,3 +90,3 @@ { | ||
}, | ||
"version": "1.1.4" | ||
"version": "1.1.5" | ||
} |
Sorry, the diff of this file is not supported yet
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
255471
662