Skip to content

Commit 11c16f4

Browse files
committed
Switched to exporting functions rather than a class for better tree-shakeability
1 parent 28b57f8 commit 11c16f4

File tree

6 files changed

+313
-321
lines changed

6 files changed

+313
-321
lines changed

README.md

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
1-
# StringUtil
2-
[![NPM version][npm-version-image]][npm-version-url]
3-
[![License-mit][license-mit-image]][license-mit-url]
4-
5-
[license-mit-url]: https://opensource.org/licenses/MIT
6-
7-
[license-mit-image]: https://img.shields.io/badge/License-MIT-yellow.svg
8-
9-
[npm-version-url]: https://www.npmjs.com/package/@wessberg/stringutil
10-
11-
[npm-version-image]: https://badge.fury.io/js/%40wessberg%2Fstringutil.svg
12-
> A class for performing simple operations on strings.
1+
# @wessberg/stringutil
132

143
## Installation
154
Simply do: `npm install @wessberg/stringutil`.
165

6+
## Description
7+
8+
A collection of helper functions for working with strings.
9+
1710
## Usage
1811
```typescript
19-
import {StringUtil} from "@wessberg/stringutil";
20-
const stringUtil = new StringUtil();
21-
stringUtil.camelCase("my-string"); // returns 'myString'
22-
stringUtil.camelCase("my string"); // returns 'myString'
23-
stringUtil.camelCase("MY_STRING"); // returns 'myString'
24-
stringUtil.camelCase("my-complex_string HAS a_SPACE"); // returns 'myComplexStringHasASpace'
25-
stringUtil.allIndexesOf(/_/g, "my string has underscores _here_"); // returns [26, 31]
12+
import {camelCase, allIndexesOf} from "@wessberg/stringutil";
13+
camelCase("my-string"); // returns 'myString'
14+
camelCase("my string"); // returns 'myString'
15+
camelCase("MY_STRING"); // returns 'myString'
16+
camelCase("my-complex_string HAS a_SPACE"); // returns 'myComplexStringHasASpace'
17+
allIndexesOf(/_/g, "my string has underscores _here_"); // returns [26, 31]
2618
```
2719

2820

package.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"name": "@wessberg/stringutil",
33
"version": "1.0.16",
4-
"description": "A class for performing simple operations on strings.",
4+
"description": "A collection of helper functions for working with strings",
55
"repository": {
66
"type": "git",
7-
"url": "https://github.com/wessberg/StringUtil.git"
7+
"url": "https://github.com/wessberg/stringutil.git"
88
},
99
"bugs": {
10-
"url": "https://github.com/wessberg/StringUtil/issues"
10+
"url": "https://github.com/wessberg/stringutil/issues"
1111
},
1212
"scripts": {
13-
"test": "NODE_ENV=TEST ava",
13+
"test": "NODE_ENV=TEST ava -v",
1414
"changelog:generate": "conventional-changelog --outfile CHANGELOG.md --release-count 0",
1515
"readme:badges": "node node_modules/@wessberg/ts-config/readme/badge/helper/add-badges.js",
1616
"readme:refresh": "npm run changelog:generate && npm run readme:badges",
@@ -39,7 +39,6 @@
3939
"keywords": [
4040
"util",
4141
"string",
42-
"operations",
4342
"kebabCase",
4443
"dash-case",
4544
"PascalCase",
@@ -52,15 +51,15 @@
5251
},
5352
"license": "MIT",
5453
"devDependencies": {
55-
"@wessberg/ts-config": "0.0.26",
54+
"@wessberg/ts-config": "0.0.27",
5655
"ava": "^0.25.0",
57-
"conventional-changelog-cli": "^1.3.21",
56+
"conventional-changelog-cli": "^2.0.1",
5857
"husky": "^0.14.3",
59-
"tslint": "^5.9.1",
60-
"typescript": "^2.8.1"
58+
"tslint": "^5.10.0",
59+
"typescript": "^2.9.2"
6160
},
6261
"dependencies": {
63-
"tslib": "^1.9.0"
62+
"tslib": "^1.9.2"
6463
},
6564
"main": "./dist/cjs/index.js",
6665
"module": "./dist/es2015/index.js",

src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
export {StringUtil} from "./string-util/string-util";
2-
export {IStringUtil} from "./string-util/i-string-util";
1+
export * from "./string-util/string-util";

src/string-util/i-string-util.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)