You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered: