From c4bd169a8fe24342c7ef50568ac05c83f7ea3a06 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 30 Jul 2016 16:50:03 -0700 Subject: [PATCH] Bump to v4.10.1. --- README.md | 2 +- lodash.update/README.md | 4 ++-- lodash.update/index.js | 10 ++++++++-- lodash.update/package.json | 2 +- lodash.updatewith/README.md | 4 ++-- lodash.updatewith/index.js | 10 ++++++++-- lodash.updatewith/package.json | 2 +- 7 files changed, 23 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 7074f71d9..1651046b2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# lodash v4.10.0 +# lodash v4.10.1 The [lodash](https://lodash.com/) library exported as [npm packages](https://www.npmjs.com/browse/keyword/lodash-modularized) per method. diff --git a/lodash.update/README.md b/lodash.update/README.md index 37ae08aaa..d4725616c 100644 --- a/lodash.update/README.md +++ b/lodash.update/README.md @@ -1,4 +1,4 @@ -# lodash.update v4.10.0 +# lodash.update v4.10.1 The [lodash](https://lodash.com/) method `_.update` exported as a [Node.js](https://nodejs.org/) module. @@ -15,4 +15,4 @@ In Node.js: var update = require('lodash.update'); ``` -See the [documentation](https://lodash.com/docs#update) or [package source](https://github.com/lodash/lodash/blob/4.10.0-npm-packages/lodash.update) for more details. +See the [documentation](https://lodash.com/docs#update) or [package source](https://github.com/lodash/lodash/blob/4.10.1-npm-packages/lodash.update) for more details. diff --git a/lodash.update/index.js b/lodash.update/index.js index 53c3fb39b..5e97888a0 100644 --- a/lodash.update/index.js +++ b/lodash.update/index.js @@ -25,7 +25,8 @@ var funcTag = '[object Function]', /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(\.|\[\])(?:\4|$))/g; + reLeadingDot = /^\./, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; /** * Used to match `RegExp` @@ -693,8 +694,13 @@ function isMasked(func) { * @returns {Array} Returns the property path array. */ var stringToPath = memoize(function(string) { + string = toString(string); + var result = []; - toString(string).replace(rePropName, function(match, number, quote, string) { + if (reLeadingDot.test(string)) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, string) { result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); }); return result; diff --git a/lodash.update/package.json b/lodash.update/package.json index 230c4772e..1d075f6af 100644 --- a/lodash.update/package.json +++ b/lodash.update/package.json @@ -1,6 +1,6 @@ { "name": "lodash.update", - "version": "4.10.0", + "version": "4.10.1", "description": "The lodash method `_.update` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", diff --git a/lodash.updatewith/README.md b/lodash.updatewith/README.md index b4c30ca88..4eb8524d9 100644 --- a/lodash.updatewith/README.md +++ b/lodash.updatewith/README.md @@ -1,4 +1,4 @@ -# lodash.updatewith v4.10.0 +# lodash.updatewith v4.10.1 The [lodash](https://lodash.com/) method `_.updateWith` exported as a [Node.js](https://nodejs.org/) module. @@ -15,4 +15,4 @@ In Node.js: var updateWith = require('lodash.updatewith'); ``` -See the [documentation](https://lodash.com/docs#updateWith) or [package source](https://github.com/lodash/lodash/blob/4.10.0-npm-packages/lodash.updatewith) for more details. +See the [documentation](https://lodash.com/docs#updateWith) or [package source](https://github.com/lodash/lodash/blob/4.10.1-npm-packages/lodash.updatewith) for more details. diff --git a/lodash.updatewith/index.js b/lodash.updatewith/index.js index 03cd9d04c..479b70777 100644 --- a/lodash.updatewith/index.js +++ b/lodash.updatewith/index.js @@ -25,7 +25,8 @@ var funcTag = '[object Function]', /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(\.|\[\])(?:\4|$))/g; + reLeadingDot = /^\./, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; /** * Used to match `RegExp` @@ -693,8 +694,13 @@ function isMasked(func) { * @returns {Array} Returns the property path array. */ var stringToPath = memoize(function(string) { + string = toString(string); + var result = []; - toString(string).replace(rePropName, function(match, number, quote, string) { + if (reLeadingDot.test(string)) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, string) { result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); }); return result; diff --git a/lodash.updatewith/package.json b/lodash.updatewith/package.json index d7b35b91b..711439715 100644 --- a/lodash.updatewith/package.json +++ b/lodash.updatewith/package.json @@ -1,6 +1,6 @@ { "name": "lodash.updatewith", - "version": "4.10.0", + "version": "4.10.1", "description": "The lodash method `_.updateWith` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg",