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

Function mergeOptions

static/vuejs/vue.runtime.esm.js:1189–1229  ·  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

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