isaac-lua-polyfill

1.1.1 • Public • Published

isaac-lua-polyfill

npm version

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"],
};

Package Sidebar

Install

npm i isaac-lua-polyfill

Weekly Downloads

3

Version

1.1.1

License

GPL-3.0

Unpacked Size

39.5 kB

Total Files

4

Last publish

Collaborators

  • zamiell