Skip to content

Commit 877c766

Browse files
committed
feat: add toLowerCase utility function and update README
1 parent b552d3a commit 877c766

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# @kieranwv/utils
22

3-
[![Version](https://img.shields.io/github/v/release/kieranwv/utils?style=flat&label=released&color=%2309090b)](https://github.com/kieranwv/utils/releases)
4-
[![Version](https://img.shields.io/npm/v/@kieranwv/utils?style=flat&label=npm&color=09090b)](https://www.npmjs.com/package/@kieranwv/utils)
3+
[![GitHub Release Version](https://img.shields.io/github/v/release/kieranwv/utils?label=Release&color=%42b883)](https://github.com/kieranwv/utils/releases)
4+
[![NPM Version](https://img.shields.io/npm/v/starter-lib-vue3?style=flat&label=npm&color=%42b883)](https://www.npmjs.com/package/starter-lib-vue3)
5+
[![Build Status](https://github.com/kieranwv/utils/actions/workflows/ci.yml/badge.svg?branch=main&color=%42b883)](https://github.com/kieranwv/utils/actions/workflows/ci.yml)
56

67
Collection of common JavaScript / TypeScript utils by @kieranwv.
78

@@ -19,9 +20,10 @@ const db = new IndexedDB()
1920

2021
## Utils
2122

22-
| name | description |
23-
| -------------------------------- | -------------------------------------- |
23+
| name | description |
24+
| ---------------------------------- | ---------------------------------------- |
2425
| [`IndexedDB`](./src/indexed-db.ts) | The CRUD class for indexedDB in browser. |
26+
| [`toLowerCase`](./src/format.ts) | Converts string characters to lowercase. |
2527

2628
## License
2729

src/format.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function toLowerCase(input: string): string {
2+
return input.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase().replace(/\s+/g, '-')
3+
}

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
export * from './format'
12
export * from './indexed-db'

0 commit comments

Comments
 (0)