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

Function normalizeProps

static/vuejs/vue.runtime.esm.js:1142–1168  ·  view source on GitHub ↗

* Ensure all props option syntax are normalized into the * Object-based format.

(options)

Source from the content-addressed store, hash-verified

1140 * Object-based format.
1141 */
1142function normalizeProps (options) {
1143 var props = options.props;
1144 if (!props) { return }
1145 var res = {};
1146 var i, val, name;
1147 if (Array.isArray(props)) {
1148 i = props.length;
1149 while (i--) {
1150 val = props[i];
1151 if (typeof val === 'string') {
1152 name = camelize(val);
1153 res[name] = { type: null };
1154 } else if (process.env.NODE_ENV !== 'production') {
1155 warn('props must be strings when using array syntax.');
1156 }
1157 }
1158 } else if (isPlainObject(props)) {
1159 for (var key in props) {
1160 val = props[key];
1161 name = camelize(key);
1162 res[name] = isPlainObject(val)
1163 ? val
1164 : { type: val };
1165 }
1166 }
1167 options.props = res;
1168}
1169
1170/**
1171 * Normalize raw function directives into object format.

Callers 1

mergeOptionsFunction · 0.70

Calls 2

isPlainObjectFunction · 0.70
warnFunction · 0.50

Tested by

no test coverage detected