From 105b814acfc3f8b0286d0f59f3204be3dec3f9d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Thu, 25 Aug 2022 21:45:59 +0200 Subject: Fixes wrong types in libraries.interfaces.ts (#3982) * Fix getLibrary functions * Fix library.path usage in Zig compiler --- lib/compilers/zig.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'lib/compilers/zig.js') diff --git a/lib/compilers/zig.js b/lib/compilers/zig.js index 1a9d0512d..d524fc1de 100644 --- a/lib/compilers/zig.js +++ b/lib/compilers/zig.js @@ -132,14 +132,12 @@ export class ZigCompiler extends BaseCompiler { } getIncludeArguments(libraries) { - return _.flatten( - _.map(libraries, selectedLib => { - const foundVersion = this.findLibVersion(selectedLib); - if (!foundVersion) return false; - // Zig should not have more than 1 path - return ['--pkg-begin', foundVersion.name, foundVersion.path, '--pkg-end']; - }), - ); + return libraries.flatMap(selectedLib => { + const foundVersion = this.findLibVersion(selectedLib); + if (!foundVersion) return []; + // Zig should not have more than 1 path, but it's still an array so spread it + return ['--pkg-begin', foundVersion.name, ...foundVersion.path, '--pkg-end']; + }); } getIrOutputFilename(inputFilename) { -- cgit v1.2.3