From a528ecf5a797ae5b38a71f77d01ffafbb8eee143 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Tue, 25 Jul 2023 11:28:07 +0800 Subject: [PATCH] style(cli): remove semicolon --- cli/src/api/templates/js-binding.ts | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/cli/src/api/templates/js-binding.ts b/cli/src/api/templates/js-binding.ts index 5061e7e3..e4ab5133 100644 --- a/cli/src/api/templates/js-binding.ts +++ b/cli/src/api/templates/js-binding.ts @@ -17,51 +17,51 @@ let localFileExisted = false let loadError = null const isMusl = () => { - let musl = false; + let musl = false if (process.platform === 'linux') { - musl = isMuslFromFilesystem(); + musl = isMuslFromFilesystem() if (musl === null) { - musl = isMuslFromReport(); + musl = isMuslFromReport() } if (musl === null) { - musl = isMuslFromChildProcess(); + musl = isMuslFromChildProcess() } } - return musl; -}; + return musl +} -const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-'); +const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-') const isMuslFromFilesystem = () => { try { - return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl'); + return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl') } catch { - return null; + return null } } const isMuslFromReport = () => { - const report = typeof process.report.getReport === 'function' ? process.report.getReport() : null; + const report = typeof process.report.getReport === 'function' ? process.report.getReport() : null if (!report) { - return null; + return null } if (report.header && report.header.glibcVersionRuntime) { - return false; + return false } if (Array.isArray(report.sharedObjects)) { if (report.sharedObjects.some(isFileMusl)) { - return true; + return true } } - return false; -}; + return false +} const isMuslFromChildProcess = () => { try { - return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl'); + return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl') } catch (e) { // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false - return false; + return false } }