UNPKG

s3-file-manager

Version:

A streamlined, high-level S3 client for Node.js with built-in retries and support for uploads, downloads, and file operations — works with any S3-compatible storage.

22 lines (21 loc) 694 B
"use strict"; /** * Type guard to validate a logger implements the Logger interface. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.isValidLogger = void 0; const isValidLogger = (obj) => { if (obj != null && typeof obj.info === "function" && typeof obj.warn === "function" && typeof obj.error === "function") { return true; } else if (obj != null) { console.error(`Invalid \`logger\` provided (type: ${typeof obj}); ` + `it must have \`info\`, \`warn\`, and \`error\` methods. ` + `Using default console logger instead.`); } return false; }; exports.isValidLogger = isValidLogger;