perf: Improve performance of recursive pointer iterations (#8741)
This commit is contained in:
@@ -1066,11 +1066,7 @@ function includePath(config, auth, response, path, restOptions = {}) {
|
|||||||
// Returns a list of pointers in REST format.
|
// Returns a list of pointers in REST format.
|
||||||
function findPointers(object, path) {
|
function findPointers(object, path) {
|
||||||
if (object instanceof Array) {
|
if (object instanceof Array) {
|
||||||
var answer = [];
|
return object.map(x => findPointers(x, path)).flat();
|
||||||
for (var x of object) {
|
|
||||||
answer = answer.concat(findPointers(x, path));
|
|
||||||
}
|
|
||||||
return answer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof object !== 'object' || !object) {
|
if (typeof object !== 'object' || !object) {
|
||||||
|
|||||||
Reference in New Issue
Block a user