| Linux premium331.web-hosting.com 4.18.0-553.80.1.lve.el8.x86_64 #1 SMP Wed Oct 22 19:29:36 UTC 2025 x86_64 Path : /home/livedhms/lmgt/node_modules/goober/src/core/ |
| Current File : /home/livedhms/lmgt/node_modules/goober/src/core/update.js |
import { getSheet } from './get-sheet';
/**
* Extracts and wipes the cache
* @returns {String}
*/
export let extractCss = (target) => {
let sheet = getSheet(target);
let out = sheet.data;
sheet.data = '';
return out;
};
/**
* Updates the target and keeps a local cache
* @param {String} css
* @param {Object} sheet
* @param {Boolean} append
* @param {?String} cssToReplace
*/
export let update = (css, sheet, append, cssToReplace) => {
cssToReplace
? (sheet.data = sheet.data.replace(cssToReplace, css))
: sheet.data.indexOf(css) === -1 &&
(sheet.data = append ? css + sheet.data : sheet.data + css);
};