Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: international characters in placeholders #21

Open
jlous opened this issue Dec 5, 2023 · 0 comments
Open

Feature request: international characters in placeholders #21

jlous opened this issue Dec 5, 2023 · 0 comments

Comments

@jlous
Copy link

jlous commented Dec 5, 2023

My project uses the local language in domain model identifiers, including some local non-ascii letters (æøå).
This works fine with with js/ts generally, but does not work with named placeholders.

This means I either have to let requirements from my persistence library pollute my core model, or maintain an anti-corruption layer with redundant DTOs and mappers just for the spelling, or transliterate param objects on the fly, which would be vulnerable to naming collisions.
None of them are very tempting.

Ideally, the requirements for placeholders names should be similar to the ones for js identifiers (but allowing the reserved words).
There may of course be technical reasons why this is impractical, but getting close would be a good design goal.

The js regex unicode classes should be useful for this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Unicode_character_class_escape#examples
TLDR: the character class for "unicode letter" is "\p{L}"

A fair second choice would be a configurable placeholder regex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant