string-trim-spaces-only 2.8.20 → 2.8.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +46 -7
- package/dist/string-trim-spaces-only.cjs.js +1 -1
- package/dist/string-trim-spaces-only.dev.umd.js +1 -1
- package/dist/string-trim-spaces-only.esm.js +1 -1
- package/dist/string-trim-spaces-only.umd.js +1 -1
- package/examples/_quickTake.js +22 -0
- package/examples/api.json +1 -0
- package/package.json +35 -35
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2010-2020 Roy Revelt and other contributors
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
6
|
a copy of this software and associated documentation files (the
|
package/README.md
CHANGED
|
@@ -2,7 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
> Like String.trim() but you can choose granularly what to trim
|
|
4
4
|
|
|
5
|
-
<
|
|
5
|
+
<div class="package-badges">
|
|
6
|
+
<a href="https://www.npmjs.com/package/string-trim-spaces-only" rel="nofollow noreferrer noopener">
|
|
7
|
+
<img src="https://img.shields.io/badge/-npm-blue?style=flat-square" alt="page on npm">
|
|
8
|
+
</a>
|
|
9
|
+
<a href="https://codsen.com/os/string-trim-spaces-only" rel="nofollow noreferrer noopener">
|
|
10
|
+
<img src="https://img.shields.io/badge/-Codsen-blue?style=flat-square" alt="page on npm">
|
|
11
|
+
</a>
|
|
12
|
+
<a href="https://gitlab.com/codsen/codsen/tree/master/packages/string-trim-spaces-only" rel="nofollow noreferrer noopener">
|
|
13
|
+
<img src="https://img.shields.io/badge/-GitLab-blue?style=flat-square" alt="page on GitLab">
|
|
14
|
+
</a>
|
|
15
|
+
<a href="https://npmcharts.com/compare/string-trim-spaces-only?interval=30" rel="nofollow noreferrer noopener" target="_blank">
|
|
16
|
+
<img src="https://img.shields.io/npm/dm/string-trim-spaces-only.svg?style=flat-square" alt="Downloads per month">
|
|
17
|
+
</a>
|
|
18
|
+
<a href="https://prettier.io" rel="nofollow noreferrer noopener" target="_blank">
|
|
19
|
+
<img src="https://img.shields.io/badge/code_style-prettier-brightgreen.svg?style=flat-square" alt="Code style: prettier">
|
|
20
|
+
</a>
|
|
21
|
+
<img src="https://img.shields.io/badge/licence-MIT-brightgreen.svg?style=flat-square" alt="MIT License">
|
|
22
|
+
<a href="https://liberamanifesto.com" rel="nofollow noreferrer noopener" target="_blank">
|
|
23
|
+
<img src="https://img.shields.io/badge/libera-manifesto-lightgrey.svg?style=flat-square" alt="libera manifesto">
|
|
24
|
+
</a>
|
|
25
|
+
</div>
|
|
6
26
|
|
|
7
27
|
## Install
|
|
8
28
|
|
|
@@ -10,18 +30,37 @@
|
|
|
10
30
|
npm i string-trim-spaces-only
|
|
11
31
|
```
|
|
12
32
|
|
|
13
|
-
|
|
33
|
+
## Quick Take
|
|
14
34
|
|
|
15
|
-
|
|
35
|
+
```js
|
|
36
|
+
import { strict as assert } from "assert";
|
|
37
|
+
import trimSpaces from "string-trim-spaces-only";
|
|
38
|
+
|
|
39
|
+
assert.deepEqual(trimSpaces(" aaa "), {
|
|
40
|
+
res: "aaa",
|
|
41
|
+
ranges: [
|
|
42
|
+
[0, 2],
|
|
43
|
+
[5, 8],
|
|
44
|
+
],
|
|
45
|
+
});
|
|
16
46
|
|
|
17
|
-
|
|
47
|
+
assert.deepEqual(trimSpaces(" \t zz \n "), {
|
|
48
|
+
res: "\t zz \n",
|
|
49
|
+
ranges: [
|
|
50
|
+
[0, 3],
|
|
51
|
+
[12, 16],
|
|
52
|
+
],
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Documentation
|
|
18
57
|
|
|
19
|
-
|
|
58
|
+
Please [visit codsen.com](https://codsen.com/os/string-trim-spaces-only/) for a full description of the API and examples.
|
|
20
59
|
|
|
21
60
|
## Licence
|
|
22
61
|
|
|
23
62
|
MIT License
|
|
24
63
|
|
|
25
|
-
Copyright (c)
|
|
64
|
+
Copyright (c) 2010-2020 Roy Revelt and other contributors
|
|
26
65
|
|
|
27
|
-
<img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center">
|
|
66
|
+
<img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center">
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* eslint import/extensions:0 */
|
|
2
|
+
|
|
3
|
+
// Quick Take
|
|
4
|
+
|
|
5
|
+
import { strict as assert } from "assert";
|
|
6
|
+
import trimSpaces from "../dist/string-trim-spaces-only.esm.js";
|
|
7
|
+
|
|
8
|
+
assert.deepEqual(trimSpaces(" aaa "), {
|
|
9
|
+
res: "aaa",
|
|
10
|
+
ranges: [
|
|
11
|
+
[0, 2],
|
|
12
|
+
[5, 8],
|
|
13
|
+
],
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
assert.deepEqual(trimSpaces(" \t zz \n "), {
|
|
17
|
+
res: "\t zz \n",
|
|
18
|
+
ranges: [
|
|
19
|
+
[0, 3],
|
|
20
|
+
[12, 16],
|
|
21
|
+
],
|
|
22
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"_quickTake.js":{"title":"Quick Take","content":"import { strict as assert } from \"assert\";\nimport trimSpaces from \"string-trim-spaces-only\";\n\nassert.deepEqual(trimSpaces(\" aaa \"), {\n res: \"aaa\",\n ranges: [\n [0, 2],\n [5, 8],\n ],\n});\n\nassert.deepEqual(trimSpaces(\" \\t zz \\n \"), {\n res: \"\\t zz \\n\",\n ranges: [\n [0, 3],\n [12, 16],\n ],\n});"}}
|
package/package.json
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "string-trim-spaces-only",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.24",
|
|
4
4
|
"description": "Like String.trim() but you can choose granularly what to trim",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": "https://gitlab.com/codsen/codsen/",
|
|
7
|
-
"homepage": "https://codsen.com/os/string-trim-spaces-only/",
|
|
8
|
-
"author": {
|
|
9
|
-
"email": "roy@codsen.com",
|
|
10
|
-
"name": "Roy Revelt",
|
|
11
|
-
"url": "codsen.com"
|
|
12
|
-
},
|
|
13
5
|
"keywords": [
|
|
14
6
|
"characters",
|
|
15
7
|
"end",
|
|
@@ -22,6 +14,14 @@
|
|
|
22
14
|
"text",
|
|
23
15
|
"trim"
|
|
24
16
|
],
|
|
17
|
+
"homepage": "https://codsen.com/os/string-trim-spaces-only/",
|
|
18
|
+
"repository": "https://gitlab.com/codsen/codsen/",
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"author": {
|
|
21
|
+
"name": "Roy Revelt",
|
|
22
|
+
"email": "roy@codsen.com",
|
|
23
|
+
"url": "https://codsen.com"
|
|
24
|
+
},
|
|
25
25
|
"main": "dist/string-trim-spaces-only.cjs.js",
|
|
26
26
|
"module": "dist/string-trim-spaces-only.esm.js",
|
|
27
27
|
"browser": "dist/string-trim-spaces-only.umd.js",
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
"republish": "npm publish || :",
|
|
41
41
|
"tap": "tap",
|
|
42
42
|
"pretest": "npm run build",
|
|
43
|
-
"test": "npm run lint && npm run unittest && npm run clean_cov && npm run format",
|
|
43
|
+
"test": "npm run lint && npm run unittest && npm run test:examples && npm run clean_cov && npm run format",
|
|
44
|
+
"test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier",
|
|
44
45
|
"tsd": "tsd",
|
|
45
46
|
"unittest": "./node_modules/.bin/tap --no-only --output-file=testStats.md && npm run clean_cov && npm run perf",
|
|
46
47
|
"version": "npm run build && git add ."
|
|
@@ -50,6 +51,17 @@
|
|
|
50
51
|
"pre-commit": "npm run format && npm test"
|
|
51
52
|
}
|
|
52
53
|
},
|
|
54
|
+
"tap": {
|
|
55
|
+
"coverage-report": [
|
|
56
|
+
"json-summary",
|
|
57
|
+
"text"
|
|
58
|
+
],
|
|
59
|
+
"nyc-arg": [
|
|
60
|
+
"--exclude=**/*.cjs.js",
|
|
61
|
+
"--exclude=**/*.umd.js"
|
|
62
|
+
],
|
|
63
|
+
"timeout": 0
|
|
64
|
+
},
|
|
53
65
|
"lect": {
|
|
54
66
|
"defaultExported": true,
|
|
55
67
|
"files": {
|
|
@@ -79,40 +91,28 @@
|
|
|
79
91
|
"goodFolders": []
|
|
80
92
|
},
|
|
81
93
|
"req": "trimSpaces",
|
|
82
|
-
"typeSriptDefinitions": false,
|
|
83
94
|
"various": {
|
|
84
95
|
"devDependencies": []
|
|
85
96
|
}
|
|
86
97
|
},
|
|
87
|
-
"tap": {
|
|
88
|
-
"coverage-report": [
|
|
89
|
-
"json-summary",
|
|
90
|
-
"text"
|
|
91
|
-
],
|
|
92
|
-
"nyc-arg": [
|
|
93
|
-
"--exclude=**/*.cjs.js",
|
|
94
|
-
"--exclude=**/*.umd.js"
|
|
95
|
-
],
|
|
96
|
-
"timeout": 0
|
|
97
|
-
},
|
|
98
98
|
"devDependencies": {
|
|
99
|
-
"@babel/core": "^7.
|
|
100
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
101
|
-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.
|
|
102
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.
|
|
103
|
-
"@babel/plugin-proposal-optional-chaining": "^7.
|
|
104
|
-
"@babel/preset-env": "^7.
|
|
105
|
-
"@rollup/plugin-babel": "^5.2.
|
|
106
|
-
"@rollup/plugin-commonjs": "^
|
|
107
|
-
"@rollup/plugin-node-resolve": "^
|
|
99
|
+
"@babel/core": "^7.12.3",
|
|
100
|
+
"@babel/plugin-proposal-class-properties": "^7.12.1",
|
|
101
|
+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1",
|
|
102
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.12.1",
|
|
103
|
+
"@babel/plugin-proposal-optional-chaining": "^7.12.1",
|
|
104
|
+
"@babel/preset-env": "^7.12.1",
|
|
105
|
+
"@rollup/plugin-babel": "^5.2.1",
|
|
106
|
+
"@rollup/plugin-commonjs": "^16.0.0",
|
|
107
|
+
"@rollup/plugin-node-resolve": "^10.0.0",
|
|
108
108
|
"@rollup/plugin-strip": "^2.0.0",
|
|
109
109
|
"benchmark": "^2.1.4",
|
|
110
|
-
"eslint": "^7.
|
|
111
|
-
"lect": "^0.
|
|
112
|
-
"rollup": "^2.
|
|
110
|
+
"eslint": "^7.13.0",
|
|
111
|
+
"lect": "^0.14.8",
|
|
112
|
+
"rollup": "^2.33.1",
|
|
113
113
|
"rollup-plugin-ascii": "^0.0.3",
|
|
114
114
|
"rollup-plugin-banner": "^0.2.1",
|
|
115
|
-
"rollup-plugin-cleanup": "^3.
|
|
115
|
+
"rollup-plugin-cleanup": "^3.2.1",
|
|
116
116
|
"rollup-plugin-terser": "^7.0.2",
|
|
117
117
|
"tap": "^14.10.8",
|
|
118
118
|
"tsd": "^0.13.1"
|