MCPcopy
hub / github.com/msoedov/agentic_security / extractPropsFromVNodeData

Function extractPropsFromVNodeData

agentic_security/static/vue.js:2271–2310  ·  view source on GitHub ↗
(
    data,
    Ctor,
    tag
  )

Source from the content-addressed store, hash-verified

2269 /* */
2270
2271 function extractPropsFromVNodeData (
2272 data,
2273 Ctor,
2274 tag
2275 ) {
2276 // we are only extracting raw values here.
2277 // validation and default values are handled in the child
2278 // component itself.
2279 var propOptions = Ctor.options.props;
2280 if (isUndef(propOptions)) {
2281 return
2282 }
2283 var res = {};
2284 var attrs = data.attrs;
2285 var props = data.props;
2286 if (isDef(attrs) || isDef(props)) {
2287 for (var key in propOptions) {
2288 var altKey = hyphenate(key);
2289 {
2290 var keyInLowerCase = key.toLowerCase();
2291 if (
2292 key !== keyInLowerCase &&
2293 attrs && hasOwn(attrs, keyInLowerCase)
2294 ) {
2295 tip(
2296 "Prop \"" + keyInLowerCase + "\" is passed to component " +
2297 (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
2298 " \"" + key + "\". " +
2299 "Note that HTML attributes are case-insensitive and camelCased " +
2300 "props need to use their kebab-case equivalents when using in-DOM " +
2301 "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
2302 );
2303 }
2304 }
2305 checkProp(res, props, key, altKey, true) ||
2306 checkProp(res, attrs, key, altKey, false);
2307 }
2308 }
2309 return res
2310 }
2311
2312 function checkProp (
2313 res,

Callers 1

createComponentFunction · 0.85

Calls 4

isUndefFunction · 0.85
isDefFunction · 0.85
hasOwnFunction · 0.85
checkPropFunction · 0.85

Tested by

no test coverage detected