UNPKG

universal-common

Version:

Library that provides useful missing base class library functionality.

26 lines (25 loc) 884 B
/** * Provides information about the execution environment. */ export default class Environment { /** * Gets the newline string for the current environment. * @returns {string} The platform-specific newline string. */ static get newLine(): string; /** * Determines if the code is running in a browser environment. * @returns {boolean} True if running in a browser, false otherwise. */ static get isBrowser(): boolean; /** * Determines if the code is running in a Node.js environment. * @returns {boolean} True if running in Node.js, false otherwise. */ static get isNode(): boolean; /** * Gets the operating system platform when in Node.js environment. * @returns {string|null} The platform identifier or null if not in Node.js. */ static get platform(): string; }