Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
quantity: 20,
error: false,
delay: 0,
idType: INCREMENT,
idGenerator: v4,
...this.getModification('mockConfig')
}
const gen = opts.idGenerator
_.forEach(opts.extensions, (extension, name) => {
jsf.extend(name, extension)
})
_.forEach(opts.formats, (format, name) => {
jsf.format(name, format)
})
jsf.option(opts.jsfOptions)
const mock = models => extractMockedObjects(mapValid(models, model => {
if (typeof model.build === 'function') {
model = model.build()
}
model._modelType = model._modelType || 'arrayOf'
const primary = model.primaryKey || 'id'
const response = {}
const newId = opts.idType === INCREMENT ? _.size(cache[model.model ? model.model().getKey() : model.key]) + 1
: gen()
let id = newId
if (model._modelType == 'arrayOf' || model._modelType == 'valuesOf') {