pathington
Advanced tools
Comparing version 1.1.0 to 1.1.1
# pathington CHANGELOG | ||
## 1.1.1 | ||
* Improve performance of `isQuotedKey` test | ||
## 1.1.0 | ||
@@ -4,0 +8,0 @@ |
@@ -84,3 +84,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return INVALID_JAVASCRIPT_LEADING_CHARACTER; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return QUOTES_REGEXP; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return QUOTES; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return WHITE_SPACE; }); | ||
@@ -103,5 +103,5 @@ /** | ||
/** | ||
* @constant {RegExp} QUOTES_REGEXP | ||
* @constant {RegExp} QUOTES | ||
*/ | ||
var QUOTES_REGEXP = /['|"|`]/; | ||
var QUOTES = ['"', "'", '`']; | ||
@@ -146,3 +146,3 @@ /** | ||
if (quote && (quote.length !== 1 || !__WEBPACK_IMPORTED_MODULE_0__constants__["d" /* QUOTES_REGEXP */].test(quote))) { | ||
if (quote && !~__WEBPACK_IMPORTED_MODULE_0__constants__["d" /* QUOTES */].indexOf(quote)) { | ||
throw new SyntaxError('quote passed is invalid, must be ", `, or \'.'); | ||
@@ -201,3 +201,3 @@ } | ||
var isQuotedKey = function isQuotedKey(key) { | ||
return __WEBPACK_IMPORTED_MODULE_0__constants__["d" /* QUOTES_REGEXP */].test(key[0]) && key[0] === key[key.length - 1]; | ||
return key[0] === key[key.length - 1] && !!~__WEBPACK_IMPORTED_MODULE_0__constants__["d" /* QUOTES */].indexOf(key[0]); | ||
}; | ||
@@ -204,0 +204,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(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)})([(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=/[a-zA-Z0-9_$]+|"[^"]+"|`[^`]+`|'[^']+'/g,o=/[^A-Za-z0-9_$]/,u=/[^A-Za-z_$]/,i=/['|"|`]/,f=/\s/g,a=function(e){return i.test(e[0])&&e[0]===e[e.length-1]},s=function(e){return"number"==typeof e||!isNaN(+e)||a(e)},c=function(e){return o.test(e)||f.test(e)||e.length>1&&u.test(e[0])},p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'"';return function(t,n){var r=c(n)?""+e+n+e:n;return s(r)?t+"["+r+"]":t+"."+r}},d=function(e){return a(e)?e.slice(1,-1):isNaN(+e)?e:+e};n.d(t,"create",(function(){return l})),n.d(t,"parse",(function(){return y}));var l=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(t&&(1!==t.length||!i.test(t)))throw new SyntaxError("quote passed is invalid, must be \", `, or '.");var n=e.reduce(p(t),"");return"."===n[0]?n.slice(1):n},y=function(e){return Array.isArray(e)?e.map(d):"string"==typeof e?~e.indexOf(".")||~e.indexOf("[")?e.match(r).map(d):[e]:["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(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)})([(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=/[a-zA-Z0-9_$]+|"[^"]+"|`[^`]+`|'[^']+'/g,o=/[^A-Za-z0-9_$]/,u=/[^A-Za-z_$]/,i=['"',"'","`"],f=/\s/g,a=function(e){return e[0]===e[e.length-1]&&!!~i.indexOf(e[0])},c=function(e){return"number"==typeof e||!isNaN(+e)||a(e)},s=function(e){return o.test(e)||f.test(e)||e.length>1&&u.test(e[0])},p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'"';return function(t,n){var r=s(n)?""+e+n+e:n;return c(r)?t+"["+r+"]":t+"."+r}},d=function(e){return a(e)?e.slice(1,-1):isNaN(+e)?e:+e};n.d(t,"create",(function(){return l})),n.d(t,"parse",(function(){return y}));var l=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(t&&!~i.indexOf(t))throw new SyntaxError("quote passed is invalid, must be \", `, or '.");var n=e.reduce(p(t),"");return"."===n[0]?n.slice(1):n},y=function(e){return Array.isArray(e)?e.map(d):"string"==typeof e?~e.indexOf(".")||~e.indexOf("[")?e.match(r).map(d):[e]:["number"==typeof e?e:""+e]}})])})); |
@@ -17,5 +17,5 @@ /** | ||
/** | ||
* @constant {RegExp} QUOTES_REGEXP | ||
* @constant {RegExp} QUOTES | ||
*/ | ||
export var QUOTES_REGEXP = /['|"|`]/; | ||
export var QUOTES = ['"', "'", '`']; | ||
@@ -22,0 +22,0 @@ /** |
// constants | ||
import { DOTTY_WITH_BRACKETS_SYNTAX_REGEXP, QUOTES_REGEXP } from './constants'; | ||
import { DOTTY_WITH_BRACKETS_SYNTAX_REGEXP, QUOTES } from './constants'; | ||
@@ -24,3 +24,3 @@ // utils | ||
if (quote && (quote.length !== 1 || !QUOTES_REGEXP.test(quote))) { | ||
if (quote && !~QUOTES.indexOf(quote)) { | ||
throw new SyntaxError('quote passed is invalid, must be ", `, or \'.'); | ||
@@ -27,0 +27,0 @@ } |
// constants | ||
import { QUOTES_REGEXP, INVALID_JAVASCRIPT_CHARACTERS, INVALID_JAVASCRIPT_LEADING_CHARACTER, WHITE_SPACE } from './constants'; | ||
import { INVALID_JAVASCRIPT_CHARACTERS, INVALID_JAVASCRIPT_LEADING_CHARACTER, QUOTES, WHITE_SPACE } from './constants'; | ||
@@ -14,3 +14,3 @@ /** | ||
export var isQuotedKey = function isQuotedKey(key) { | ||
return QUOTES_REGEXP.test(key[0]) && key[0] === key[key.length - 1]; | ||
return key[0] === key[key.length - 1] && !!~QUOTES.indexOf(key[0]); | ||
}; | ||
@@ -17,0 +17,0 @@ |
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
'use strict'; | ||
@@ -20,5 +20,5 @@ exports.__esModule = true; | ||
/** | ||
* @constant {RegExp} QUOTES_REGEXP | ||
* @constant {RegExp} QUOTES | ||
*/ | ||
var QUOTES_REGEXP = exports.QUOTES_REGEXP = /['|"|`]/; | ||
var QUOTES = exports.QUOTES = ['"', "'", '`']; | ||
@@ -25,0 +25,0 @@ /** |
@@ -28,3 +28,3 @@ 'use strict'; | ||
if (quote && (quote.length !== 1 || !_constants.QUOTES_REGEXP.test(quote))) { | ||
if (quote && !~_constants.QUOTES.indexOf(quote)) { | ||
throw new SyntaxError('quote passed is invalid, must be ", `, or \'.'); | ||
@@ -31,0 +31,0 @@ } |
@@ -18,3 +18,3 @@ 'use strict'; | ||
var isQuotedKey = exports.isQuotedKey = function isQuotedKey(key) { | ||
return _constants.QUOTES_REGEXP.test(key[0]) && key[0] === key[key.length - 1]; | ||
return key[0] === key[key.length - 1] && !!~_constants.QUOTES.indexOf(key[0]); | ||
}; | ||
@@ -21,0 +21,0 @@ |
@@ -90,3 +90,3 @@ { | ||
}, | ||
"version": "1.1.0" | ||
"version": "1.1.1" | ||
} |
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
249478