Typing that library is almost as much work (including a PR for definitely typed) as just writing my own library. Sadly, it does not have typescript type definitions. (7) This is actually a decent implementation. You can easily implement the functionality for ranges if you already have it for positions, but the otherway round you are wasting a lot of cpu cycles. (6) I cannot find its source and it's weird that it only operates on ranges, not single positions. It's algorithm is also not the best one (linear search on the cache). Only when you look at the code you see that this dependency is not a real one. (5) caches, but has a very weird dependency to vfile. (4) is inefficient (not as inefficient as 3 though) due to absence of caching. (3) is super inefficient and does not support (2) only returns the line, its implementation fits into 4 very short lines. (1) is providing a very specific functionality that returns the line string, words and word value but not the line and column number of the cursor (exactly what one would expect from a package called line-info. This already is super inefficient when doing this thousands of times on the same string, as already their APIs don't allow (sane) implementations that support caching where the line breaks are. (1)-(4) all provide the functionality by having a function that takes a position and a string and returns something. So I searched on npm for "position line". I am looking for a lib (with typescript types) that does only that (optionally allowing to convert a line and column back to a position) and does that sufficiently fast. or recruitment posts, we have a sticky for that, still, it's for redditors only, not professional recruiters.įor a syntax tree visualizer I am implementing, I need a way to convert an index referring to a position in a string to a line and column index. "It's perfectly fine to be a redditor with a website, it's not okay to be a website with a reddit account." - Confucius Exceptions can be made for software that will be exceptionally useful for typescript development and pipelines, but this is at the moderation teams discretion. Also no general spam of other products or software, even if it's free. No general advertising, promoting services/libs with zero TS utility or closed source projects We get it, you people build awesome things, but this isn't r/sideproject, if you're posting a project it needs to be open source, you need to link to the repo and most importantly given that this is r/typescript it should not only be in typescript but be something that contributes to TS utility (Not just a random lib that happens to be written in TS).This is r/typescript, lets keep it on topic
0 Comments
Leave a Reply. |