From df08e299372ea45104186178aea29a879cc1eca8 Mon Sep 17 00:00:00 2001 From: Rafa Mel Date: Fri, 19 Feb 2021 18:47:35 +0100 Subject: [PATCH] feat(tasks): print can take no arguments --- src/tasks/stdio/print.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tasks/stdio/print.ts b/src/tasks/stdio/print.ts index 3f8afaa..265b3f4 100644 --- a/src/tasks/stdio/print.ts +++ b/src/tasks/stdio/print.ts @@ -2,10 +2,10 @@ import { Task, Context } from '../../definitions'; import { addPrefix } from '../../helpers/prefix'; import util from 'util'; -export function print(item: any, ...data: any[]): Task.Sync { +export function print(...data: any[]): Task.Sync { return (ctx: Context): void => { const str = addPrefix( - util.format(item, ...data) + '\n', + data.length ? util.format(data[0], ...data.slice(1)) + '\n' : '\n', null, 'print', ctx