@singi-labs/sifa-sdk 0.11.19 → 0.11.20
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.
- package/dist/index.cjs +19 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -1
- package/dist/index.d.ts +28 -1
- package/dist/index.js +19 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1461,6 +1461,13 @@ var SMALL_WORDS = /* @__PURE__ */ new Set([
|
|
|
1461
1461
|
"le",
|
|
1462
1462
|
"y"
|
|
1463
1463
|
]);
|
|
1464
|
+
function hasNonAsciiLetter(value) {
|
|
1465
|
+
for (const char of value) {
|
|
1466
|
+
const codePoint = char.codePointAt(0) ?? 0;
|
|
1467
|
+
if (codePoint > 127 && /\p{L}/u.test(char)) return true;
|
|
1468
|
+
}
|
|
1469
|
+
return false;
|
|
1470
|
+
}
|
|
1464
1471
|
function capitalizeWord(word) {
|
|
1465
1472
|
return word.replace(
|
|
1466
1473
|
/^([^\p{L}\p{N}]*)(\p{L})/u,
|
|
@@ -1469,7 +1476,7 @@ function capitalizeWord(word) {
|
|
|
1469
1476
|
}
|
|
1470
1477
|
function formatCompanyName(name) {
|
|
1471
1478
|
const trimmed = name.trim();
|
|
1472
|
-
if (!trimmed || trimmed !== trimmed.toLowerCase()) return trimmed;
|
|
1479
|
+
if (!trimmed || hasNonAsciiLetter(trimmed) || trimmed !== trimmed.toLowerCase()) return trimmed;
|
|
1473
1480
|
let seenWord = false;
|
|
1474
1481
|
return trimmed.split(/(\s+)/).map((token) => {
|
|
1475
1482
|
if (token.length === 0 || /^\s+$/.test(token)) return token;
|
|
@@ -1480,6 +1487,15 @@ function formatCompanyName(name) {
|
|
|
1480
1487
|
}).join("");
|
|
1481
1488
|
}
|
|
1482
1489
|
|
|
1490
|
+
// src/format/normalize-company-key.ts
|
|
1491
|
+
var COMBINING_MARKS = /[\u0300-\u036f]/g;
|
|
1492
|
+
function normalizeCompanyKey(name) {
|
|
1493
|
+
const trimmed = name.trim();
|
|
1494
|
+
if (!trimmed) return "";
|
|
1495
|
+
const caseFolded = trimmed.normalize("NFC").toLowerCase();
|
|
1496
|
+
return caseFolded.normalize("NFD").replace(COMBINING_MARKS, "").normalize("NFC");
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1483
1499
|
// src/format/format-time.ts
|
|
1484
1500
|
function formatRelativeTime(dateString) {
|
|
1485
1501
|
const date = new Date(dateString);
|
|
@@ -2879,7 +2895,7 @@ var ProfileVolunteeringRecordSchema = zod.z.object({
|
|
|
2879
2895
|
});
|
|
2880
2896
|
|
|
2881
2897
|
// src/index.ts
|
|
2882
|
-
var SIFA_SDK_VERSION = "0.11.
|
|
2898
|
+
var SIFA_SDK_VERSION = "0.11.20";
|
|
2883
2899
|
|
|
2884
2900
|
exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
|
|
2885
2901
|
exports.ACTIVITY_VISIBILITY_RULES = ACTIVITY_VISIBILITY_RULES;
|
|
@@ -3021,6 +3037,7 @@ exports.limitCombiningMarks = limitCombiningMarks;
|
|
|
3021
3037
|
exports.makeGraphFollowRecordSchema = makeGraphFollowRecordSchema;
|
|
3022
3038
|
exports.maxGraphemes = maxGraphemes;
|
|
3023
3039
|
exports.meetsContrastAA = meetsContrastAA;
|
|
3040
|
+
exports.normalizeCompanyKey = normalizeCompanyKey;
|
|
3024
3041
|
exports.normalizeOpenTo = normalizeOpenTo;
|
|
3025
3042
|
exports.normalizePlatformId = normalizePlatformId;
|
|
3026
3043
|
exports.normalizePresentationMode = normalizePresentationMode;
|