1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| import {
| noop
| }
| from 'uni-shared'
|
| const sharedPropertyDefinition = {
| enumerable: true,
| configurable: true,
| get: noop,
| set: noop
| }
|
| export function proxy (target, sourceKey, key) {
| sharedPropertyDefinition.get = function proxyGetter () {
| return this[sourceKey][key]
| }
| sharedPropertyDefinition.set = function proxySetter (val) {
| this[sourceKey][key] = val
| }
| Object.defineProperty(target, key, sharedPropertyDefinition)
| }
|
|