isaac-lua-polyfill
v1.1.1
Published
Lua polyfills for The Binding of Isaac: Repentance.
Downloads
6
Maintainers
Readme
isaac-lua-polyfill
This package contains JavaScript polyfills for The Binding of Isaac: Repentance. This is useful when you need to import isaac-typescript-definitions
or isaacscript-common
inside of JavaScript/TypeScript environments such as the browser or Node.js. For example, you might want to write unit tests in JavaScript/TypeScript for functions that are used in your mod, and then run them in CI.
Not all polyfills are included. However, enough polyfills are included such that you can import basic things in either isaac-typescript-definitions
or isaacscript-common
without getting any run-time errors.
Usage
Import the library at the top of the file to register the polyfills:
import "isaac-lua-polyfill";
(You need to import for side-effects because this library mutates the globalThis
variable.)
Usage with Jest
You can put "isaac-lua-polyfill"
into setupFiles
in your jest.config.js
to have it automatically loaded for each test suite:
module.exports = {
setupFiles: ["isaac-lua-polyfill"],
};