mirror of
https://github.com/JonasunderscoreJones/jonas_jones-api.git
synced 2025-10-24 17:49:18 +02:00
some progress
This commit is contained in:
parent
aea93a5527
commit
e3c15bd288
1388 changed files with 306946 additions and 68323 deletions
18
node_modules/mongoose/lib/helpers/path/parentPaths.js
generated
vendored
Normal file
18
node_modules/mongoose/lib/helpers/path/parentPaths.js
generated
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
'use strict';
|
||||
|
||||
const dotRE = /\./g;
|
||||
module.exports = function parentPaths(path) {
|
||||
if (path.indexOf('.') === -1) {
|
||||
return [path];
|
||||
}
|
||||
const pieces = path.split(dotRE);
|
||||
const len = pieces.length;
|
||||
const ret = new Array(len);
|
||||
let cur = '';
|
||||
for (let i = 0; i < len; ++i) {
|
||||
cur += (cur.length !== 0) ? '.' + pieces[i] : pieces[i];
|
||||
ret[i] = cur;
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue