{"version":3,"sources":["../../../src/internals/helpers/array.ts"],"names":["removeFromArray","arr","target","index","findIndex","value","splice","castArray","result","Array","isArray","hasMinLength","n","length"],"mappings":";;;;AAgBO,SAASA,eAAAA,CAAmBC,KAAUC,MAAS,EAAA;AACpD,EAAA,MAAMC,QAAQF,GAAIG,CAAAA,SAAAA,CAAU,CAACC,KAAAA,KAAUA,UAAUH,MAAAA,CAAAA;AACjD,EAAA,IAAIC,UAAU,EAAI,EAAA;AAChB,IAAO,OAAA,KAAA;AACT;AAEAF,EAAIK,GAAAA,CAAAA,MAAAA,CAAOH,OAAO,CAAA,CAAA;AAClB,EAAO,OAAA,IAAA;AACT;AARgBH,MAAAA,CAAAA,eAAAA,EAAAA,iBAAAA,CAAAA;AAUT,SAASO,UAAaN,GAAM,EAAA;AACjC,EAAA,MAAMO,MAASC,GAAAA,KAAAA,CAAMC,OAAQT,CAAAA,GAAAA,IAAOA,GAAM,GAAA;AAACA,IAAAA;;AAC3C,EAAOO,OAAAA,MAAAA;AACT;AAHgBD,MAAAA,CAAAA,SAAAA,EAAAA,WAAAA,CAAAA;AAST,SAASI,YAAAA,CAAkCV,KAAUW,CAAI,EAAA;AAC9D,EAAA,OAAOX,IAAIY,MAAUD,IAAAA,CAAAA;AACvB;AAFgBD,MAAAA,CAAAA,YAAAA,EAAAA,cAAAA,CAAAA","file":"array.cjs","sourcesContent":["/**\n * Copyright 2025 IBM Corp.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function removeFromArray<T>(arr: T[], target: T): boolean {\n  const index = arr.findIndex((value) => value === target);\n  if (index === -1) {\n    return false;\n  }\n\n  arr.splice(index, 1);\n  return true;\n}\n\nexport function castArray<T>(arr: T) {\n  const result = Array.isArray(arr) ? arr : [arr];\n  return result as T extends unknown[] ? T : [T];\n}\n\ntype HasMinLength<T, N extends number, T2 extends any[] = []> = T2[\"length\"] extends N\n  ? [...T2, ...T[]]\n  : HasMinLength<T, N, [any, ...T2]>;\n\nexport function hasMinLength<T, N extends number>(arr: T[], n: N): arr is HasMinLength<T, N> {\n  return arr.length >= n;\n}\n"]}