UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

14 lines (13 loc) • 314 B
//#region src/shared/map-array-if-changed.ts /** Preserve the source array when every mapped entry is unchanged. */ function mapArrayIfChanged(e, t) { let n = false; const r = e.map((e) => { const r = t(e); n ||= r !== e; return r; }); return n ? r : e; } //#endregion export { mapArrayIfChanged as t };