UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

29 lines (28 loc) 1.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.runOldBuildDateWarning = runOldBuildDateWarning; function runOldBuildDateWarning() { try { if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'production') { var _window$Eufemia; const buildDate = (_window$Eufemia = window.Eufemia) === null || _window$Eufemia === void 0 ? void 0 : _window$Eufemia.buildDate; if (!buildDate || typeof buildDate !== 'string') { return; } const buildDateValue = new Date(buildDate); if (Number.isNaN(buildDateValue.getTime())) { return; } const threeMonthsAfterBuildDate = new Date(buildDateValue); threeMonthsAfterBuildDate.setMonth(threeMonthsAfterBuildDate.getMonth() + 3); if (Date.now() > threeMonthsAfterBuildDate.getTime()) { console.log('Your Eufemia version is older than 3 months. Please update.'); } } } catch (error) { console.error(error); } } //# sourceMappingURL=runOldBuildDateWarning.js.map