philentropyst
Version:
Efficient data masking tool
24 lines (19 loc) • 381 B
JavaScript
const Prefix = 'custom.'
class CustomFaker {
static isCustomType (type) {
return type.startsWith(Prefix)
}
apply ({ type, options }) {
const t = type.replace(Prefix, '')
if (!this[t]) {
throw Error(`Type '${type}' not supported`)
}
return this[t](options)
}
fixedValue (options) {
return options
}
}
module.exports = {
CustomFaker
}