Skip to content

Commit

Permalink
load every save in the bank
Browse files Browse the repository at this point in the history
  • Loading branch information
KhafraDev committed Jun 11, 2024
1 parent 7aabf01 commit 62f11d7
Show file tree
Hide file tree
Showing 3 changed files with 215 additions and 149 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
"eventemitter3": "^4.0.7",
"i18next": "^22.4.9",
"localforage": "^1.10.0",
"lodash.clonedeepwith": "^4.5.0",
"lz-string": "^1.4.4",
"worker-timers": "^7.0.53",
"zod": "^3.23.8"
},
"devDependencies": {
"@biomejs/biome": "^1.4.1",
"@types/lodash.clonedeepwith": "^4.5.9",
"@types/lz-string": "^1.3.34",
"deep-object-diff": "^1.1.9",
"dprint": "^0.45.0",
Expand Down
11 changes: 11 additions & 0 deletions src/Utility.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Decimal from 'break_infinity.js'
import cloneDeepWith from 'lodash.clonedeepwith'
import { DOMCacheGetOrSet } from './Cache/DOM'
import { format } from './Synergism'

Expand Down Expand Up @@ -181,3 +182,13 @@ export const createDeferredPromise = <T>() => {

return { resolve, reject, promise }
}

export const deepClone = (value: unknown) => {
return cloneDeepWith(value, (value) => {
if (isDecimal(value) || value instanceof Decimal) {
return new Decimal(value)
}

return value
})
}
Loading

0 comments on commit 62f11d7

Please sign in to comment.