MCPcopy
hub / github.com/meteor/meteor / toArchArray

Function toArchArray

tools/isobuild/package-api.js:24–51  ·  view source on GitHub ↗
(arch)

Source from the content-addressed store, hash-verified

22}
23
24function toArchArray(arch) {
25 if (! Array.isArray(arch)) {
26 arch = arch ? [arch] : compiler.ALL_ARCHES;
27 }
28
29 const seen = Object.create(null);
30
31 arch.splice(0).forEach(where => {
32 if (seen[where]) return;
33 seen[where] = true;
34 arch.push(...archinfo.mapWhereToArches(where));
35 });
36
37 // avoid using _.each so as to not add more frames to skip
38 for (var i = 0; i < arch.length; ++i) {
39 var inputArch = arch[i];
40 var isMatch = _.any(_.map(compiler.ALL_ARCHES, function (actualArch) {
41 return archinfo.matches(actualArch, inputArch);
42 }));
43 if (! isMatch) {
44 buildmessage.error(
45 "Invalid 'where' argument: '" + inputArch + "'",
46 // skip toArchArray in addition to the actual API function
47 {useMyCaller: 1});
48 }
49 }
50 return arch;
51}
52
53// Iterates over the list of target archs and calls f(arch) for all archs
54// that match an element of self.allarchs.

Callers 5

useMethod · 0.85
implyMethod · 0.85
mainModuleMethod · 0.85
_addFilesMethod · 0.85
"export"Method · 0.85

Calls 4

mapMethod · 0.80
matchesMethod · 0.80
forEachMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…