All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.lib.config.helpers.deep-array.js Maven / Gradle / Ivy

There is a newer version: 7.25.2
Show newest version
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.finalize = finalize;
exports.flattenToSet = flattenToSet;
function finalize(deepArr) {
  return Object.freeze(deepArr);
}
function flattenToSet(arr) {
  const result = new Set();
  const stack = [arr];
  while (stack.length > 0) {
    for (const el of stack.pop()) {
      if (Array.isArray(el)) stack.push(el);else result.add(el);
    }
  }
  return result;
}
0 && 0;

//# sourceMappingURL=deep-array.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy