UNPKG

local-elastic-docker

Version:

A package for creating / tearing down local Elasticsearch / Kibana single node clusters via Docker.

56 lines (55 loc) 1.65 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var child_process_1 = require("child_process"); var Utils = /** @class */ (function () { function Utils() { } Utils.exec = function (cmd, verbose, wd) { return new Promise(function (resolve, reject) { var proc = child_process_1.exec(cmd, { maxBuffer: 1024 * 100000, cwd: wd }, function (err, stdout) { if (err) { reject(err); } else { resolve(stdout); } }); if (verbose) { proc.stdout.pipe(process.stdout); proc.stderr.pipe(process.stderr); } }); }; Utils.is_array = function (v) { return Array.isArray(v); }; Utils.is_bool = function (v) { return typeof v === 'boolean'; }; Utils.is_defined = function (v) { return typeof v !== 'undefined'; }; Utils.is_function = function (v) { return typeof v === 'function'; }; Utils.is_integer = function (v) { return (typeof v === 'number') && (v % 1 === 0); }; Utils.is_null = function (v) { return v === null; }; Utils.is_number = function (v) { return typeof (v) === 'number' && isFinite(v); }; Utils.is_object = function (v) { return v !== null && v instanceof Object; }; Utils.is_string = function (v) { return typeof v === 'string'; }; Utils.is_undefined = function (v) { return typeof v === 'undefined'; }; return Utils; }()); exports.Utils = Utils;