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

Function transformModel

agentic_security/static/vue.js:3317–3335  ·  view source on GitHub ↗
(options, data)

Source from the content-addressed store, hash-verified

3315 // transform component v-model info (value and callback) into
3316 // prop and event handler respectively.
3317 function transformModel (options, data) {
3318 var prop = (options.model && options.model.prop) || 'value';
3319 var event = (options.model && options.model.event) || 'input'
3320 ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
3321 var on = data.on || (data.on = {});
3322 var existing = on[event];
3323 var callback = data.model.callback;
3324 if (isDef(existing)) {
3325 if (
3326 Array.isArray(existing)
3327 ? existing.indexOf(callback) === -1
3328 : existing !== callback
3329 ) {
3330 on[event] = [callback].concat(existing);
3331 }
3332 } else {
3333 on[event] = callback;
3334 }
3335 }
3336
3337 /* */
3338

Callers 1

createComponentFunction · 0.85

Calls 1

isDefFunction · 0.85

Tested by

no test coverage detected