import config from '@config/config' ; const getFileId = ( figma ) : string => { let fileId = figma . root . getPluginData ( config . key . fileId ) ; if ( fileId === undefined || fileId === '' ) { figma . root . setPluginData ( config . key . fileId , figma . root . name + ' ' + Math . floor ( Math . random ( ) * 1000000000 ) ) ; fileId = figma . root . getPluginData ( config . key . fileId ) ; } return fileId ; } ; export default getFileId ;