Skip to content
This repository was archived by the owner on Sep 18, 2022. It is now read-only.

Commit 3e74491

Browse files
committed
v1.0.0
1 parent 8b921bf commit 3e74491

5 files changed

Lines changed: 28 additions & 26 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# x-trim Changelog
1+
# s-trimmer Changelog
22

33
## 1.0.0 (2020-06-19)
44

55
#### New Feature
66

7-
- added `xTrim` function
7+
- added `sTrimmer` function

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# x-trim
1+
# s-trimmer
22

3-
[![NPM version](http://img.shields.io/npm/v/x-trim.svg?style=flat-square)](https://www.npmjs.com/package/x-trim)
4-
[![NPM downloads](http://img.shields.io/npm/dm/x-trim.svg?style=flat-square)](https://www.npmjs.com/package/x-trim)
3+
[![NPM version](http://img.shields.io/npm/v/s-trimmer.svg?style=flat-square)](https://www.npmjs.com/package/s-trimmer)
4+
[![NPM downloads](http://img.shields.io/npm/dm/s-trimmer.svg?style=flat-square)](https://www.npmjs.com/package/s-trimmer)
55

66
## About
77

@@ -12,35 +12,35 @@ Format spaces from the left and right end of a string and between strings
1212
First, install the library in your project by npm:
1313

1414
```sh
15-
$ npm install x-trim
15+
$ npm install s-trimmer
1616
```
1717

1818
Or Yarn:
1919

2020
```sh
21-
$ yarn add x-trim
21+
$ yarn add s-trimmer
2222
```
2323

2424
## Getting Started
2525

2626
**Connect libary to project using ES6 import:**
2727

2828
```js
29-
import xTrim from 'x-trim';
29+
import sTrimmer from 's-trimmer';
3030
```
3131

3232
**Or CommonJS:**
3333

3434
```js
35-
const xTrim = require('x-trim');
35+
const sTrimmer = require('s-trimmer');
3636
```
3737

3838
Next use library:
3939

4040
```js
4141
const value = 'lorem ipsum dolor ';
4242

43-
const formattedValue = xTrim(value); // 'lorem ipsum dolor'
43+
const formattedValue = sTrimmer(value); // 'lorem ipsum dolor'
4444
```
4545

4646
### Params

package.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"name": "x-trim",
2+
"name": "s-trimmer",
33
"version": "1.0.0",
4-
"description": "Format spaces between class names",
4+
"description": "Format spaces from the left and right end of a string and between strings",
55
"author": "Jakub Biesiada",
66
"license": "MIT",
7-
"main": "lib/x-trim.cjs.js",
8-
"module": "lib/x-trim.esm.js",
7+
"main": "lib/s-trimmer.cjs.js",
8+
"module": "lib/s-trimmer.esm.js",
99
"types": "lib/index.d.ts",
1010
"scripts": {
1111
"release": "rimraf lib/* && npm run prettier && npm run lint && npm run build",
@@ -18,19 +18,21 @@
1818
},
1919
"repository": {
2020
"type": "git",
21-
"url": "https://github.com/JB1905/x-trim.git"
21+
"url": "https://github.com/JB1905/s-trimmer.git"
2222
},
2323
"keywords": [
24-
"format",
2524
"string",
26-
"className",
25+
"trim",
2726
"spaces",
28-
"trim"
27+
"start",
28+
"end",
29+
"between",
30+
"format"
2931
],
3032
"bugs": {
31-
"url": "https://github.com/JB1905/x-trim/issues"
33+
"url": "https://github.com/JB1905/s-trimmer/issues"
3234
},
33-
"homepage": "https://github.com/JB1905/x-trim#readme",
35+
"homepage": "https://github.com/JB1905/s-trimmer#readme",
3436
"devDependencies": {
3537
"@rollup/plugin-node-resolve": "^8.0.1",
3638
"@types/jest": "^26.0.0",

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const xTrim = (value: string) => {
1+
const sTrimmer = (value: string) => {
22
return value.trim().split(/\s+/).join(' ');
33
};
44

5-
export default xTrim;
5+
export default sTrimmer;

test/index.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import xTrim from '../src';
1+
import sTrimmer from '../src';
22

3-
describe('xTrim', () => {
4-
it('should format spaces', () => {
3+
describe('sTrimmer', () => {
4+
it('should remove unneeded spaces', () => {
55
const input = 'lorem ipsum dolor ';
66

7-
const value = xTrim(input);
7+
const value = sTrimmer(input);
88

99
expect(value).toBe('lorem ipsum dolor');
1010
});

0 commit comments

Comments
 (0)