1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-17 19:05:32 -04:00

remove mem

This commit is contained in:
2022-10-23 12:58:23 -04:00
parent 5e02027241
commit 76300b9cd2
3 changed files with 155 additions and 216 deletions

View File

@@ -1,9 +1,6 @@
import hexToRgba from "hex-to-rgba";
import mem from "mem";
import hexToRgbaOrig from "hex-to-rgba";
// removes spaces from default hex-to-rgba output and caches the result
const memoized = mem((color: string, alpha?: number) => hexToRgba(color, alpha).replace(/\s/g, ""), {
cacheKey: (arguments_) => arguments_.join(","), // https://github.com/sindresorhus/mem#caching-strategy
});
// removes spaces from default hex-to-rgba output
const hexToRgba = (color: string, alpha?: number) => hexToRgbaOrig(color, alpha).replace(/\s/g, "");
export default memoized;
export default hexToRgba;