Files
lsp/node_modules/mongoose/lib/helpers/path/parentPaths.js
Arnaud Nelissen 3af7ddab06 Initial commit
2021-11-17 11:25:08 +01:00

13 lines
265 B
JavaScript

'use strict';
module.exports = function parentPaths(path) {
const pieces = path.split('.');
let cur = '';
const ret = [];
for (let i = 0; i < pieces.length; ++i) {
cur += (cur.length > 0 ? '.' : '') + pieces[i];
ret.push(cur);
}
return ret;
};