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

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

The 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;;AAExB,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;AAC3C,aAAa;AACb,QAAQ,MAAM,CAAC,IAAI,CAAC,IAAQ;AAC5B;AACA,KAAK,CAAC;AACN,GAAG;;AAEH,EAAE,aAAa,CAAC,KAAK,CAAC;AACtB,EAAE,OAAO,MAAM;AACf;;;;"}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy