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

package.build.cjs.array.js.map Maven / Gradle / Ivy

There is a newer version: 8.38.0
Show newest version
{"version":3,"file":"array.js","sources":["../../src/array.ts"],"sourcesContent":["export type NestedArray = Array | T>;\n\n/** Flattens a multi-dimensional array */\nexport function flatten(input: NestedArray): T[] {\n  const result: T[] = [];\n\n  const flattenHelper = (input: NestedArray): void => {\n    input.forEach((el: T | NestedArray) => {\n      if (Array.isArray(el)) {\n        flattenHelper(el as NestedArray);\n      } else {\n        result.push(el as T);\n      }\n    });\n  };\n\n  flattenHelper(input);\n  return result;\n}\n"],"names":[],"mappings":";;AAEA;AACO,SAAS,OAAO,CAAI,KAAK,EAAuB;AACvD,EAAE,MAAM,MAAM,GAAQ,EAAE,CAAA;AACxB;AACA,EAAE,MAAM,aAAA,GAAgB,CAAC,KAAK,KAA2B;AACzD,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,KAAyB;AAC9C,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;AAC7B,QAAQ,aAAa,CAAC,EAAA,EAAqB,CAAA;AAC3C,aAAa;AACb,QAAQ,MAAM,CAAC,IAAI,CAAC,IAAQ,CAAA;AAC5B,OAAM;AACN,KAAK,CAAC,CAAA;AACN,GAAG,CAAA;AACH;AACA,EAAE,aAAa,CAAC,KAAK,CAAC,CAAA;AACtB,EAAE,OAAO,MAAM,CAAA;AACf;;;;"}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy