Files
LWLT-AIBOT/chrome-extension/ltjt-order-assistant/erp-account-identity.js
2026-09-07 20:21:09 +08:00

27 lines
831 B
JavaScript

(function installLTJTErpAccountIdentity(root, factory) {
const api = factory();
if (typeof module !== 'undefined' && module.exports) module.exports = api;
if (root) root.LTJTErpAccountIdentity = api;
}(typeof self !== 'undefined' ? self : globalThis, () => {
'use strict';
function normalizeErpAccountIdentity(value) {
return String(value || '')
.normalize('NFKC')
.replace(/\s+/gu, ' ')
.trim()
.toLocaleLowerCase();
}
function exactErpAccountIdentityMatch(expectedAccount, observedAccount) {
const expected = normalizeErpAccountIdentity(expectedAccount);
const observed = normalizeErpAccountIdentity(observedAccount);
return Boolean(expected && observed && expected === observed);
}
return {
normalizeErpAccountIdentity,
exactErpAccountIdentityMatch
};
}));