Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { base, warn, mapValid, extractMockedObjects, v4 } from './utils'
import jsf from 'json-schema-faker/lib'
import _ from 'lodash'
if (process.env.NODE_ENV !== 'production') {
jsf.extend('faker', () => require('faker'))
jsf.extend('chance', () => require('chance'))
} else {
const message = name => () => warn(`${name} has been stripped from the production build. To continue to use ${name} in production, ` +
`you can manually pass it to modelizr. See https://julienvincent.github.io/modelizr/docs/usage/Production.html for more information.`)
jsf.extend('faker', () => message('faker'))
jsf.extend('chance', () => message('chance'))
}
const RANDOM = "RANDOM"
const INCREMENT = "INCREMENT_ID"
const ID = {
INCREMENT: INCREMENT,
RANDOM: RANDOM
}
const mock = base()
mock.Class = class extends mock.Class {
response() {
const cache = {}
const opts = {
import { base, warn, mapValid, extractMockedObjects, v4 } from './utils'
import jsf from 'json-schema-faker/lib'
import _ from 'lodash'
if (process.env.NODE_ENV !== 'production') {
jsf.extend('faker', () => require('faker'))
jsf.extend('chance', () => require('chance'))
} else {
const message = name => () => warn(`${name} has been stripped from the production build. To continue to use ${name} in production, ` +
`you can manually pass it to modelizr. See https://julienvincent.github.io/modelizr/docs/usage/Production.html for more information.`)
jsf.extend('faker', () => message('faker'))
jsf.extend('chance', () => message('chance'))
}
const RANDOM = "RANDOM"
const INCREMENT = "INCREMENT_ID"
const ID = {
INCREMENT: INCREMENT,
RANDOM: RANDOM
}
const mock = base()
mock.Class = class extends mock.Class {
response() {
const cache = {}
const opts = {
extensions: {},
_.forEach(opts.extensions, (extension, name) => {
jsf.extend(name, extension)
})
_.forEach(opts.formats, (format, name) => {