Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let attrs: Data | undefined = void 0
// update the instance propsProxy (passed to setup()) to trigger potential
// changes
const propsProxy = instance.propsProxy
const setProp = propsProxy
? (key: string, val: unknown) => {
props[key] = val
propsProxy[key] = val
}
: (key: string, val: unknown) => {
props[key] = val
}
// allow mutation of propsProxy (which is readonly by default)
unlock()
if (rawProps != null) {
for (const key in rawProps) {
// key, ref are reserved and never passed down
if (key === 'key' || key === 'ref') continue
// prop option names are camelized during normalization, so to support
// kebab -> camel conversion here we need to camelize the key.
const camelKey = camelize(key)
if (hasDeclaredProps && !hasOwn(options, camelKey)) {
// Any non-declared props are put into a separate `attrs` object
// for spreading. Make sure to preserve original key casing
;(attrs || (attrs = {}))[key] = rawProps[key]
} else {
setProp(camelKey, rawProps[key])
}
}