xatto
Version:
xatto is View Layer Library based on Function and Context using VirtualDOM. This is developed by forking from jorgebucaran/superfine.
18 lines (15 loc) • 464 B
text/typescript
import { CONTEXT, EXTRA, PATH } from './consts/attributeNames'
import { deepGet } from './deepGet'
import { deepSet } from './deepSet'
import { Props } from './Props'
export function remodelProps (
props: any,
context?: any,
extra?: any,
path?: string
): Props {
deepSet(props, CONTEXT, context || deepGet(props, CONTEXT) || {})
deepSet(props, EXTRA, extra || deepGet(props, EXTRA) || {})
deepSet(props, PATH, path || '')
return props as Props
}