@okf/ootils 1.8.7 → 1.9.1

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.
@@ -29,6 +29,48 @@ interface RichTextValue {
29
29
  [key: string]: any;
30
30
  }
31
31
  type TagNameInput = string | number | RichTextValue | null | undefined;
32
+ /**
33
+ * Generate a normalized tag ID from a tag name
34
+ *
35
+ * This function performs aggressive normalization to ensure that similar-looking
36
+ * tag names produce the same ID, preventing duplicates and collision errors.
37
+ *
38
+ * @param tagName - The tag name (string, number, or rich text object)
39
+ * @returns A normalized tag ID string
40
+ *
41
+ * @example
42
+ * ```typescript
43
+ * genTagId('Post-COVID') // → 'post_covid'
44
+ * genTagId('Post—COVID') // → 'post_covid' (em-dash)
45
+ * genTagId('Post–COVID') // → 'post_covid' (en-dash)
46
+ * genTagId('café') // → 'cafe'
47
+ * genTagId('CAFÉ') // → 'cafe'
48
+ * genTagId('Café') // → 'cafe'
49
+ * genTagId('C++') // → 'cplusplus'
50
+ * genTagId('New York') // → 'new_york' (double space)
51
+ * genTagId('José Müller') // → 'jose_muller'
52
+ * ```
53
+ *
54
+ * Normalization rules (applied in order):
55
+ * 1. Convert rich text to plain text
56
+ * 2. Normalize Unicode to NFD (Canonical Decomposition)
57
+ * 3. Remove all diacritical marks (accents, umlauts, etc.)
58
+ * 4. Trim whitespace from both ends
59
+ * 5. Convert to lowercase
60
+ * 6. Replace all non-alphanumeric characters with underscore
61
+ * 7. Replace '+' with 'plus'
62
+ * 8. Remove leading/trailing underscores
63
+ *
64
+ * Character variants that normalize to the same ID:
65
+ * - Dashes: hyphen (-), en-dash (–), em-dash (—), minus (−)
66
+ * - Whitespace: space, multiple spaces, tab, newline, non-breaking space
67
+ * - Quotes: straight ("), curly left ("), curly right ("), backtick (`)
68
+ * - Apostrophes: straight ('), curly (')
69
+ * - Accents: café/cafe, José/Jose, Müller/Muller, naïve/naive
70
+ * - Case: TestTag/testtag/TESTTAG
71
+ *
72
+ * @see TAG_NORMALIZATION_GUIDE.md in okf-be for comprehensive documentation
73
+ */
32
74
  declare const genTagId: (tagName: TagNameInput) => string;
33
75
 
34
76
  /**
@@ -602,6 +644,8 @@ declare namespace BASE_BULLMQ_CONFIG {
602
644
  export { delay_9 as delay };
603
645
  }
604
646
  export { backoff_9 as backoff };
647
+ let delay_10: number;
648
+ export { delay_10 as delay };
605
649
  let removeOnComplete_9: number;
606
650
  export { removeOnComplete_9 as removeOnComplete };
607
651
  let removeOnFail_9: number;
@@ -621,13 +665,6 @@ declare namespace BASE_BULLMQ_CONFIG {
621
665
  export namespace workerConfig_9 {
622
666
  let concurrency_9: number;
623
667
  export { concurrency_9 as concurrency };
624
- export namespace limiter_9 {
625
- let max_9: number;
626
- export { max_9 as max };
627
- let duration_9: number;
628
- export { duration_9 as duration };
629
- }
630
- export { limiter_9 as limiter };
631
668
  }
632
669
  export { workerConfig_9 as workerConfig };
633
670
  }
package/dist/browser.d.ts CHANGED
@@ -29,6 +29,48 @@ interface RichTextValue {
29
29
  [key: string]: any;
30
30
  }
31
31
  type TagNameInput = string | number | RichTextValue | null | undefined;
32
+ /**
33
+ * Generate a normalized tag ID from a tag name
34
+ *
35
+ * This function performs aggressive normalization to ensure that similar-looking
36
+ * tag names produce the same ID, preventing duplicates and collision errors.
37
+ *
38
+ * @param tagName - The tag name (string, number, or rich text object)
39
+ * @returns A normalized tag ID string
40
+ *
41
+ * @example
42
+ * ```typescript
43
+ * genTagId('Post-COVID') // → 'post_covid'
44
+ * genTagId('Post—COVID') // → 'post_covid' (em-dash)
45
+ * genTagId('Post–COVID') // → 'post_covid' (en-dash)
46
+ * genTagId('café') // → 'cafe'
47
+ * genTagId('CAFÉ') // → 'cafe'
48
+ * genTagId('Café') // → 'cafe'
49
+ * genTagId('C++') // → 'cplusplus'
50
+ * genTagId('New York') // → 'new_york' (double space)
51
+ * genTagId('José Müller') // → 'jose_muller'
52
+ * ```
53
+ *
54
+ * Normalization rules (applied in order):
55
+ * 1. Convert rich text to plain text
56
+ * 2. Normalize Unicode to NFD (Canonical Decomposition)
57
+ * 3. Remove all diacritical marks (accents, umlauts, etc.)
58
+ * 4. Trim whitespace from both ends
59
+ * 5. Convert to lowercase
60
+ * 6. Replace all non-alphanumeric characters with underscore
61
+ * 7. Replace '+' with 'plus'
62
+ * 8. Remove leading/trailing underscores
63
+ *
64
+ * Character variants that normalize to the same ID:
65
+ * - Dashes: hyphen (-), en-dash (–), em-dash (—), minus (−)
66
+ * - Whitespace: space, multiple spaces, tab, newline, non-breaking space
67
+ * - Quotes: straight ("), curly left ("), curly right ("), backtick (`)
68
+ * - Apostrophes: straight ('), curly (')
69
+ * - Accents: café/cafe, José/Jose, Müller/Muller, naïve/naive
70
+ * - Case: TestTag/testtag/TESTTAG
71
+ *
72
+ * @see TAG_NORMALIZATION_GUIDE.md in okf-be for comprehensive documentation
73
+ */
32
74
  declare const genTagId: (tagName: TagNameInput) => string;
33
75
 
34
76
  /**
@@ -602,6 +644,8 @@ declare namespace BASE_BULLMQ_CONFIG {
602
644
  export { delay_9 as delay };
603
645
  }
604
646
  export { backoff_9 as backoff };
647
+ let delay_10: number;
648
+ export { delay_10 as delay };
605
649
  let removeOnComplete_9: number;
606
650
  export { removeOnComplete_9 as removeOnComplete };
607
651
  let removeOnFail_9: number;
@@ -621,13 +665,6 @@ declare namespace BASE_BULLMQ_CONFIG {
621
665
  export namespace workerConfig_9 {
622
666
  let concurrency_9: number;
623
667
  export { concurrency_9 as concurrency };
624
- export namespace limiter_9 {
625
- let max_9: number;
626
- export { max_9 as max };
627
- let duration_9: number;
628
- export { duration_9 as duration };
629
- }
630
- export { limiter_9 as limiter };
631
668
  }
632
669
  export { workerConfig_9 as workerConfig };
633
670
  }
package/dist/browser.js CHANGED
@@ -184,6 +184,8 @@ var convertFromRichText = (value) => {
184
184
  };
185
185
  var genTagId = (tagName) => {
186
186
  let toReturn = convertFromRichText(tagName);
187
+ toReturn = toReturn.normalize("NFD");
188
+ toReturn = toReturn.replace(/\p{Mn}/gu, "");
187
189
  const regex = /[^\p{L}\p{N}\+]+/gui;
188
190
  toReturn = toReturn.trim().toLowerCase().replace(regex, "_");
189
191
  toReturn = toReturn.replace(/\+/g, "plus");
@@ -461,7 +463,7 @@ var BASE_BULLMQ_CONFIG = {
461
463
  defaultJobOptions: {
462
464
  backoff: {
463
465
  type: "exponential",
464
- delay: 2e3
466
+ delay: 4e3
465
467
  },
466
468
  attempts: 3,
467
469
  removeOnComplete: 30,
@@ -491,7 +493,7 @@ var BASE_BULLMQ_CONFIG = {
491
493
  defaultJobOptions: {
492
494
  backoff: {
493
495
  type: "exponential",
494
- delay: 2e3
496
+ delay: 4e3
495
497
  },
496
498
  attempts: 3,
497
499
  removeOnComplete: 30,
@@ -668,7 +670,7 @@ var BASE_BULLMQ_CONFIG = {
668
670
  attempts: 3,
669
671
  backoff: {
670
672
  type: "exponential",
671
- delay: 2e3
673
+ delay: 4e3
672
674
  },
673
675
  removeOnComplete: 30,
674
676
  removeOnFail: 100
@@ -699,6 +701,7 @@ var BASE_BULLMQ_CONFIG = {
699
701
  type: "exponential",
700
702
  delay: 2e3
701
703
  },
704
+ delay: 4e3,
702
705
  removeOnComplete: 30,
703
706
  removeOnFail: 100
704
707
  },
@@ -710,11 +713,7 @@ var BASE_BULLMQ_CONFIG = {
710
713
  }
711
714
  },
712
715
  workerConfig: {
713
- concurrency: 1,
714
- limiter: {
715
- max: 3,
716
- duration: 6e4
717
- }
716
+ concurrency: 1
718
717
  }
719
718
  }
720
719
  };
package/dist/browser.mjs CHANGED
@@ -148,6 +148,8 @@ var convertFromRichText = (value) => {
148
148
  };
149
149
  var genTagId = (tagName) => {
150
150
  let toReturn = convertFromRichText(tagName);
151
+ toReturn = toReturn.normalize("NFD");
152
+ toReturn = toReturn.replace(/\p{Mn}/gu, "");
151
153
  const regex = /[^\p{L}\p{N}\+]+/gui;
152
154
  toReturn = toReturn.trim().toLowerCase().replace(regex, "_");
153
155
  toReturn = toReturn.replace(/\+/g, "plus");
@@ -425,7 +427,7 @@ var BASE_BULLMQ_CONFIG = {
425
427
  defaultJobOptions: {
426
428
  backoff: {
427
429
  type: "exponential",
428
- delay: 2e3
430
+ delay: 4e3
429
431
  },
430
432
  attempts: 3,
431
433
  removeOnComplete: 30,
@@ -455,7 +457,7 @@ var BASE_BULLMQ_CONFIG = {
455
457
  defaultJobOptions: {
456
458
  backoff: {
457
459
  type: "exponential",
458
- delay: 2e3
460
+ delay: 4e3
459
461
  },
460
462
  attempts: 3,
461
463
  removeOnComplete: 30,
@@ -632,7 +634,7 @@ var BASE_BULLMQ_CONFIG = {
632
634
  attempts: 3,
633
635
  backoff: {
634
636
  type: "exponential",
635
- delay: 2e3
637
+ delay: 4e3
636
638
  },
637
639
  removeOnComplete: 30,
638
640
  removeOnFail: 100
@@ -663,6 +665,7 @@ var BASE_BULLMQ_CONFIG = {
663
665
  type: "exponential",
664
666
  delay: 2e3
665
667
  },
668
+ delay: 4e3,
666
669
  removeOnComplete: 30,
667
670
  removeOnFail: 100
668
671
  },
@@ -674,11 +677,7 @@ var BASE_BULLMQ_CONFIG = {
674
677
  }
675
678
  },
676
679
  workerConfig: {
677
- concurrency: 1,
678
- limiter: {
679
- max: 3,
680
- duration: 6e4
681
- }
680
+ concurrency: 1
682
681
  }
683
682
  }
684
683
  };
package/dist/node.d.mts CHANGED
@@ -36,6 +36,48 @@ interface RichTextValue {
36
36
  [key: string]: any;
37
37
  }
38
38
  type TagNameInput = string | number | RichTextValue | null | undefined;
39
+ /**
40
+ * Generate a normalized tag ID from a tag name
41
+ *
42
+ * This function performs aggressive normalization to ensure that similar-looking
43
+ * tag names produce the same ID, preventing duplicates and collision errors.
44
+ *
45
+ * @param tagName - The tag name (string, number, or rich text object)
46
+ * @returns A normalized tag ID string
47
+ *
48
+ * @example
49
+ * ```typescript
50
+ * genTagId('Post-COVID') // → 'post_covid'
51
+ * genTagId('Post—COVID') // → 'post_covid' (em-dash)
52
+ * genTagId('Post–COVID') // → 'post_covid' (en-dash)
53
+ * genTagId('café') // → 'cafe'
54
+ * genTagId('CAFÉ') // → 'cafe'
55
+ * genTagId('Café') // → 'cafe'
56
+ * genTagId('C++') // → 'cplusplus'
57
+ * genTagId('New York') // → 'new_york' (double space)
58
+ * genTagId('José Müller') // → 'jose_muller'
59
+ * ```
60
+ *
61
+ * Normalization rules (applied in order):
62
+ * 1. Convert rich text to plain text
63
+ * 2. Normalize Unicode to NFD (Canonical Decomposition)
64
+ * 3. Remove all diacritical marks (accents, umlauts, etc.)
65
+ * 4. Trim whitespace from both ends
66
+ * 5. Convert to lowercase
67
+ * 6. Replace all non-alphanumeric characters with underscore
68
+ * 7. Replace '+' with 'plus'
69
+ * 8. Remove leading/trailing underscores
70
+ *
71
+ * Character variants that normalize to the same ID:
72
+ * - Dashes: hyphen (-), en-dash (–), em-dash (—), minus (−)
73
+ * - Whitespace: space, multiple spaces, tab, newline, non-breaking space
74
+ * - Quotes: straight ("), curly left ("), curly right ("), backtick (`)
75
+ * - Apostrophes: straight ('), curly (')
76
+ * - Accents: café/cafe, José/Jose, Müller/Muller, naïve/naive
77
+ * - Case: TestTag/testtag/TESTTAG
78
+ *
79
+ * @see TAG_NORMALIZATION_GUIDE.md in okf-be for comprehensive documentation
80
+ */
39
81
  declare const genTagId: (tagName: TagNameInput) => string;
40
82
 
41
83
  /**
@@ -609,6 +651,8 @@ declare namespace BASE_BULLMQ_CONFIG {
609
651
  export { delay_9 as delay };
610
652
  }
611
653
  export { backoff_9 as backoff };
654
+ let delay_10: number;
655
+ export { delay_10 as delay };
612
656
  let removeOnComplete_9: number;
613
657
  export { removeOnComplete_9 as removeOnComplete };
614
658
  let removeOnFail_9: number;
@@ -628,13 +672,6 @@ declare namespace BASE_BULLMQ_CONFIG {
628
672
  export namespace workerConfig_9 {
629
673
  let concurrency_9: number;
630
674
  export { concurrency_9 as concurrency };
631
- export namespace limiter_9 {
632
- let max_9: number;
633
- export { max_9 as max };
634
- let duration_9: number;
635
- export { duration_9 as duration };
636
- }
637
- export { limiter_9 as limiter };
638
675
  }
639
676
  export { workerConfig_9 as workerConfig };
640
677
  }
package/dist/node.d.ts CHANGED
@@ -36,6 +36,48 @@ interface RichTextValue {
36
36
  [key: string]: any;
37
37
  }
38
38
  type TagNameInput = string | number | RichTextValue | null | undefined;
39
+ /**
40
+ * Generate a normalized tag ID from a tag name
41
+ *
42
+ * This function performs aggressive normalization to ensure that similar-looking
43
+ * tag names produce the same ID, preventing duplicates and collision errors.
44
+ *
45
+ * @param tagName - The tag name (string, number, or rich text object)
46
+ * @returns A normalized tag ID string
47
+ *
48
+ * @example
49
+ * ```typescript
50
+ * genTagId('Post-COVID') // → 'post_covid'
51
+ * genTagId('Post—COVID') // → 'post_covid' (em-dash)
52
+ * genTagId('Post–COVID') // → 'post_covid' (en-dash)
53
+ * genTagId('café') // → 'cafe'
54
+ * genTagId('CAFÉ') // → 'cafe'
55
+ * genTagId('Café') // → 'cafe'
56
+ * genTagId('C++') // → 'cplusplus'
57
+ * genTagId('New York') // → 'new_york' (double space)
58
+ * genTagId('José Müller') // → 'jose_muller'
59
+ * ```
60
+ *
61
+ * Normalization rules (applied in order):
62
+ * 1. Convert rich text to plain text
63
+ * 2. Normalize Unicode to NFD (Canonical Decomposition)
64
+ * 3. Remove all diacritical marks (accents, umlauts, etc.)
65
+ * 4. Trim whitespace from both ends
66
+ * 5. Convert to lowercase
67
+ * 6. Replace all non-alphanumeric characters with underscore
68
+ * 7. Replace '+' with 'plus'
69
+ * 8. Remove leading/trailing underscores
70
+ *
71
+ * Character variants that normalize to the same ID:
72
+ * - Dashes: hyphen (-), en-dash (–), em-dash (—), minus (−)
73
+ * - Whitespace: space, multiple spaces, tab, newline, non-breaking space
74
+ * - Quotes: straight ("), curly left ("), curly right ("), backtick (`)
75
+ * - Apostrophes: straight ('), curly (')
76
+ * - Accents: café/cafe, José/Jose, Müller/Muller, naïve/naive
77
+ * - Case: TestTag/testtag/TESTTAG
78
+ *
79
+ * @see TAG_NORMALIZATION_GUIDE.md in okf-be for comprehensive documentation
80
+ */
39
81
  declare const genTagId: (tagName: TagNameInput) => string;
40
82
 
41
83
  /**
@@ -609,6 +651,8 @@ declare namespace BASE_BULLMQ_CONFIG {
609
651
  export { delay_9 as delay };
610
652
  }
611
653
  export { backoff_9 as backoff };
654
+ let delay_10: number;
655
+ export { delay_10 as delay };
612
656
  let removeOnComplete_9: number;
613
657
  export { removeOnComplete_9 as removeOnComplete };
614
658
  let removeOnFail_9: number;
@@ -628,13 +672,6 @@ declare namespace BASE_BULLMQ_CONFIG {
628
672
  export namespace workerConfig_9 {
629
673
  let concurrency_9: number;
630
674
  export { concurrency_9 as concurrency };
631
- export namespace limiter_9 {
632
- let max_9: number;
633
- export { max_9 as max };
634
- let duration_9: number;
635
- export { duration_9 as duration };
636
- }
637
- export { limiter_9 as limiter };
638
675
  }
639
676
  export { workerConfig_9 as workerConfig };
640
677
  }
package/dist/node.js CHANGED
@@ -82,7 +82,7 @@ var init_GLOBAL_BULLMQ_CONFIG = __esm({
82
82
  defaultJobOptions: {
83
83
  backoff: {
84
84
  type: "exponential",
85
- delay: 2e3
85
+ delay: 4e3
86
86
  },
87
87
  attempts: 3,
88
88
  removeOnComplete: 30,
@@ -112,7 +112,7 @@ var init_GLOBAL_BULLMQ_CONFIG = __esm({
112
112
  defaultJobOptions: {
113
113
  backoff: {
114
114
  type: "exponential",
115
- delay: 2e3
115
+ delay: 4e3
116
116
  },
117
117
  attempts: 3,
118
118
  removeOnComplete: 30,
@@ -289,7 +289,7 @@ var init_GLOBAL_BULLMQ_CONFIG = __esm({
289
289
  attempts: 3,
290
290
  backoff: {
291
291
  type: "exponential",
292
- delay: 2e3
292
+ delay: 4e3
293
293
  },
294
294
  removeOnComplete: 30,
295
295
  removeOnFail: 100
@@ -320,6 +320,7 @@ var init_GLOBAL_BULLMQ_CONFIG = __esm({
320
320
  type: "exponential",
321
321
  delay: 2e3
322
322
  },
323
+ delay: 4e3,
323
324
  removeOnComplete: 30,
324
325
  removeOnFail: 100
325
326
  },
@@ -331,11 +332,7 @@ var init_GLOBAL_BULLMQ_CONFIG = __esm({
331
332
  }
332
333
  },
333
334
  workerConfig: {
334
- concurrency: 1,
335
- limiter: {
336
- max: 3,
337
- duration: 6e4
338
- }
335
+ concurrency: 1
339
336
  }
340
337
  }
341
338
  };
@@ -1616,6 +1613,8 @@ var convertFromRichText = (value) => {
1616
1613
  };
1617
1614
  var genTagId = (tagName) => {
1618
1615
  let toReturn = convertFromRichText(tagName);
1616
+ toReturn = toReturn.normalize("NFD");
1617
+ toReturn = toReturn.replace(/\p{Mn}/gu, "");
1619
1618
  const regex = /[^\p{L}\p{N}\+]+/gui;
1620
1619
  toReturn = toReturn.trim().toLowerCase().replace(regex, "_");
1621
1620
  toReturn = toReturn.replace(/\+/g, "plus");
package/dist/node.mjs CHANGED
@@ -87,7 +87,7 @@ var init_GLOBAL_BULLMQ_CONFIG = __esm({
87
87
  defaultJobOptions: {
88
88
  backoff: {
89
89
  type: "exponential",
90
- delay: 2e3
90
+ delay: 4e3
91
91
  },
92
92
  attempts: 3,
93
93
  removeOnComplete: 30,
@@ -117,7 +117,7 @@ var init_GLOBAL_BULLMQ_CONFIG = __esm({
117
117
  defaultJobOptions: {
118
118
  backoff: {
119
119
  type: "exponential",
120
- delay: 2e3
120
+ delay: 4e3
121
121
  },
122
122
  attempts: 3,
123
123
  removeOnComplete: 30,
@@ -294,7 +294,7 @@ var init_GLOBAL_BULLMQ_CONFIG = __esm({
294
294
  attempts: 3,
295
295
  backoff: {
296
296
  type: "exponential",
297
- delay: 2e3
297
+ delay: 4e3
298
298
  },
299
299
  removeOnComplete: 30,
300
300
  removeOnFail: 100
@@ -325,6 +325,7 @@ var init_GLOBAL_BULLMQ_CONFIG = __esm({
325
325
  type: "exponential",
326
326
  delay: 2e3
327
327
  },
328
+ delay: 4e3,
328
329
  removeOnComplete: 30,
329
330
  removeOnFail: 100
330
331
  },
@@ -336,11 +337,7 @@ var init_GLOBAL_BULLMQ_CONFIG = __esm({
336
337
  }
337
338
  },
338
339
  workerConfig: {
339
- concurrency: 1,
340
- limiter: {
341
- max: 3,
342
- duration: 6e4
343
- }
340
+ concurrency: 1
344
341
  }
345
342
  }
346
343
  };
@@ -1586,6 +1583,8 @@ var convertFromRichText = (value) => {
1586
1583
  };
1587
1584
  var genTagId = (tagName) => {
1588
1585
  let toReturn = convertFromRichText(tagName);
1586
+ toReturn = toReturn.normalize("NFD");
1587
+ toReturn = toReturn.replace(/\p{Mn}/gu, "");
1589
1588
  const regex = /[^\p{L}\p{N}\+]+/gui;
1590
1589
  toReturn = toReturn.trim().toLowerCase().replace(regex, "_");
1591
1590
  toReturn = toReturn.replace(/\+/g, "plus");
@@ -29,6 +29,48 @@ interface RichTextValue {
29
29
  [key: string]: any;
30
30
  }
31
31
  type TagNameInput = string | number | RichTextValue | null | undefined;
32
+ /**
33
+ * Generate a normalized tag ID from a tag name
34
+ *
35
+ * This function performs aggressive normalization to ensure that similar-looking
36
+ * tag names produce the same ID, preventing duplicates and collision errors.
37
+ *
38
+ * @param tagName - The tag name (string, number, or rich text object)
39
+ * @returns A normalized tag ID string
40
+ *
41
+ * @example
42
+ * ```typescript
43
+ * genTagId('Post-COVID') // → 'post_covid'
44
+ * genTagId('Post—COVID') // → 'post_covid' (em-dash)
45
+ * genTagId('Post–COVID') // → 'post_covid' (en-dash)
46
+ * genTagId('café') // → 'cafe'
47
+ * genTagId('CAFÉ') // → 'cafe'
48
+ * genTagId('Café') // → 'cafe'
49
+ * genTagId('C++') // → 'cplusplus'
50
+ * genTagId('New York') // → 'new_york' (double space)
51
+ * genTagId('José Müller') // → 'jose_muller'
52
+ * ```
53
+ *
54
+ * Normalization rules (applied in order):
55
+ * 1. Convert rich text to plain text
56
+ * 2. Normalize Unicode to NFD (Canonical Decomposition)
57
+ * 3. Remove all diacritical marks (accents, umlauts, etc.)
58
+ * 4. Trim whitespace from both ends
59
+ * 5. Convert to lowercase
60
+ * 6. Replace all non-alphanumeric characters with underscore
61
+ * 7. Replace '+' with 'plus'
62
+ * 8. Remove leading/trailing underscores
63
+ *
64
+ * Character variants that normalize to the same ID:
65
+ * - Dashes: hyphen (-), en-dash (–), em-dash (—), minus (−)
66
+ * - Whitespace: space, multiple spaces, tab, newline, non-breaking space
67
+ * - Quotes: straight ("), curly left ("), curly right ("), backtick (`)
68
+ * - Apostrophes: straight ('), curly (')
69
+ * - Accents: café/cafe, José/Jose, Müller/Muller, naïve/naive
70
+ * - Case: TestTag/testtag/TESTTAG
71
+ *
72
+ * @see TAG_NORMALIZATION_GUIDE.md in okf-be for comprehensive documentation
73
+ */
32
74
  declare const genTagId: (tagName: TagNameInput) => string;
33
75
 
34
76
  /**
@@ -602,6 +644,8 @@ declare namespace BASE_BULLMQ_CONFIG {
602
644
  export { delay_9 as delay };
603
645
  }
604
646
  export { backoff_9 as backoff };
647
+ let delay_10: number;
648
+ export { delay_10 as delay };
605
649
  let removeOnComplete_9: number;
606
650
  export { removeOnComplete_9 as removeOnComplete };
607
651
  let removeOnFail_9: number;
@@ -621,13 +665,6 @@ declare namespace BASE_BULLMQ_CONFIG {
621
665
  export namespace workerConfig_9 {
622
666
  let concurrency_9: number;
623
667
  export { concurrency_9 as concurrency };
624
- export namespace limiter_9 {
625
- let max_9: number;
626
- export { max_9 as max };
627
- let duration_9: number;
628
- export { duration_9 as duration };
629
- }
630
- export { limiter_9 as limiter };
631
668
  }
632
669
  export { workerConfig_9 as workerConfig };
633
670
  }
@@ -29,6 +29,48 @@ interface RichTextValue {
29
29
  [key: string]: any;
30
30
  }
31
31
  type TagNameInput = string | number | RichTextValue | null | undefined;
32
+ /**
33
+ * Generate a normalized tag ID from a tag name
34
+ *
35
+ * This function performs aggressive normalization to ensure that similar-looking
36
+ * tag names produce the same ID, preventing duplicates and collision errors.
37
+ *
38
+ * @param tagName - The tag name (string, number, or rich text object)
39
+ * @returns A normalized tag ID string
40
+ *
41
+ * @example
42
+ * ```typescript
43
+ * genTagId('Post-COVID') // → 'post_covid'
44
+ * genTagId('Post—COVID') // → 'post_covid' (em-dash)
45
+ * genTagId('Post–COVID') // → 'post_covid' (en-dash)
46
+ * genTagId('café') // → 'cafe'
47
+ * genTagId('CAFÉ') // → 'cafe'
48
+ * genTagId('Café') // → 'cafe'
49
+ * genTagId('C++') // → 'cplusplus'
50
+ * genTagId('New York') // → 'new_york' (double space)
51
+ * genTagId('José Müller') // → 'jose_muller'
52
+ * ```
53
+ *
54
+ * Normalization rules (applied in order):
55
+ * 1. Convert rich text to plain text
56
+ * 2. Normalize Unicode to NFD (Canonical Decomposition)
57
+ * 3. Remove all diacritical marks (accents, umlauts, etc.)
58
+ * 4. Trim whitespace from both ends
59
+ * 5. Convert to lowercase
60
+ * 6. Replace all non-alphanumeric characters with underscore
61
+ * 7. Replace '+' with 'plus'
62
+ * 8. Remove leading/trailing underscores
63
+ *
64
+ * Character variants that normalize to the same ID:
65
+ * - Dashes: hyphen (-), en-dash (–), em-dash (—), minus (−)
66
+ * - Whitespace: space, multiple spaces, tab, newline, non-breaking space
67
+ * - Quotes: straight ("), curly left ("), curly right ("), backtick (`)
68
+ * - Apostrophes: straight ('), curly (')
69
+ * - Accents: café/cafe, José/Jose, Müller/Muller, naïve/naive
70
+ * - Case: TestTag/testtag/TESTTAG
71
+ *
72
+ * @see TAG_NORMALIZATION_GUIDE.md in okf-be for comprehensive documentation
73
+ */
32
74
  declare const genTagId: (tagName: TagNameInput) => string;
33
75
 
34
76
  /**
@@ -602,6 +644,8 @@ declare namespace BASE_BULLMQ_CONFIG {
602
644
  export { delay_9 as delay };
603
645
  }
604
646
  export { backoff_9 as backoff };
647
+ let delay_10: number;
648
+ export { delay_10 as delay };
605
649
  let removeOnComplete_9: number;
606
650
  export { removeOnComplete_9 as removeOnComplete };
607
651
  let removeOnFail_9: number;
@@ -621,13 +665,6 @@ declare namespace BASE_BULLMQ_CONFIG {
621
665
  export namespace workerConfig_9 {
622
666
  let concurrency_9: number;
623
667
  export { concurrency_9 as concurrency };
624
- export namespace limiter_9 {
625
- let max_9: number;
626
- export { max_9 as max };
627
- let duration_9: number;
628
- export { duration_9 as duration };
629
- }
630
- export { limiter_9 as limiter };
631
668
  }
632
669
  export { workerConfig_9 as workerConfig };
633
670
  }
package/dist/universal.js CHANGED
@@ -184,6 +184,8 @@ var convertFromRichText = (value) => {
184
184
  };
185
185
  var genTagId = (tagName) => {
186
186
  let toReturn = convertFromRichText(tagName);
187
+ toReturn = toReturn.normalize("NFD");
188
+ toReturn = toReturn.replace(/\p{Mn}/gu, "");
187
189
  const regex = /[^\p{L}\p{N}\+]+/gui;
188
190
  toReturn = toReturn.trim().toLowerCase().replace(regex, "_");
189
191
  toReturn = toReturn.replace(/\+/g, "plus");
@@ -461,7 +463,7 @@ var BASE_BULLMQ_CONFIG = {
461
463
  defaultJobOptions: {
462
464
  backoff: {
463
465
  type: "exponential",
464
- delay: 2e3
466
+ delay: 4e3
465
467
  },
466
468
  attempts: 3,
467
469
  removeOnComplete: 30,
@@ -491,7 +493,7 @@ var BASE_BULLMQ_CONFIG = {
491
493
  defaultJobOptions: {
492
494
  backoff: {
493
495
  type: "exponential",
494
- delay: 2e3
496
+ delay: 4e3
495
497
  },
496
498
  attempts: 3,
497
499
  removeOnComplete: 30,
@@ -668,7 +670,7 @@ var BASE_BULLMQ_CONFIG = {
668
670
  attempts: 3,
669
671
  backoff: {
670
672
  type: "exponential",
671
- delay: 2e3
673
+ delay: 4e3
672
674
  },
673
675
  removeOnComplete: 30,
674
676
  removeOnFail: 100
@@ -699,6 +701,7 @@ var BASE_BULLMQ_CONFIG = {
699
701
  type: "exponential",
700
702
  delay: 2e3
701
703
  },
704
+ delay: 4e3,
702
705
  removeOnComplete: 30,
703
706
  removeOnFail: 100
704
707
  },
@@ -710,11 +713,7 @@ var BASE_BULLMQ_CONFIG = {
710
713
  }
711
714
  },
712
715
  workerConfig: {
713
- concurrency: 1,
714
- limiter: {
715
- max: 3,
716
- duration: 6e4
717
- }
716
+ concurrency: 1
718
717
  }
719
718
  }
720
719
  };
@@ -148,6 +148,8 @@ var convertFromRichText = (value) => {
148
148
  };
149
149
  var genTagId = (tagName) => {
150
150
  let toReturn = convertFromRichText(tagName);
151
+ toReturn = toReturn.normalize("NFD");
152
+ toReturn = toReturn.replace(/\p{Mn}/gu, "");
151
153
  const regex = /[^\p{L}\p{N}\+]+/gui;
152
154
  toReturn = toReturn.trim().toLowerCase().replace(regex, "_");
153
155
  toReturn = toReturn.replace(/\+/g, "plus");
@@ -425,7 +427,7 @@ var BASE_BULLMQ_CONFIG = {
425
427
  defaultJobOptions: {
426
428
  backoff: {
427
429
  type: "exponential",
428
- delay: 2e3
430
+ delay: 4e3
429
431
  },
430
432
  attempts: 3,
431
433
  removeOnComplete: 30,
@@ -455,7 +457,7 @@ var BASE_BULLMQ_CONFIG = {
455
457
  defaultJobOptions: {
456
458
  backoff: {
457
459
  type: "exponential",
458
- delay: 2e3
460
+ delay: 4e3
459
461
  },
460
462
  attempts: 3,
461
463
  removeOnComplete: 30,
@@ -632,7 +634,7 @@ var BASE_BULLMQ_CONFIG = {
632
634
  attempts: 3,
633
635
  backoff: {
634
636
  type: "exponential",
635
- delay: 2e3
637
+ delay: 4e3
636
638
  },
637
639
  removeOnComplete: 30,
638
640
  removeOnFail: 100
@@ -663,6 +665,7 @@ var BASE_BULLMQ_CONFIG = {
663
665
  type: "exponential",
664
666
  delay: 2e3
665
667
  },
668
+ delay: 4e3,
666
669
  removeOnComplete: 30,
667
670
  removeOnFail: 100
668
671
  },
@@ -674,11 +677,7 @@ var BASE_BULLMQ_CONFIG = {
674
677
  }
675
678
  },
676
679
  workerConfig: {
677
- concurrency: 1,
678
- limiter: {
679
- max: 3,
680
- duration: 6e4
681
- }
680
+ concurrency: 1
682
681
  }
683
682
  }
684
683
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.8.7",
6
+ "version": "1.9.1",
7
7
  "description": "Utility functions for both browser and Node.js",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.mjs",