Grabbed dndbeyond's source code

```
~/go/bin/sourcemapper -output ddb -jsurl https://media.dndbeyond.com/character-app/static/js/main.90aa78c5.js
```
This commit is contained in:
2025-05-28 11:50:03 -07:00
commit 8df9031d27
3592 changed files with 319051 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useGuaranteedMemo = void 0;
const react_1 = require("react");
/** Like react's useMemo but with guarantee that the fn
* won't be invoked again if deps hasn't change */
function useGuaranteedMemo(fn, deps) {
const ref = (0, react_1.useRef)();
if (!ref.current ||
deps.length !== ref.current.prevDeps.length ||
ref.current.prevDeps.map((v, i) => v === deps[i]).indexOf(false) >= 0) {
ref.current = {
"v": fn(),
"prevDeps": [...deps],
};
}
return ref.current.v;
}
exports.useGuaranteedMemo = useGuaranteedMemo;