const spacing = { zero : "0" , atto : "3px" , femto : "5px" , pico : "8px" , nano : "13px" , micro : "21px" , milli : "34px" , centi : "55px" , kilo : "89px" , mega : "144px" , giga : "233px" , tera : "377px" , peta : "610px" , flow : "1.5rem" , } as const ; export type SpacingKey = keyof typeof spacing ; param key function gapBase ( key ) { return spacing [ key ] ; } param obj function attachGetters < T > ( obj ) { const build = ( obj as unknown ) as Record < keyof typeof spacing , unknown > ; Object . entries ( spacing ) . forEach ( ( [ key , value ] ) => { build [ key as keyof typeof spacing ] = value ; } ) ; return build as T & typeof spacing ; } export const gap = attachGetters ( gapBase ) ;