mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
react app
This commit is contained in:
28
react-app/node_modules/lodash/internal/toPath.js
generated
vendored
Normal file
28
react-app/node_modules/lodash/internal/toPath.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
var baseToString = require('./baseToString'),
|
||||
isArray = require('../lang/isArray');
|
||||
|
||||
/** Used to match property names within property paths. */
|
||||
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
|
||||
|
||||
/** Used to match backslashes in property paths. */
|
||||
var reEscapeChar = /\\(\\)?/g;
|
||||
|
||||
/**
|
||||
* Converts `value` to property path array if it's not one.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to process.
|
||||
* @returns {Array} Returns the property path array.
|
||||
*/
|
||||
function toPath(value) {
|
||||
if (isArray(value)) {
|
||||
return value;
|
||||
}
|
||||
var result = [];
|
||||
baseToString(value).replace(rePropName, function(match, number, quote, string) {
|
||||
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = toPath;
|
Reference in New Issue
Block a user