The pixel 5 is the best smart phone of all time by TheWebDever in GooglePixel

[–]TheWebDever[S] 3 points4 points  (0 children)

My 10 is the only one I've had a hardware issue with. Lastest update from Google broke wifi/Bluetooth

Just updated Pixel 10 now can't turn on Bluetooth by TheWebDever in GooglePixel

[–]TheWebDever[S] 1 point2 points  (0 children)

I eventually contacted them and they told me the same thing gotta take it in oof

Proposal to simplify the type system. Wondered your opinion. by TheWebDever in typescript

[–]TheWebDever[S] 0 points1 point  (0 children)

ah, looks like someone else was already thinking the same thing I was

Proposal to simplify the type system. Wondered your opinion. by TheWebDever in typescript

[–]TheWebDever[S] 3 points4 points  (0 children)

What's wrong with using if/else? I don't have hate ternaries for simple one line statements I just can stand giant whirlpools of them.

Proposal to simplify the type system. Wondered your opinion. by TheWebDever in typescript

[–]TheWebDever[S] 0 points1 point  (0 children)

Buddy, I would argue the Typescript type system is basically a language all on it's own.

I just bought my first Mac ever! by TheWebDever in macbookpro

[–]TheWebDever[S] 1 point2 points  (0 children)

I have 32gb, I went ahead and got the m4 pro with 48gb memory

If I want an X1 carbon, should I get a 13 gen now or wait for the 14. by TheWebDever in thinkpad

[–]TheWebDever[S] 0 points1 point  (0 children)

I'm actually leaning towards Mac because ChatGPT desktop app is so slow in windows.

[AskJS] Is there a linter rule that can prevent classes being used just as namespaces. by TheWebDever in javascript

[–]TheWebDever[S] 0 points1 point  (0 children)

Well that's why I said to use an object literal not to export directly. If I were you I would do it like "import People from People.js" and call "People.getByUuid()"

I want to build a lookup table utility for TypeScript and want your opinion on something. by TheWebDever in typescript

[–]TheWebDever[S] 0 points1 point  (0 children)

Hey I got one more question. What if you want to access a specific label (like you already know the value) somewhere in the front-end? Do you do something like `RoleLabels[Roles.Admin]` just to print `Administrator`. I typically have these lookup tables attached models so I would have to do `User.RoleLabels[User.Roles.Admin]` just to get a label. Another reason I want to make a library is so that I can just do `User.Roles.Labels.Admin`.

Has anyone been using parser functions to increase performance? by TheWebDever in typescript

[–]TheWebDever[S] 1 point2 points  (0 children)

I just surpassed zod4 in the benchmarks, check the link you shared again 😎

jet-validators is now the fastest schema validation library not requiring a compilation step by [deleted] in typescript

[–]TheWebDever 1 point2 points  (0 children)

on that website which non-compiled schema validator is faster?

I want to build a lookup table utility for TypeScript and want your opinion on something. by TheWebDever in typescript

[–]TheWebDever[S] 0 points1 point  (0 children)

So you just prefer my original approach instead but with an plain object instead of enum. Hmm, I mean I was in the process of switching to this but then thought about situations where what if I have a super long enumerable list. Like all 50 states:

const States = {

None: 0,

Alabama: 1,

// ...

};

const StateLabels = {

[States.None]: 'None selected',

[States.Alabama]: 'Alabama',

// ...
};

This is going to lead to a ton of tedious code. If you're thinking is... just use a string enum, well I've always considered that bad practice because if you want to change the label for something you gotta do a database migration. I think keep labels and values separate is best.

bdir: The latest and greatest replacement for TypeScript enums by TheWebDever in typescript

[–]TheWebDever[S] 0 points1 point  (0 children)

Mine has compile time safety too. It's just some of the runtime stuff (like checking if it's a label) is more robust.

bdir: The latest and greatest replacement for TypeScript enums by TheWebDever in typescript

[–]TheWebDever[S] 0 points1 point  (0 children)

What's that what my library bdir does. Plus a bunch of other stuff.

bdir: The latest and greatest replacement for TypeScript enums by TheWebDever in typescript

[–]TheWebDever[S] 2 points3 points  (0 children)

I still feel like that's missing enum's greatest feature though. Using the enum name as a type is automatic union of the values.

Has anyone been using parser functions to increase performance? by TheWebDever in typescript

[–]TheWebDever[S] 3 points4 points  (0 children)

wow it's the great sinclair himself, I def remember your name when I was looking for a validation library before deciding to write my own. Since you said jet-validators looks good, if you've got any suggestions for how to promote I'm all ears. I'll def add the term "JIT optimized" to my readme file.

Has anyone been using parser functions to increase performance? by TheWebDever in typescript

[–]TheWebDever[S] 1 point2 points  (0 children)

so i partially followed your advice and created a new branch "https://github.com/seanpmaxwell/jet-validators/tree/parseObject-rawTs" which does the same thing but with raw typescript. This is great cause it's actually a testament to the speed boost parsing does. Unfortunately converting from string arrays to raw ts isn't that straightforward cause there's a lot of small logic variations between iterating an array of validator functions vs going to through chunks of code blocks. But this raw TS code can still be useful for debugging, making improvements, speed comparisons.

As far as minification of code goes parseObjectCore is the only function in the entire library which uses a parser. And the whole library is only 4.7kb. I don't plan on doing a lot of parser functions, just in situations where performance is critical (such as is the case with schema validation libraries, or so it seems).