UNPKG

azure-pipelines-logging

Version:
25 lines (24 loc) 1.05 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.log = exports.format = exports.command = void 0; const array_prototype_flatmap_1 = __importDefault(require("array.prototype.flatmap")); const command_1 = require("./internal/command"); function command(area, action, ...properties) { const propsString = properties.length === 0 ? "" : command_1.serializeProperties(properties[0]); const maybeSpace = propsString.length === 0 ? "" : " "; return message => `##vso[${area}.${action}${maybeSpace}${propsString}]${message}`; } exports.command = command; function format(format) { return (...message) => ((message.length === 0 ? [""] : array_prototype_flatmap_1.default(message, arg => arg.split("\n"))) .map(line => `##[${format}]${line}`) .join("\n")); } exports.format = format; function log(message) { console.log(message); } exports.log = log;