action-debian-package/node_modules/fast-redact/lib/state.js

21 lines
422 B
JavaScript
Raw Normal View History

2020-03-26 14:37:35 +00:00
'use strict'
module.exports = state
function state (o) {
const {
secret,
censor,
compileRestore,
serialize,
groupRedact,
nestedRedact,
wildcards,
wcLen
} = o
2020-11-12 15:37:43 +00:00
const builder = [{ secret, censor, compileRestore }]
2020-03-26 14:37:35 +00:00
if (serialize !== false) builder.push({ serialize })
if (wcLen > 0) builder.push({ groupRedact, nestedRedact, wildcards, wcLen })
return Object.assign(...builder)
}