MCPcopy Create free account
hub / github.com/ddopson/underscore-cli / formatKey

Function formatKey

lib/formatter.js:347–357  ·  view source on GitHub ↗
(ctx, key, isPrivate)

Source from the content-addressed store, hash-verified

345}
346
347function formatKey(ctx, key, isPrivate) {
348 var name = '' + key;
349 if (isPrivate) {
350 return ctx.stylize('[' + name + ']', 'private');
351 } else if (! ctx.quoteKeys && name.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)) {
352 return ctx.stylize(name, 'name');
353 } else {
354 name = ctx.quoteString(name);
355 return ctx.stylize(name, 'name');
356 }
357}
358
359function Formatter (config) {
360 var ctx = {};

Callers 1

formatPropertyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected