I have situation like this
const links = {
ALLOWED1: [ 'some_path1' ],
ALLOWED2: [ 'some_path2' ]
}
However I want to also allow paths from previous array on ALLOWED2, I've tried
const links = {
ALLOWED1: [ 'some_path1' ],
ALLOWED2: [ ...links['ALLOWED1'], 'some_path2' ]
}
But this is not valid as links will not defined yet. Of course I can populate it manually, but would rather find a more elegant solution.
ALLOWED2'should beALLOWED2: