Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | 704x 320x 50x 270x 36x 234x 5x 599x 270x 704x 219x 320x 704x 322x 322x 76x 246x 219x 219x 322x 704x 6982x 784x 704x | const serializeValue = v => {
if (v === undefined) {
return ' ' + v;
}
let stringified;
if (v instanceof Array) {
stringified = ' ' + JSON.stringify(v);
} else if (v.rootIds && v.edges && v.nodes) {
stringified = ` tree(${Object.keys(v.nodes)})`;
} else {
stringified = ' ' + JSON.stringify(v, (_, val) => (val instanceof Array ? [val.length] : val));
}
return stringified.length >= 64 ? stringified.substring(0, 61) + '...' : stringified;
};
const serializePayload = v =>
Object.entries(v)
.map(([key, val]) => `${key}:${serializeValue(val)}`)
.join('\n');
const print = (val, _, indent) => {
let ret = val.type;
if (val.type.startsWith('@ngrx/router-store/')) {
ret += ': ' + (val.payload?.event?.url || val.payload?.routerState?.url);
} else if (val.payload) {
const stringified = serializePayload(val.payload);
ret += ':\n' + indent(stringified);
}
return ret;
};
const test = val =>
!!val &&
typeof val === 'object' &&
Object.keys(val).includes('type') &&
Object.keys(val).every(key => ['type', 'payload'].includes(key));
module.exports = {
print: print,
test: test,
};
|