MCPcopy Create free account
hub / github.com/TruthHun/BookStack / mergeOptions

Function mergeOptions

static/vuejs/vue.runtime.js:1195–1235  ·  view source on GitHub ↗

* Merge two option objects into a new one. * Core utility used in both instantiation and inheritance.

(
  parent,
  child,
  vm
)

Source from the content-addressed store, hash-verified

1193 * Core utility used in both instantiation and inheritance.
1194 */
1195function mergeOptions (
1196 parent,
1197 child,
1198 vm
1199) {
1200 {
1201 checkComponents(child);
1202 }
1203 normalizeProps(child);
1204 normalizeDirectives(child);
1205 var extendsFrom = child.extends;
1206 if (extendsFrom) {
1207 parent = typeof extendsFrom === 'function'
1208 ? mergeOptions(parent, extendsFrom.options, vm)
1209 : mergeOptions(parent, extendsFrom, vm);
1210 }
1211 if (child.mixins) {
1212 for (var i = 0, l = child.mixins.length; i < l; i++) {
1213 var mixin = child.mixins[i];
1214 if (mixin.prototype instanceof Vue$2) {
1215 mixin = mixin.options;
1216 }
1217 parent = mergeOptions(parent, mixin, vm);
1218 }
1219 }
1220 var options = {};
1221 var key;
1222 for (key in parent) {
1223 mergeField(key);
1224 }
1225 for (key in child) {
1226 if (!hasOwn(parent, key)) {
1227 mergeField(key);
1228 }
1229 }
1230 function mergeField (key) {
1231 var strat = strats[key] || defaultStrat;
1232 options[key] = strat(parent[key], child[key], vm, key);
1233 }
1234 return options
1235}
1236
1237/**
1238 * Resolve an asset.

Callers 4

initMixinFunction · 0.70
initMixin$1Function · 0.70
initExtendFunction · 0.70

Calls 5

checkComponentsFunction · 0.70
normalizePropsFunction · 0.70
normalizeDirectivesFunction · 0.70
mergeFieldFunction · 0.70
hasOwnFunction · 0.70

Tested by

no test coverage detected