Skip to content

About

A runtime one-off fix for Babel transpiled classes

Resources

Stars

6 stars

Watchers

1 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

fix-babel-class

A runtime one-off fix for Babel broken transpiled classes.

Watch Out

A new transformer is out and running so you don't have to manually address what you need to fix.

This project is abandoned at this point, thank you.

class List extends Array {}

class CustomElement extends HTMLElement {}
customElements.define('custom-element', CustomElement);

// fix whenever you need classes you want
fixBabelClass(List);
fixBabelClass(CustomElement);

console.log(
  // this is **false** without the fix
  new List instanceof List,
  // this **breaks** without the fix
  new CustomElement instanceof CustomElement,
  // this **won't ever work** without the fix
  (new CustomElement).nodeName
);

About

A runtime one-off fix for Babel transpiled classes

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages