{"version":3,"file":"index.mjs","sources":[""],"sourcesContent":["export type TGetNumberFormattedArgs = Parameters<typeof getNumberFormatted>;\n\nexport type TGetNumberFormattedReturn = ReturnType<typeof getNumberFormatted>;\n\n/**\n * Formats a number using `Intl.NumberFormat`.\n * @param {number} num Source number\n * @param {Intl.LocalesArgument} [locales] Locale or locales\n * @param {Intl.NumberFormatOptions} [options={}] Number format options\n * @returns {string} Localized number\n * @throws {TypeError} getNumberFormatted: num must be a valid number\n * @example\n * getNumberFormatted(1234.5, \"en-US\"); // \"1,234.5\"\n * @example\n * // Format a large analytics metric using compact notation\n * const viewsLabel = getNumberFormatted(1_250_000, \"en-US\", { notation: \"compact\" }); // \"1.3M\"\n */\nexport const getNumberFormatted = (\n  num: number,\n  locales?: Intl.LocalesArgument,\n  options: Intl.NumberFormatOptions = {}\n): string => {\n  if (typeof num !== \"number\" || Number.isNaN(num)) {\n    throw new TypeError(\"getNumberFormatted: num must be a valid number\");\n  }\n  if (!options || typeof options !== \"object\" || Array.isArray(options)) {\n    throw new TypeError(\"getNumberFormatted: options must be a plain object\");\n  }\n  return new Intl.NumberFormat(locales, options).format(num);\n};\n"],"names":["getNumberFormatted","num","locales","options","Number","isNaN","TypeError","Array","isArray","Intl","NumberFormat","format"],"mappings":"AAiBO,MAAMA,mBAAqB,CAChCC,IACAC,QACAC,QAAoC,CAAA,KAEpC,UAAWF,MAAQ,UAAYG,OAAOC,MAAMJ,KAC1C,MAAM,IAAIK,UAAU,kDAEtB,IAAKH,gBAAkBA,UAAY,UAAYI,MAAMC,QAAQL,SAC3D,MAAM,IAAIG,UAAU,sDAEtB,OAAO,IAAIG,KAAKC,aAAaR,QAASC,SAASQ,OAAOV"}