UNPKG

mcard-js

Version:

A JavaScript implementation of MCard - A data model for persistently storing content with cryptographic hashing and timestamping

35 lines (31 loc) 939 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; /** * Browser-compatible dotenv replacement * Provides a no-op implementation of dotenv for browser environments */ // Create browser-safe "process.env" equivalent const browserEnv = {}; // Create a browser-safe version of the dotenv module const dotenvBrowser = { // No-op config function that returns an empty object in browser context config: () => ({ parsed: {} }), // Provide access to our browser environment variables env: browserEnv, // Add any variables from window.__ENV__ if it exists (useful for SSR) init: () => { if (typeof window !== 'undefined' && window.__ENV__) { Object.assign(browserEnv, window.__ENV__); } return browserEnv; } }; // Initialize immediately dotenvBrowser.init(); var _default = exports.default = dotenvBrowser; //# sourceMappingURL=dotenv-browser.js.map