This repository was archived by the owner on Sep 18, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
1212First, install the library in your project by npm:
1313
1414``` sh
15- $ npm install x-trim
15+ $ npm install s-trimmer
1616```
1717
1818Or 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
3838Next use library:
3939
4040``` js
4141const 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
Original file line number Diff line number Diff line change 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" ,
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" ,
Original file line number Diff line number Diff line change 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 ;
Original file line number Diff line number Diff line change 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 } ) ;
You can’t perform that action at this time.
0 commit comments