Skip to content

Unexpected behavior when mixing numbers and characters on a name #42

@ricardojmendez

Description

@ricardojmendez

There's unexpected behavior when mixing numbers and characters on an identifier which is not demonstrated on any of the tests.

This makes sense:

(->kebab-case-keyword :user_id)
=> :user-id

(->kebab-case-keyword :user_1)
=> :user-1

But then...

(->kebab-case-keyword :user1_124)
=> :user-1-124

(->kebab-case-keyword :user1)
=> :user-1

It gets worse:

(->kebab-case-keyword :object1a2)
=> :object-1a-2

While I can see from the source this is the intended grouping behavior, this goes agains the principle of least surprise. I'm not sending a PR to change it since I expect it would break existing use (need to assume that someone, somewhere is relying on this).

Thoughts? What was the rationale behind this?

This looks related to #22.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions