MCPcopy
hub / github.com/championswimmer/vuex-module-decorators / addPropertiesToObject

Function addPropertiesToObject

src/helpers.ts:7–13  ·  view source on GitHub ↗
(target: any, source: any)

Source from the content-addressed store, hash-verified

5 * @param {object} source Object with properties to be copied to x
6 */
7export function addPropertiesToObject(target: any, source: any) {
8 for (let k of Object.keys(source || {})) {
9 Object.defineProperty(target, k, {
10 get: () => source[k]
11 })
12 }
13}
14
15/**
16 * Returns a namespaced name of the module to be used as a store getter

Callers 3

actionFunction · 0.90
actionFunction · 0.90
addGettersToModuleFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected