27 lines
831 B
JavaScript
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
|
|
};
|
|
}));
|