first commit

This commit is contained in:
2026-03-10 16:18:05 +00:00
commit 11f9c069b5
31635 changed files with 3187747 additions and 0 deletions

2
node_modules/@expo/fingerprint/cli/build/cli.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
#!/usr/bin/env node
export type Command = (argv?: string[]) => void;

106
node_modules/@expo/fingerprint/cli/build/cli.js generated vendored Normal file
View File

@@ -0,0 +1,106 @@
#!/usr/bin/env node
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const arg_1 = __importDefault(require("arg"));
const chalk_1 = __importDefault(require("chalk"));
const debug_1 = __importDefault(require("debug"));
const getenv_1 = require("getenv");
const runLegacyCLIAsync_1 = require("./runLegacyCLIAsync");
const errors_1 = require("./utils/errors");
const Log = __importStar(require("./utils/log"));
// Setup before requiring `debug`.
if ((0, getenv_1.boolish)('EXPO_DEBUG', false)) {
debug_1.default.enable('@expo/fingerprint:*');
}
else if (debug_1.default.enabled('@expo/fingerprint:')) {
process.env.EXPO_DEBUG = '1';
}
const commands = {
// Add a new command here
'fingerprint:generate': () => import('./commands/generateFingerprint.js').then((i) => i.generateFingerprintAsync),
'fingerprint:diff': () => import('./commands/diffFingerprints.js').then((i) => i.diffFingerprintsAsync),
};
const args = (0, arg_1.default)({
// Types
'--version': Boolean,
'--help': Boolean,
// Aliases
'-h': '--help',
}, {
permissive: true,
});
if (args['--version']) {
// Version is added in the build script.
const packageJSON = require('../../package.json');
console.log(packageJSON.version);
process.exit(0);
}
const command = args._[0];
const commandArgs = args._.slice(1);
// Handle `--help` flag
if ((args['--help'] && !command) || !command) {
Log.exit((0, chalk_1.default) `
{bold Usage}
{dim $} npx @expo/fingerprint <command>
{bold Commands}
${Object.keys(commands).sort().join(', ')}
{bold Options}
--help, -h Displays this message
For more information run a command with the --help flag
{dim $} npx @expo/fingerprint fingerprint:generate --help
`, 0);
}
// Push the help flag to the subcommand args.
if (args['--help']) {
commandArgs.push('--help');
}
// Install exit hooks
process.on('SIGINT', () => process.exit(0));
process.on('SIGTERM', () => process.exit(0));
if (!(command in commands)) {
(0, runLegacyCLIAsync_1.runLegacyCLIAsync)(args._).catch(errors_1.logCmdError);
}
else {
commands[command]()
.then((exec) => exec(commandArgs))
.catch(errors_1.logCmdError);
}

View File

@@ -0,0 +1,2 @@
import { Command } from '../cli';
export declare const diffFingerprintsAsync: Command;

View File

@@ -0,0 +1,79 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.diffFingerprintsAsync = void 0;
const chalk_1 = __importDefault(require("chalk"));
const index_1 = require("../../../build/index");
const args_1 = require("../utils/args");
const errors_1 = require("../utils/errors");
const Log = __importStar(require("../utils/log"));
const readFingerprintFileAsync_1 = __importDefault(require("../utils/readFingerprintFileAsync"));
const diffFingerprintsAsync = async (argv) => {
const args = (0, args_1.assertArgs)({
// Types
'--help': Boolean,
// Aliases
'-h': '--help',
}, argv ?? []);
if (args['--help']) {
Log.exit((0, chalk_1.default) `
{bold Description}
Diff two fingerprints
{bold Usage}
{dim $} npx @expo/fingerprint fingerprint:diff <fingerprintFile1> <fingerprintFile2>
Options
-h, --help Output usage information
`, 0);
}
const fingerprintFile1 = (0, args_1.getFileArgumentAtIndex)(args, 0);
const fingerprintFile2 = (0, args_1.getFileArgumentAtIndex)(args, 1);
const [fingerprint1ToDiff, fingerprint2ToDiff] = await Promise.all([
(0, readFingerprintFileAsync_1.default)(fingerprintFile1),
(0, readFingerprintFileAsync_1.default)(fingerprintFile2),
]);
try {
const diff = (0, index_1.diffFingerprints)(fingerprint1ToDiff, fingerprint2ToDiff);
console.log(JSON.stringify(diff, null, 2));
}
catch (e) {
throw new errors_1.CommandError(e.message);
}
};
exports.diffFingerprintsAsync = diffFingerprintsAsync;

View File

@@ -0,0 +1,2 @@
import { Command } from '../cli';
export declare const generateFingerprintAsync: Command;

View File

@@ -0,0 +1,131 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateFingerprintAsync = void 0;
const chalk_1 = __importDefault(require("chalk"));
const getenv_1 = require("getenv");
const index_1 = require("../../../build/index");
const args_1 = require("../utils/args");
const errors_1 = require("../utils/errors");
const Log = __importStar(require("../utils/log"));
const withConsoleDisabledAsync_1 = require("../utils/withConsoleDisabledAsync");
const generateFingerprintAsync = async (argv) => {
const args = (0, args_1.assertArgs)({
// Types
'--help': Boolean,
'--platform': [String],
'--concurrent-io-limit': Number,
'--hash-algorithm': String,
'--ignore-path': [String],
'--source-skips': Number,
'--debug': Boolean,
// Aliases
'-h': '--help',
}, argv ?? []);
if (args['--help']) {
Log.exit((0, chalk_1.default) `
{bold Description}
Generate fingerprint for a project
{bold Usage}
{dim $} npx @expo/fingerprint fingerprint:generate
Options
--platform <string[]> Limit native files to those for specified platforms. Default is ['android', 'ios'].
--concurrent-io-limit <number> I/O concurrent limit. Default is the number of CPU cores.
--hash-algorithm <string> The algorithm to use for crypto.createHash(). Default is 'sha1'.
--ignore-path <string[]> Ignore files and directories from hashing. The supported pattern is the same as glob().
--source-skips <number> Skips some sources from fingerprint. Value is the result of bitwise-OR'ing desired values of SourceSkips. Default is DEFAULT_SOURCE_SKIPS.
--debug Whether to include verbose debug information in output
-h, --help Output usage information
`, 0);
}
const platforms = args['--platform'];
if (platforms) {
if (!Array.isArray(platforms)) {
throw new errors_1.CommandError(`Invalid value for --platform`);
}
if (!platforms.every((elem) => ['ios', 'android'].includes(elem))) {
throw new errors_1.CommandError(`Invalid value for --platform: ${platforms}`);
}
}
const concurrentIoLimit = args['--concurrent-io-limit'];
if (concurrentIoLimit && !Number.isInteger(concurrentIoLimit)) {
throw new errors_1.CommandError(`Invalid value for --concurrent-io-limit argument: ${concurrentIoLimit}`);
}
const hashAlgorithm = args['--hash-algorithm'];
if (hashAlgorithm && typeof hashAlgorithm !== 'string') {
throw new errors_1.CommandError(`Invalid value for --hash-algorithm: ${hashAlgorithm}`);
}
const ignorePaths = args['--ignore-path'];
if (ignorePaths) {
if (!Array.isArray(ignorePaths)) {
throw new errors_1.CommandError(`Invalid value for --ignore-path`);
}
if (!ignorePaths.every((elem) => typeof elem === 'string')) {
throw new errors_1.CommandError(`Invalid value for --ignore-path: ${ignorePaths}`);
}
}
const sourceSkips = args['--source-skips'];
if (sourceSkips && !Number.isInteger(sourceSkips)) {
throw new errors_1.CommandError(`Invalid value for --source-skips argument: ${sourceSkips}`);
}
const options = {
debug: !!process.env.DEBUG || args['--debug'],
silent: true,
useRNCoreAutolinkingFromExpo: process.env['USE_RNCORE_AUTOLINKING_FROM_EXPO']
? (0, getenv_1.boolish)('USE_RNCORE_AUTOLINKING_FROM_EXPO')
: undefined,
...(platforms ? { platforms } : null),
...(concurrentIoLimit ? { concurrentIoLimit } : null),
...(hashAlgorithm ? { hashAlgorithm } : null),
...(ignorePaths ? { ignorePaths } : null),
...(sourceSkips ? { sourceSkips } : null),
};
const projectRoot = (0, args_1.getProjectRoot)(args);
const result = await (0, withConsoleDisabledAsync_1.withConsoleDisabledAsync)(async () => {
try {
return await (0, index_1.createFingerprintAsync)(projectRoot, options);
}
catch (e) {
throw new errors_1.CommandError(e.message);
}
});
console.log(JSON.stringify(result));
};
exports.generateFingerprintAsync = generateFingerprintAsync;

View File

@@ -0,0 +1 @@
export declare function runLegacyCLIAsync(args: string[]): Promise<void>;

View File

@@ -0,0 +1,45 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.runLegacyCLIAsync = runLegacyCLIAsync;
const readFingerprintFileAsync_js_1 = __importDefault(require("./utils/readFingerprintFileAsync.js"));
const index_js_1 = require("../../build/index.js");
async function runLegacyCLIAsync(args) {
if (args.length !== 1 && args.length !== 2 && args.length !== 3) {
console.log(`Usage: npx @expo/fingerprint <projectRoot> [fingerprintFile1ToDiff] [fingerprintFile2ToDiff]`);
process.exit(1);
}
const projectRoot = args[0];
const fingerprintFile1ToDiff = args[1];
const fingerprintFile2ToDiff = args[2];
const [fingerprint1ToDiff, fingerprint2ToDiff] = await Promise.all([
fingerprintFile1ToDiff ? (0, readFingerprintFileAsync_js_1.default)(fingerprintFile1ToDiff) : null,
fingerprintFile2ToDiff ? (0, readFingerprintFileAsync_js_1.default)(fingerprintFile2ToDiff) : null,
]);
const options = {
debug: !!process.env.DEBUG,
useRNCoreAutolinkingFromExpo: process.env.USE_RNCORE_AUTOLINKING_FROM_EXPO
? ['1', 'true'].includes(process.env.USE_RNCORE_AUTOLINKING_FROM_EXPO)
: undefined,
};
try {
if (fingerprint1ToDiff && fingerprint2ToDiff) {
const diff = (0, index_js_1.diffFingerprints)(fingerprint1ToDiff, fingerprint2ToDiff);
console.log(JSON.stringify(diff, null, 2));
}
else if (fingerprint1ToDiff) {
const diff = await (0, index_js_1.diffFingerprintChangesAsync)(fingerprint1ToDiff, projectRoot, options);
console.log(JSON.stringify(diff, null, 2));
}
else {
const fingerprint = await (0, index_js_1.createFingerprintAsync)(projectRoot, options);
console.log(JSON.stringify(fingerprint, null, 2));
}
}
catch (e) {
console.error('Uncaught Error', e);
process.exit(1);
}
}

View File

@@ -0,0 +1,17 @@
import arg from 'arg';
/**
* Parse the first argument as a project directory.
*
* @returns valid project directory.
*/
export declare function getProjectRoot(args: arg.Result<arg.Spec>): string;
export declare function getFileArgumentAtIndex(args: arg.Result<arg.Spec>, index: number): string;
/**
* Parse args and assert unknown options.
*
* @param schema the `args` schema for parsing the command line arguments.
* @param argv extra strings
* @returns processed args object.
*/
export declare function assertArgs(schema: arg.Spec, argv: string[]): arg.Result<arg.Spec>;
export declare function requireArg(args: arg.Result<arg.Spec>, name: any): any;

94
node_modules/@expo/fingerprint/cli/build/utils/args.js generated vendored Normal file
View File

@@ -0,0 +1,94 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getProjectRoot = getProjectRoot;
exports.getFileArgumentAtIndex = getFileArgumentAtIndex;
exports.assertArgs = assertArgs;
exports.requireArg = requireArg;
// Common utilities for interacting with `args` library.
// These functions should be used by every command.
const arg_1 = __importDefault(require("arg"));
const fs_1 = require("fs");
const path_1 = require("path");
const Log = __importStar(require("./log"));
/**
* Parse the first argument as a project directory.
*
* @returns valid project directory.
*/
function getProjectRoot(args) {
const projectRoot = (0, path_1.resolve)(args._[0] || '.');
if (!(0, fs_1.existsSync)(projectRoot)) {
Log.exit(`Invalid project root: ${projectRoot}`);
}
return projectRoot;
}
function getFileArgumentAtIndex(args, index) {
const path = (0, path_1.resolve)(args._[index]);
if (!(0, fs_1.existsSync)(path)) {
Log.exit(`Invalid file: ${path}`);
}
return path;
}
/**
* Parse args and assert unknown options.
*
* @param schema the `args` schema for parsing the command line arguments.
* @param argv extra strings
* @returns processed args object.
*/
function assertArgs(schema, argv) {
try {
return (0, arg_1.default)(schema, { argv });
}
catch (error) {
// Ensure unknown options are handled the same way.
if (error.code === 'ARG_UNKNOWN_OPTION') {
Log.exit(error.message, 1);
}
// Otherwise rethrow the error.
throw error;
}
}
function requireArg(args, name) {
const value = args[name];
if (value === undefined || value === null) {
Log.exit(`${name} must be provided`, 1);
}
return value;
}

View File

@@ -0,0 +1,10 @@
/**
* General error, formatted as a message in red text when caught by expo-cli (no stack trace is printed). Should be used in favor of `log.error()` in most cases.
*/
export declare class CommandError extends Error {
code: string;
name: string;
readonly isCommandError = true;
constructor(code: string, message?: string);
}
export declare function logCmdError(error: any): never;

View File

@@ -0,0 +1,41 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CommandError = void 0;
exports.logCmdError = logCmdError;
const assert_1 = require("assert");
const chalk_1 = __importDefault(require("chalk"));
const log_1 = require("./log");
const ERROR_PREFIX = 'Error: ';
/**
* General error, formatted as a message in red text when caught by expo-cli (no stack trace is printed). Should be used in favor of `log.error()` in most cases.
*/
class CommandError extends Error {
code;
name = 'CommandError';
isCommandError = true;
constructor(code, message = '') {
super('');
this.code = code;
// If e.toString() was called to get `message` we don't want it to look
// like "Error: Error:".
if (message.startsWith(ERROR_PREFIX)) {
message = message.substring(ERROR_PREFIX.length);
}
this.message = message || code;
}
}
exports.CommandError = CommandError;
function logCmdError(error) {
if (!(error instanceof Error)) {
throw error;
}
if (error instanceof CommandError || error instanceof assert_1.AssertionError) {
// Print the stack trace in debug mode only.
(0, log_1.exit)(error);
}
const errorDetails = error.stack ? '\n' + chalk_1.default.gray(error.stack) : '';
(0, log_1.exit)(chalk_1.default.red(error.toString()) + errorDetails);
}

View File

@@ -0,0 +1,11 @@
export declare function time(label?: string): void;
export declare function timeEnd(label?: string): void;
export declare function error(...message: string[]): void;
/** Print an error and provide additional info (the stack trace) in debug mode. */
export declare function exception(e: Error): void;
export declare function warn(...message: string[]): void;
export declare function log(...message: string[]): void;
/** Clear the terminal of all text. */
export declare function clear(): void;
/** Log a message and exit the current process. If the `code` is non-zero then `console.error` will be used instead of `console.log`. */
export declare function exit(message: string | Error, code?: number): never;

53
node_modules/@expo/fingerprint/cli/build/utils/log.js generated vendored Normal file
View File

@@ -0,0 +1,53 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.time = time;
exports.timeEnd = timeEnd;
exports.error = error;
exports.exception = exception;
exports.warn = warn;
exports.log = log;
exports.clear = clear;
exports.exit = exit;
const chalk_1 = __importDefault(require("chalk"));
function time(label) {
console.time(label);
}
function timeEnd(label) {
console.timeEnd(label);
}
function error(...message) {
console.error(...message);
}
/** Print an error and provide additional info (the stack trace) in debug mode. */
function exception(e) {
error(chalk_1.default.red(e.toString()) + (process.env.EXPO_DEBUG ? '\n' + chalk_1.default.gray(e.stack) : ''));
}
function warn(...message) {
console.warn(...message.map((value) => chalk_1.default.yellow(value)));
}
function log(...message) {
console.log(...message);
}
/** Clear the terminal of all text. */
function clear() {
process.stdout.write(process.platform === 'win32' ? '\x1B[2J\x1B[0f' : '\x1B[2J\x1B[3J\x1B[H');
}
/** Log a message and exit the current process. If the `code` is non-zero then `console.error` will be used instead of `console.log`. */
function exit(message, code = 1) {
if (message instanceof Error) {
exception(message);
process.exit(code);
}
if (message) {
if (code === 0) {
log(message);
}
else {
error(message);
}
}
process.exit(code);
}

View File

@@ -0,0 +1,2 @@
import { Fingerprint } from '../../../build/Fingerprint.types';
export default function readFingerprintFileAsync(path: string): Promise<Fingerprint>;

View File

@@ -0,0 +1,15 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = readFingerprintFileAsync;
const promises_1 = __importDefault(require("fs/promises"));
async function readFingerprintFileAsync(path) {
try {
return JSON.parse(await promises_1.default.readFile(path, 'utf-8'));
}
catch (e) {
throw new Error(`Unable to read fingerprint file ${path}: ${e.message}`);
}
}

View File

@@ -0,0 +1 @@
export declare function withConsoleDisabledAsync<T>(block: () => Promise<T>): Promise<T>;

View File

@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.withConsoleDisabledAsync = withConsoleDisabledAsync;
async function withConsoleDisabledAsync(block) {
const loggingFunctions = {
log: console.log,
warn: console.warn,
error: console.error,
};
// Disable logging for this command since the only thing printed to stdout should be the JSON output.
console.log = function () { };
console.warn = function () { };
console.error = function () { };
try {
return await block();
}
finally {
// Re-enable logging functions for testing.
console.log = loggingFunctions.log;
console.warn = loggingFunctions.warn;
console.error = loggingFunctions.error;
}
}