This commit is contained in:
Yamozha
2021-04-02 02:24:13 +03:00
parent c23950b545
commit 7256d79e2c
31493 changed files with 3036630 additions and 0 deletions

View File

@ -0,0 +1,9 @@
declare const _default: {
test(value: any): boolean;
serialize(node: any, config: any, indentation: any, depth: any, refs: any, printer: any): string;
};
/**
* A pretty-format plugin for React's FiberNode objects, which are very large trees that are too
* large and verbose to print.
*/
export default _default;

View File

@ -0,0 +1,35 @@
/**
* A pretty-format plugin for React's FiberNode objects, which are very large trees that are too
* large and verbose to print.
*/
export default {
test(value) {
return (value &&
value instanceof Object &&
value.hasOwnProperty('tag') &&
value.hasOwnProperty('key') &&
value.hasOwnProperty('type'));
},
serialize(node, config, indentation, depth, refs, printer) {
return `${config.min ? '' : 'FiberNode '}{${_printProperties(node, ['tag', 'key', 'type'], config, indentation, depth, refs, printer)}}`;
},
};
function _printProperties(object, keys, config, indentation, depth, refs, printer) {
let result = config.spacingOuter;
const propertyIndentation = indentation + config.indent;
for (let ii = 0; ii < keys.length; ii++) {
const key = keys[ii];
const name = printer(key, config, propertyIndentation, depth, refs);
const value = printer(object[key], config, propertyIndentation, depth, refs);
result += `${propertyIndentation}${name}: ${value}`;
if (ii < keys.length - 1) {
result += ',' + config.spacingInner;
}
else if (!config.min) {
result += ',';
}
}
result += config.spacingOuter + indentation;
return result;
}
//# sourceMappingURL=ReactNodeFormatter.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"ReactNodeFormatter.js","sourceRoot":"","sources":["../../../src/logs/format/ReactNodeFormatter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAe;IACb,IAAI,CAAC,KAAU;QACb,OAAO,CACL,KAAK;YACL,KAAK,YAAY,MAAM;YACvB,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;YAC3B,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;YAC3B,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAC7B,CAAC;IACJ,CAAC;IAED,SAAS,CAAC,IAAI,EAAE,MAAM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OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\n * A pretty-format plugin for React's FiberNode objects, which are very large trees that are too\n * large and verbose to print.\n */\nexport default {\n test(value: any): boolean {\n return (\n value &&\n value instanceof Object &&\n value.hasOwnProperty('tag') &&\n value.hasOwnProperty('key') &&\n value.hasOwnProperty('type')\n );\n },\n\n serialize(node, config, indentation, depth, refs, printer): string {\n return `${config.min ? '' : 'FiberNode '}{${_printProperties(\n node,\n ['tag', 'key', 'type'],\n config,\n indentation,\n depth,\n refs,\n printer\n )}}`;\n },\n};\n\nfunction _printProperties(object, keys, config, indentation, depth, refs, printer) {\n let result = config.spacingOuter;\n const propertyIndentation = indentation + config.indent;\n\n for (let ii = 0; ii < keys.length; ii++) {\n const key = keys[ii];\n const name = printer(key, config, propertyIndentation, depth, refs);\n const value = printer(object[key], config, propertyIndentation, depth, refs);\n\n result += `${propertyIndentation}${name}: ${value}`;\n\n if (ii < keys.length - 1) {\n result += ',' + config.spacingInner;\n } else if (!config.min) {\n result += ',';\n }\n }\n\n result += config.spacingOuter + indentation;\n return result;\n}\n"]}