Files
agency/.pnpm-store/v11/files/ad/1a535f946e56f26b0d0b8e299e15085f2e9f11f7f0ae69816466f1e93565cc641e7600a659f8c6c48c35e7c02899918aefd61fa8e40efe715b5826835dd005
hanzo-agent 5af6960b87 run project
Run: sess_f37640604ae254cb4d11dc6217f7b721
2026-09-30 00:04:56 +00:00

21 lines
528 B
Plaintext

// given an input that may or may not be an object, return an object that has
// a copy of every defined property listed in 'copy'. if the input is not an
// object, assign it to the property named by 'wrap'
const getOptions = (input, { copy, wrap }) => {
const result = {}
if (input && typeof input === 'object') {
for (const prop of copy) {
if (input[prop] !== undefined) {
result[prop] = input[prop]
}
}
} else {
result[wrap] = input
}
return result
}
module.exports = getOptions