MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / parseTarget

Function parseTarget

plugins/jieba/node/build.js:19–36  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

17}
18
19function parseTarget(value) {
20 if (!value) {
21 return {
22 platform: os.platform(),
23 arch: normalizeArch(os.arch()),
24 };
25 }
26
27 const index = value.indexOf('-');
28 if (index === -1) {
29 throw new Error(`Invalid target '${value}'. Expected platform-arch.`);
30 }
31
32 return {
33 platform: value.slice(0, index),
34 arch: normalizeArch(value.slice(index + 1)),
35 };
36}
37
38function run(command, args, options = {}) {
39 execFileSync(command, args, {

Callers 1

build.jsFile · 0.85

Calls 2

normalizeArchFunction · 0.85
sliceMethod · 0.80

Tested by

no test coverage detected