1 line
2.4 KiB
JSON
1 line
2.4 KiB
JSON
{"ast":null,"code":"// Copyright 2017 Lovell Fuller and others.\n// SPDX-License-Identifier: Apache-2.0\n\n'use strict';\n\nconst fs = require('fs');\n\n/**\n * The path where we can find the ldd\n */\nconst LDD_PATH = '/usr/bin/ldd';\n\n/**\n * Read the content of a file synchronous\n *\n * @param {string} path\n * @returns {string}\n */\nconst readFileSync = path => fs.readFileSync(path, 'utf-8');\n\n/**\n * Read the content of a file\n *\n * @param {string} path\n * @returns {Promise<string>}\n */\nconst readFile = path => new Promise((resolve, reject) => {\n fs.readFile(path, 'utf-8', (err, data) => {\n if (err) {\n reject(err);\n } else {\n resolve(data);\n }\n });\n});\nmodule.exports = {\n LDD_PATH,\n readFileSync,\n readFile\n};","map":{"version":3,"names":["fs","require","LDD_PATH","readFileSync","path","readFile","Promise","resolve","reject","err","data","module","exports"],"sources":["/Users/shoofle/Projects/the-forest/node_modules/detect-libc/lib/filesystem.js"],"sourcesContent":["// Copyright 2017 Lovell Fuller and others.\n// SPDX-License-Identifier: Apache-2.0\n\n'use strict';\n\nconst fs = require('fs');\n\n/**\n * The path where we can find the ldd\n */\nconst LDD_PATH = '/usr/bin/ldd';\n\n/**\n * Read the content of a file synchronous\n *\n * @param {string} path\n * @returns {string}\n */\nconst readFileSync = (path) => fs.readFileSync(path, 'utf-8');\n\n/**\n * Read the content of a file\n *\n * @param {string} path\n * @returns {Promise<string>}\n */\nconst readFile = (path) => new Promise((resolve, reject) => {\n fs.readFile(path, 'utf-8', (err, data) => {\n if (err) {\n reject(err);\n } else {\n resolve(data);\n }\n });\n});\n\nmodule.exports = {\n LDD_PATH,\n readFileSync,\n readFile\n};\n"],"mappings":"AAAA;AACA;;AAEA,YAAY;;AAEZ,MAAMA,EAAE,GAAGC,OAAO,CAAC,IAAI,CAAC;;AAExB;AACA;AACA;AACA,MAAMC,QAAQ,GAAG,cAAc;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,YAAY,GAAIC,IAAI,IAAKJ,EAAE,CAACG,YAAY,CAACC,IAAI,EAAE,OAAO,CAAC;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,QAAQ,GAAID,IAAI,IAAK,IAAIE,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;EAC1DR,EAAE,CAACK,QAAQ,CAACD,IAAI,EAAE,OAAO,EAAE,CAACK,GAAG,EAAEC,IAAI,KAAK;IACxC,IAAID,GAAG,EAAE;MACPD,MAAM,CAACC,GAAG,CAAC;IACb,CAAC,MAAM;MACLF,OAAO,CAACG,IAAI,CAAC;IACf;EACF,CAAC,CAAC;AACJ,CAAC,CAAC;AAEFC,MAAM,CAACC,OAAO,GAAG;EACfV,QAAQ;EACRC,YAAY;EACZE;AACF,CAAC","ignoreList":[]},"metadata":{},"sourceType":"script","externalDependencies":[]} |