mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-28 02:39:31 -05:00
26 lines
593 B
TypeScript
26 lines
593 B
TypeScript
const cache = require('./cache')
|
|
import type { Cohort } from '@packages/types'
|
|
const debug = require('debug')('cypress:server:cohorts')
|
|
|
|
export = {
|
|
get: (): Promise<Record<string, Cohort>> => {
|
|
debug('Get cohorts')
|
|
|
|
return cache.getCohorts()
|
|
},
|
|
getByName: (name: string): Promise<Cohort> => {
|
|
debug('Get cohort name:', name)
|
|
|
|
return cache.getCohorts().then((cohorts) => {
|
|
debug('Get cohort returning:', cohorts[name])
|
|
|
|
return cohorts[name]
|
|
})
|
|
},
|
|
set: (cohort: Cohort) => {
|
|
debug('Set cohort', cohort)
|
|
|
|
return cache.insertCohort(cohort)
|
|
},
|
|
}
|