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
Function Affected
sentenceCaseCurrent Behavior
Given input of
hello-worldfrom the example here and from the source:nano-string-utils/src/sentenceCase.ts
Line 28 in b410cfb
and
INVALID_USER_INPUTfrom the source:nano-string-utils/src/sentenceCase.ts
Line 40 in b410cfb
the comment giving the expected output to be
Hello worldandInvalid user inputrespectively, but the actual result turned out to beHello-worldandInvalid_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 worldandInvalid user inputCode to Reproduce
or stackblitz playground https://stackblitz.com/edit/wr6eseve?file=index.ts (open the console output just below the HTML Preview)
Environment
Additional Context
N/A