mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
JS: Format with Prettier v2.4.1 [3/n]
Summary: Changelog: [General][Internal] Reviewed By: zertosh Differential Revision: D31883447 fbshipit-source-id: cbbf85e4bf935096d242336f41bf0cc5d6f92359
This commit is contained in:
committed by
Facebook GitHub Bot
parent
4e587a1b7d
commit
77ecc7ede1
@@ -15,22 +15,24 @@ const fs = require('fs');
|
||||
|
||||
const argv = process.argv.slice(2);
|
||||
let outputPath;
|
||||
for (let i = 0; i < argv.length;) {
|
||||
if (argv[i] === '-o') {
|
||||
outputPath = argv[i + 1];
|
||||
argv.splice(i, 2);
|
||||
continue;
|
||||
}
|
||||
++i;
|
||||
for (let i = 0; i < argv.length; ) {
|
||||
if (argv[i] === '-o') {
|
||||
outputPath = argv[i + 1];
|
||||
argv.splice(i, 2);
|
||||
continue;
|
||||
}
|
||||
++i;
|
||||
}
|
||||
if (!argv.length) {
|
||||
process.stderr.write(
|
||||
'Usage: node compose-source-maps.js <packager_sourcemap> <compiler_sourcemap> [-o output_file]\n'
|
||||
'Usage: node compose-source-maps.js <packager_sourcemap> <compiler_sourcemap> [-o output_file]\n',
|
||||
);
|
||||
process.exitCode = -1;
|
||||
} else {
|
||||
const [packagerSourcemapPath, compilerSourcemapPath] = argv.splice(0, 2);
|
||||
const packagerSourcemap = JSON.parse(fs.readFileSync(packagerSourcemapPath, 'utf8'));
|
||||
const packagerSourcemap = JSON.parse(
|
||||
fs.readFileSync(packagerSourcemapPath, 'utf8'),
|
||||
);
|
||||
const compilerSourcemap = JSON.parse(
|
||||
fs.readFileSync(compilerSourcemapPath, 'utf8'),
|
||||
);
|
||||
@@ -53,7 +55,9 @@ if (!argv.length) {
|
||||
);
|
||||
}
|
||||
|
||||
const composedMapJSON = JSON.stringify(composeSourceMaps([packagerSourcemap, compilerSourcemap]));
|
||||
const composedMapJSON = JSON.stringify(
|
||||
composeSourceMaps([packagerSourcemap, compilerSourcemap]),
|
||||
);
|
||||
if (outputPath) {
|
||||
fs.writeFileSync(outputPath, composedMapJSON, 'utf8');
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user