tsify icon indicating copy to clipboard operation
tsify copied to clipboard

update is_js_ident to cover most cases

Open Pistonight opened this issue 1 year ago • 6 comments

Closes #37

Added new test case for validation

Validation: cargo test

Pistonight avatar Oct 13 '23 17:10 Pistonight

@madonoharu Can you look over this PR and see if this could be merged?

Pistonight avatar Oct 15 '23 05:10 Pistonight

@madonoharu it'd be great if we could get this merged

Swolebrain avatar Dec 21 '23 20:12 Swolebrain

@Pistonight did you find a way around this, since the PR hasn't been accepted in so long?

I for one ended up creating a build script to fix the types with sed after building using wasm-pack

Swolebrain avatar Dec 27 '23 17:12 Swolebrain

FYI, this will result in a lot of false negatives for what is a valid JS identifier (e.g. many, many Unicode characters are valid in JS identifiers). I took a different approach in #46 by letting the user handle quoting with a new attribute. Sorry, I didn't look hard enough at the PRs to see this one was already open before doing my work.

Hopefully one of these two PRs will be accepted soon 😄

samkearney avatar Jan 16 '24 00:01 samkearney

That's what the "most cases" is about :) Quoting a false positive is better than missing one though, since it would still be functional

Pistonight avatar Jan 16 '24 07:01 Pistonight

@Pistonight did you find a way around this, since the PR hasn't been accepted in so long?

I for one ended up creating a build script to fix the types with sed after building using wasm-pack

I essentially did the same thing

Pistonight avatar Jan 16 '24 07:01 Pistonight