@timardex/cluemart-shared 1.5.809 → 1.5.810

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ import {
4
4
  SCHOOL_MIN_STUDENT_COUNT,
5
5
  isValidIrdNumber,
6
6
  normalizeUrl
7
- } from "../chunk-MFJDMZFJ.mjs";
7
+ } from "../chunk-KKLZDCVX.mjs";
8
8
  import {
9
9
  EnumAdShowOn,
10
10
  EnumAdStatus,
package/dist/index.cjs CHANGED
@@ -185,6 +185,7 @@ __export(index_exports, {
185
185
  foodFlavourOptions: () => foodFlavourOptions,
186
186
  formatCategoryLabel: () => formatCategoryLabel,
187
187
  formatDate: () => formatDate,
188
+ formatIrdNumber: () => formatIrdNumber,
188
189
  formatNZBankAccount: () => formatNZBankAccount,
189
190
  formatShareApplicationCategoriesSection: () => formatShareApplicationCategoriesSection,
190
191
  formatShareApplicationComplianceSection: () => formatShareApplicationComplianceSection,
@@ -2853,6 +2854,14 @@ function calculateCheckDigit(baseDigits, weights) {
2853
2854
  function normalizeIrdNumber(value) {
2854
2855
  return value.replace(/\D/g, "");
2855
2856
  }
2857
+ function formatIrdNumber(input) {
2858
+ const digitsOnly = normalizeIrdNumber(input).slice(0, 9);
2859
+ const parts = [];
2860
+ if (digitsOnly.length > 0) parts.push(digitsOnly.slice(0, 3));
2861
+ if (digitsOnly.length > 3) parts.push(digitsOnly.slice(3, 6));
2862
+ if (digitsOnly.length > 6) parts.push(digitsOnly.slice(6, 9));
2863
+ return parts.join("-");
2864
+ }
2856
2865
  function isValidIrdNumber(value) {
2857
2866
  const digits = normalizeIrdNumber(value);
2858
2867
  if (!/^\d{8,9}$/.test(digits)) {
@@ -9325,6 +9334,7 @@ var fonts = {
9325
9334
  foodFlavourOptions,
9326
9335
  formatCategoryLabel,
9327
9336
  formatDate,
9337
+ formatIrdNumber,
9328
9338
  formatNZBankAccount,
9329
9339
  formatShareApplicationCategoriesSection,
9330
9340
  formatShareApplicationComplianceSection,