Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const Password = ({ section }) => {
const [options, setOptions] = useState(getProps())
const [example, setExample] = useState(generatePassword(getProps()))
const onChange = event => {
const option = {}
option[event.target.name] = event.target.checked
updateOption(option)
}
const onValueChange = event => {
const option = {}
option[event.target.name] = event.target.value
updateOption(option)
}
const updateOption = option => {
const upadtedOptions = { ...options, ...option }
setExample(generatePassword(upadtedOptions))
const generatePassword = () => {
const password = window.generatePassword(getProps())
onChange({ target: { name: 'password', value: password } })
}
const Password = ({ section }) => {
const [options, setOptions] = useState(getProps())
const [example, setExample] = useState(generatePassword(getProps()))
const onChange = event => {
const option = {}
option[event.target.name] = event.target.checked
updateOption(option)
}
const onValueChange = event => {
const option = {}
option[event.target.name] = event.target.value
updateOption(option)
}
const updateOption = option => {
const upadtedOptions = { ...options, ...option }