Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function simpletype(prop) {
const { type } = prop;
if (prop.$ref !== undefined) {
if (prop.$linkVal !== undefined) {
prop.simpletype = prop.$linkVal;
} else {
info(`unresolved reference: ${prop.$ref}`);
prop.simpletype = 'reference';
}
} else if (prop.enum !== undefined) {
prop.simpletype = '`enum`';
if (prop['meta:enum'] === undefined) {
prop['meta:enum'] = {};
}
for (let i = 0; i < prop.enum.length; i += 1) {
if (prop['meta:enum'][prop.enum[i]] === undefined) {
// setting an empty description for each unknown enum
prop['meta:enum'][prop.enum[i]] = '';
}
}
} else if (prop.const !== undefined) {
prop.simpletype = '`const`';
} else if (type === 'string') {