export function isDraftId ( id ) { return id . startsWith ( 'drafts.' ) ; } export const prefixId = ( id ) => ( id . startsWith ( 'drafts.' ) ? id : `drafts.${ id }` ) ; export const unprefixId = ( id ) => id . replace ( /^drafts\./ , '' ) ; export const safeId = ( id , makeSafe ) => { return /^(image|file)-[a-z0-9]{32,}-/ . test ( id ) ? id : `-${ makeSafe ( id ) }` ; } ;