import { memoizeJ } from "@thi.ng/memoize/memoizej" ; import type { Stringer } from "./api.js" ; export const truncateLeft = memoizeJ ( ( n , prefix = "" ) => ( x ) => x . length > n ? prefix + x . substr ( x . length - n + prefix . length ) : x ) ;