init commit
This commit is contained in:
214
remotion/node_modules/@remotion/renderer/dist/format-logs.js
generated
vendored
Normal file
214
remotion/node_modules/@remotion/renderer/dist/format-logs.js
generated
vendored
Normal file
@@ -0,0 +1,214 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.formatObjectPreview = exports.formatRemoteObject = void 0;
|
||||
const no_react_1 = require("remotion/no-react");
|
||||
const chalk_1 = require("./chalk");
|
||||
const formatRemoteObject = (remoteObject) => {
|
||||
if (remoteObject.preview) {
|
||||
return (0, exports.formatObjectPreview)(remoteObject.preview);
|
||||
}
|
||||
if (remoteObject.type === 'string') {
|
||||
const isDelayRenderClear = remoteObject.value.includes(no_react_1.NoReactInternals.DELAY_RENDER_CLEAR_TOKEN);
|
||||
if (isDelayRenderClear) {
|
||||
return chalk_1.chalk.gray(`${remoteObject.value}`);
|
||||
}
|
||||
return `${remoteObject.value}`;
|
||||
}
|
||||
if (remoteObject.type === 'number') {
|
||||
return chalk_1.chalk.yellow(`${remoteObject.value}`);
|
||||
}
|
||||
if (remoteObject.type === 'bigint') {
|
||||
return chalk_1.chalk.yellow(`${remoteObject.description}`);
|
||||
}
|
||||
if (remoteObject.type === 'boolean') {
|
||||
return chalk_1.chalk.yellow(`${remoteObject.value}`);
|
||||
}
|
||||
if (remoteObject.type === 'function') {
|
||||
return chalk_1.chalk.cyan(String(remoteObject.description));
|
||||
}
|
||||
if (remoteObject.type === 'object') {
|
||||
if (remoteObject.subtype === 'null') {
|
||||
return `null`;
|
||||
}
|
||||
return chalk_1.chalk.reset(`Object`);
|
||||
}
|
||||
if (remoteObject.type === 'symbol') {
|
||||
return chalk_1.chalk.green(`${remoteObject.description}`);
|
||||
}
|
||||
if (remoteObject.type === 'undefined') {
|
||||
return chalk_1.chalk.gray(`undefined`);
|
||||
}
|
||||
throw new Error('unhandled remote object');
|
||||
};
|
||||
exports.formatRemoteObject = formatRemoteObject;
|
||||
const formatObjectPreview = (preview) => {
|
||||
if (typeof preview === 'undefined') {
|
||||
return '';
|
||||
}
|
||||
if (preview.type === 'object') {
|
||||
if (preview.subtype === 'date') {
|
||||
return chalk_1.chalk.reset(`Date { ${chalk_1.chalk.magenta(String(preview.description))} }`);
|
||||
}
|
||||
const properties = preview.properties.map((property) => {
|
||||
return chalk_1.chalk.reset(`${property.name}: ${formatProperty(property)}`);
|
||||
});
|
||||
if (preview.subtype === 'array') {
|
||||
if (preview.overflow) {
|
||||
return chalk_1.chalk.reset(`[ ${preview.properties
|
||||
.map((p) => formatProperty(p))
|
||||
.join(', ')}, …]`);
|
||||
}
|
||||
return chalk_1.chalk.reset(`[ ${preview.properties.map((p) => formatProperty(p)).join(', ')} ]`);
|
||||
}
|
||||
if (preview.subtype === 'arraybuffer') {
|
||||
return chalk_1.chalk.reset(String(preview.description));
|
||||
}
|
||||
if (preview.subtype === 'dataview') {
|
||||
return chalk_1.chalk.reset(String(preview.description));
|
||||
}
|
||||
if (preview.subtype === 'generator') {
|
||||
return chalk_1.chalk.reset(String(preview.description));
|
||||
}
|
||||
if (preview.subtype === 'iterator') {
|
||||
return chalk_1.chalk.reset(String(preview.description));
|
||||
}
|
||||
if (preview.subtype === 'map') {
|
||||
return chalk_1.chalk.reset(String(preview.description));
|
||||
}
|
||||
if (preview.subtype === 'node') {
|
||||
return chalk_1.chalk.magenta(`<${preview.description}>`);
|
||||
}
|
||||
if (preview.subtype === 'null') {
|
||||
return chalk_1.chalk.white(String(preview.description));
|
||||
}
|
||||
if (preview.subtype === 'promise') {
|
||||
return chalk_1.chalk.reset(String(preview.description));
|
||||
}
|
||||
if (preview.subtype === 'proxy') {
|
||||
return chalk_1.chalk.reset(String(preview.description));
|
||||
}
|
||||
if (preview.subtype === 'regexp') {
|
||||
return chalk_1.chalk.red(String(preview.description));
|
||||
}
|
||||
if (preview.subtype === 'set') {
|
||||
return chalk_1.chalk.reset(String(preview.description));
|
||||
}
|
||||
if (preview.subtype === 'typedarray') {
|
||||
return chalk_1.chalk.reset(String(preview.description));
|
||||
}
|
||||
if (preview.subtype === 'error') {
|
||||
return chalk_1.chalk.reset(String(preview.description));
|
||||
}
|
||||
if (preview.subtype === 'wasmvalue') {
|
||||
return chalk_1.chalk.reset(String(preview.description));
|
||||
}
|
||||
if (preview.subtype === 'weakmap') {
|
||||
return chalk_1.chalk.reset(String(preview.description));
|
||||
}
|
||||
if (preview.subtype === 'weakset') {
|
||||
return chalk_1.chalk.reset(String(preview.description));
|
||||
}
|
||||
if (preview.subtype === 'webassemblymemory') {
|
||||
return chalk_1.chalk.reset(String(preview.description));
|
||||
}
|
||||
if (properties.length === 0) {
|
||||
return chalk_1.chalk.reset('{}');
|
||||
}
|
||||
if (preview.overflow) {
|
||||
return chalk_1.chalk.reset(`{ ${properties.join(', ')}, …}`);
|
||||
}
|
||||
return chalk_1.chalk.reset(`{ ${properties.join(', ')} }`);
|
||||
}
|
||||
return '';
|
||||
};
|
||||
exports.formatObjectPreview = formatObjectPreview;
|
||||
const formatProperty = (property) => {
|
||||
if (property.type === 'string') {
|
||||
return chalk_1.chalk.green(`"${property.value}"`);
|
||||
}
|
||||
if (property.type === 'object') {
|
||||
if (!property.subtype && property.value === 'Object') {
|
||||
return chalk_1.chalk.reset(`{…}`);
|
||||
}
|
||||
if (property.subtype === 'date') {
|
||||
return chalk_1.chalk.reset(`Date { ${chalk_1.chalk.magenta(String(property.value))} }`);
|
||||
}
|
||||
if (property.subtype === 'arraybuffer') {
|
||||
return chalk_1.chalk.reset(`${property.value}`);
|
||||
}
|
||||
if (property.subtype === 'array') {
|
||||
return chalk_1.chalk.reset(`${property.value}`);
|
||||
}
|
||||
if (property.subtype === 'dataview') {
|
||||
return chalk_1.chalk.reset(`${property.value}`);
|
||||
}
|
||||
if (property.subtype === 'error') {
|
||||
return chalk_1.chalk.reset(`${property.value}`);
|
||||
}
|
||||
if (property.subtype === 'generator') {
|
||||
return chalk_1.chalk.reset(`[generator ${property.value}]`);
|
||||
}
|
||||
if (property.subtype === 'iterator') {
|
||||
return chalk_1.chalk.reset(`${property.value}`);
|
||||
}
|
||||
if (property.subtype === 'map') {
|
||||
return chalk_1.chalk.reset(`${property.value}`);
|
||||
}
|
||||
if (property.subtype === 'node') {
|
||||
return chalk_1.chalk.reset(`${property.value}`);
|
||||
}
|
||||
if (property.subtype === 'null') {
|
||||
return chalk_1.chalk.white(`${property.value}`);
|
||||
}
|
||||
if (property.subtype === 'promise') {
|
||||
return chalk_1.chalk.reset(`${property.value}`);
|
||||
}
|
||||
if (property.subtype === 'proxy') {
|
||||
return chalk_1.chalk.reset(`${property.value}`);
|
||||
}
|
||||
if (property.subtype === 'regexp') {
|
||||
return chalk_1.chalk.reset(`${property.value}`);
|
||||
}
|
||||
if (property.subtype === 'set') {
|
||||
return chalk_1.chalk.reset(`${property.value}`);
|
||||
}
|
||||
if (property.subtype === 'typedarray') {
|
||||
return chalk_1.chalk.reset(`${property.value}`);
|
||||
}
|
||||
if (property.subtype === 'wasmvalue') {
|
||||
return chalk_1.chalk.reset(`${property.value}`);
|
||||
}
|
||||
if (property.subtype === 'webassemblymemory') {
|
||||
return chalk_1.chalk.reset(`${property.value}`);
|
||||
}
|
||||
if (property.subtype === 'weakmap') {
|
||||
return chalk_1.chalk.reset(`${property.value}`);
|
||||
}
|
||||
if (property.subtype === 'weakset') {
|
||||
return chalk_1.chalk.reset(`${property.value}`);
|
||||
}
|
||||
return chalk_1.chalk.reset(`${property.value}`);
|
||||
}
|
||||
if (property.type === 'accessor') {
|
||||
return chalk_1.chalk.gray(`get()`);
|
||||
}
|
||||
if (property.type === 'bigint') {
|
||||
return chalk_1.chalk.yellow(`${property.value}`);
|
||||
}
|
||||
if (property.type === 'boolean') {
|
||||
return chalk_1.chalk.yellow(`${property.value}`);
|
||||
}
|
||||
if (property.type === 'function') {
|
||||
return chalk_1.chalk.cyan(`Function`);
|
||||
}
|
||||
if (property.type === 'number') {
|
||||
return chalk_1.chalk.yellow(`${property.value}`);
|
||||
}
|
||||
if (property.type === 'symbol') {
|
||||
return chalk_1.chalk.green(`${property.value}`);
|
||||
}
|
||||
if (property.type === 'undefined') {
|
||||
return chalk_1.chalk.gray(`undefined`);
|
||||
}
|
||||
throw new Error('unexpected property type ' + JSON.stringify(property));
|
||||
};
|
||||
Reference in New Issue
Block a user