Skip to content

[BUG] sentenceCase actual output does not match with type hint/info and the expected example output #83

Description

@deanrih

Function Affected

sentenceCase

Current Behavior

Given input of hello-world from the example here and from the source:

* const result = sentenceCase('hello-world')

and INVALID_USER_INPUT from the source:
* const errorMsg = sentenceCase('INVALID_USER_INPUT' as const)

the comment giving the expected output to be Hello world and Invalid user input respectively, but the actual result turned out to be Hello-world and Invalid_user_input, however the type information was correct.

Expected Behavior

The actual output should matches the example comment and the type hint/info, which is Hello world and Invalid user input

Code to Reproduce

import { sentenceCase } from 'nano-string-utils';
console.clear();

const result = sentenceCase('hello-world');
const errorMsg = sentenceCase('INVALID_USER_INPUT' as const);

console.log(result);
console.log(errorMsg);

or stackblitz playground https://stackblitz.com/edit/wr6eseve?file=index.ts (open the console output just below the HTML Preview)

Environment

  • nano-string-utils version: 0.28.0
  • Runtime: Bun (version: 1.3.9), Browser Firefox (version: 147.0.3)
  • OS: Linux (Kernel 6.18.8, glibc 2.42), macOS (13.7.8 (22H730))

Additional Context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions