package.build.cjs.array.js.map Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of utils Show documentation
Show all versions of utils Show documentation
Utilities for all Sentry JavaScript SDKs
{"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;;;;"}