import { memoizeJ } from "@thi.ng/memoize/memoizej" ; import type { Stringer } from "./api.js" ; export const truncate = memoizeJ ( ( n , suffix = "" ) => ( x ) => x . length > n ? x . substr ( 0 , n - suffix . length ) + suffix : x ) ; /**
 * Alias for  truncate export const truncateRight = truncate ;