import { FaunaCollectionOptions } from '~/types/fauna' ; import { CONVENTION } from '~/consts' ; export function BiotaCollectionName ( name ) { return `${ CONVENTION . COLLECTION_PREFIX }${ collectionNamePlural ( name . replace ( CONVENTION . COLLECTION_PREFIX , '' ) ) }` ; } export function collectionNameSingular ( name ) { return name . endsWith ( 's' ) ? name . slice ( - 1 ) : name ; } export function collectionNamePlural ( name ) { return ! name . endsWith ( 's' ) ? name + 's' : name ; } export function Collection ( collection ) { let { name , data , history_days , ttl_days } = collection || { } ; return { name , data , history_days , ttl_days , } ; }