MCPcopy Index your code
hub / github.com/TruthHun/BookStack / extractProps

Function extractProps

static/vuejs/vue.runtime.esm.js:3162–3199  ·  view source on GitHub ↗
(data, Ctor, tag)

Source from the content-addressed store, hash-verified

3160}
3161
3162function extractProps (data, Ctor, tag) {
3163 // we are only extracting raw values here.
3164 // validation and default values are handled in the child
3165 // component itself.
3166 var propOptions = Ctor.options.props;
3167 if (!propOptions) {
3168 return
3169 }
3170 var res = {};
3171 var attrs = data.attrs;
3172 var props = data.props;
3173 var domProps = data.domProps;
3174 if (attrs || props || domProps) {
3175 for (var key in propOptions) {
3176 var altKey = hyphenate(key);
3177 if (process.env.NODE_ENV !== 'production') {
3178 var keyInLowerCase = key.toLowerCase();
3179 if (
3180 key !== keyInLowerCase &&
3181 attrs && attrs.hasOwnProperty(keyInLowerCase)
3182 ) {
3183 tip(
3184 "Prop \"" + keyInLowerCase + "\" is passed to component " +
3185 (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
3186 " \"" + key + "\". " +
3187 "Note that HTML attributes are case-insensitive and camelCased " +
3188 "props need to use their kebab-case equivalents when using in-DOM " +
3189 "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
3190 );
3191 }
3192 }
3193 checkProp(res, props, key, altKey, true) ||
3194 checkProp(res, attrs, key, altKey) ||
3195 checkProp(res, domProps, key, altKey);
3196 }
3197 }
3198 return res
3199}
3200
3201function checkProp (
3202 res,

Callers 1

createComponentFunction · 0.70

Calls 2

checkPropFunction · 0.70
hyphenateFunction · 0.50

Tested by

no test coverage detected