Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function propString(prop, options) {
if (isString(prop)) {
return inspect(String(prop), { quoteStyle: 'double' });
}
if (isNumber(prop)) {
return `{${inspect(Number(prop))}}`;
}
if (isBoolean(prop)) {
return `{${inspect(booleanValue(prop))}}`;
}
if (isCallable(prop)) {
return `{${inspect(prop)}}`;
}
if (typeof prop === 'object') {
if (options.verbose) {
return `{${inspect(prop)}}`;
}
return '{{...}}';
}
return `{[${typeof prop}]}`;