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

Function mergeOptions

static/vuejs/vue.esm.js:1193–1233  ·  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

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