Comments (7)
How are you importing it? import BTree from 'sorted-btree';
should work. But if not, try this:
import BTree_ from 'sorted-btree';
const BTree = (BTree_ as any).default as typeof BTree_;
Let me know how it goes.
from btree-typescript.
Though I was able to import with your code.
from btree-typescript.
I hit the same problem with bun.sh.
Here a repo with reproduction:
from btree-typescript.
Please try the code above and let me know how it goes.
from btree-typescript.
@qwertie Thanks for the response! This works:
import BTree_ from "sorted-btree";
const BTree = (BTree_ as any).default as typeof BTree_;
let tree = new BTree();
I have this issue with a 3rd party lib (https://github.com/blinkdb-js/blinkdb), would it be possible to make it work in the expected way? Is this workaround necessary to keep the ES5 compatibility?
And if there is no other way, maybe this should be documented in the Readme.
Cheers and have a great Sunday!
Roman
from btree-typescript.
The workaround is problematic in that sense, that it would be not compatible with npm
or yarn
anymore. That means if we consider a library for publishing, to be used either in Node.js or Bun.sh projects, this approach would not work.
from btree-typescript.
Unfortunately I don't understand the cause of the problem, and I am generally too busy to investigate, so it is unlikely that I will find time to figure out the problem. It appears that enabling esnext in TypeScript options is problematic? Maybe if BTree were recompiled in esnext mode, it would work properly, but we can't do that, because we need to maintain es5 compatibility.
from btree-typescript.
Related Issues (13)
- Key in the btree becomes undefined HOT 2
- Webpack compatibility HOT 7
- Thread safety iterable ? HOT 3
- Performant indexOf? HOT 3
- Set interfaces are not implemented HOT 7
- Middle deletes corrupt the tree. HOT 6
- BTree was not exported HOT 1
- Serialization of sorted btree HOT 2
- No esm build, just common js HOT 2
- Q: find() method HOT 2
- Comparison by value HOT 6
- nextLowerPair malfunctions when key is 0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from btree-typescript.