MCPcopy Index your code
hub / github.com/nodejs/node / formatPromise

Function formatPromise

lib/internal/util/inspect.js:2520–2536  ·  view source on GitHub ↗
(ctx, value, recurseTimes)

Source from the content-addressed store, hash-verified

2518}
2519
2520function formatPromise(ctx, value, recurseTimes) {
2521 let output;
2522 const { 0: state, 1: result } = getPromiseDetails(value);
2523 if (state === kPending) {
2524 output = [ctx.stylize('<pending>', 'special')];
2525 } else {
2526 ctx.indentationLvl += 2;
2527 const str = formatValue(ctx, result, recurseTimes);
2528 ctx.indentationLvl -= 2;
2529 output = [
2530 state === kRejected ?
2531 `${ctx.stylize('<rejected>', 'special')} ${str}` :
2532 str,
2533 ];
2534 }
2535 return output;
2536}
2537
2538function formatExtraProperties(ctx, value, recurseTimes, key, typedArray) {
2539 ctx.indentationLvl += 2;

Callers

nothing calls this directly

Calls 1

formatValueFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…