string-process-comma-separated 3.0.7 → 3.0.10
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/README.md
CHANGED
|
@@ -38,6 +38,7 @@ If you need a legacy version which works with `require`, use version 2.1.0
|
|
|
38
38
|
|
|
39
39
|
```js
|
|
40
40
|
import { strict as assert } from "assert";
|
|
41
|
+
|
|
41
42
|
import { processCommaSep } from "string-process-comma-separated";
|
|
42
43
|
|
|
43
44
|
const gatheredChunks = [];
|
|
@@ -78,7 +79,7 @@ assert.deepEqual(gatheredErrors, [
|
|
|
78
79
|
|
|
79
80
|
## Documentation
|
|
80
81
|
|
|
81
|
-
Please [visit codsen.com](https://codsen.com/os/string-process-comma-separated/) for a full description of the API
|
|
82
|
+
Please [visit codsen.com](https://codsen.com/os/string-process-comma-separated/) for a full description of the API.
|
|
82
83
|
|
|
83
84
|
## Contributing
|
|
84
85
|
|
|
@@ -90,4 +91,6 @@ MIT License
|
|
|
90
91
|
|
|
91
92
|
Copyright (c) 2010-2021 Roy Revelt and other contributors
|
|
92
93
|
|
|
94
|
+
|
|
93
95
|
<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">
|
|
96
|
+
|
|
@@ -1,173 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name string-process-comma-separated
|
|
3
3
|
* @fileoverview Extracts chunks from possibly comma or whatever-separated string
|
|
4
|
-
* @version 3.0.
|
|
4
|
+
* @version 3.0.10
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/string-process-comma-separated/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
const version = version$1;
|
|
13
|
-
function processCommaSep(str, originalOpts) {
|
|
14
|
-
if (typeof str !== "string") {
|
|
15
|
-
throw new Error(`string-process-comma-separated: [THROW_ID_01] input must be string! It was given as ${typeof str}, equal to:\n${JSON.stringify(str, null, 4)}`);
|
|
16
|
-
}
|
|
17
|
-
else if (!str.length ||
|
|
18
|
-
!originalOpts ||
|
|
19
|
-
(!originalOpts.cb && !originalOpts.errCb)) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
const defaults = {
|
|
23
|
-
from: 0,
|
|
24
|
-
to: str.length,
|
|
25
|
-
offset: 0,
|
|
26
|
-
leadingWhitespaceOK: false,
|
|
27
|
-
trailingWhitespaceOK: false,
|
|
28
|
-
oneSpaceAfterCommaOK: false,
|
|
29
|
-
innerWhitespaceAllowed: false,
|
|
30
|
-
separator: ",",
|
|
31
|
-
cb: null,
|
|
32
|
-
errCb: null,
|
|
33
|
-
};
|
|
34
|
-
const opts = { ...defaults, ...originalOpts };
|
|
35
|
-
if (!Number.isInteger(originalOpts.from)) {
|
|
36
|
-
opts.from = 0;
|
|
37
|
-
}
|
|
38
|
-
if (!Number.isInteger(originalOpts.to)) {
|
|
39
|
-
opts.to = str.length;
|
|
40
|
-
}
|
|
41
|
-
if (!Number.isInteger(originalOpts.offset)) {
|
|
42
|
-
opts.offset = 0;
|
|
43
|
-
}
|
|
44
|
-
let chunkStartsAt = null;
|
|
45
|
-
let whitespaceStartsAt = null;
|
|
46
|
-
let firstNonwhitespaceNonseparatorCharFound = false;
|
|
47
|
-
let separatorsArr = [];
|
|
48
|
-
let lastNonWhitespaceCharAt = null;
|
|
49
|
-
let fixable = true;
|
|
50
|
-
for (let i = opts.from; i < opts.to; i++) {
|
|
51
|
-
if (str[i].trim() && str[i] !== opts.separator) {
|
|
52
|
-
lastNonWhitespaceCharAt = i;
|
|
53
|
-
}
|
|
54
|
-
if (chunkStartsAt === null &&
|
|
55
|
-
str[i].trim() &&
|
|
56
|
-
(!opts.separator || str[i] !== opts.separator)) {
|
|
57
|
-
if (!firstNonwhitespaceNonseparatorCharFound) {
|
|
58
|
-
firstNonwhitespaceNonseparatorCharFound = true;
|
|
59
|
-
}
|
|
60
|
-
if (separatorsArr.length) {
|
|
61
|
-
if (separatorsArr.length > 1) {
|
|
62
|
-
separatorsArr.forEach((separatorsIdx, orderNumber) => {
|
|
63
|
-
if (orderNumber) {
|
|
64
|
-
opts.errCb([
|
|
65
|
-
[
|
|
66
|
-
separatorsIdx + opts.offset,
|
|
67
|
-
separatorsIdx + 1 + opts.offset,
|
|
68
|
-
],
|
|
69
|
-
], "Remove separator.", fixable);
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
separatorsArr = [];
|
|
74
|
-
}
|
|
75
|
-
chunkStartsAt = i;
|
|
76
|
-
}
|
|
77
|
-
if (Number.isInteger(chunkStartsAt) &&
|
|
78
|
-
((i > chunkStartsAt &&
|
|
79
|
-
opts.separator &&
|
|
80
|
-
str[i] === opts.separator) ||
|
|
81
|
-
i + 1 === opts.to)) {
|
|
82
|
-
str.slice(chunkStartsAt, i + 1 === opts.to && str[i] !== opts.separator && str[i].trim()
|
|
83
|
-
? i + 1
|
|
84
|
-
: i);
|
|
85
|
-
if (typeof opts.cb === "function") {
|
|
86
|
-
opts.cb(chunkStartsAt + opts.offset, (i + 1 === opts.to && str[i] !== opts.separator && str[i].trim()
|
|
87
|
-
? i + 1
|
|
88
|
-
: lastNonWhitespaceCharAt + 1) + opts.offset);
|
|
89
|
-
}
|
|
90
|
-
chunkStartsAt = null;
|
|
91
|
-
}
|
|
92
|
-
if (!str[i].trim() && whitespaceStartsAt === null) {
|
|
93
|
-
whitespaceStartsAt = i;
|
|
94
|
-
}
|
|
95
|
-
if (whitespaceStartsAt !== null && (str[i].trim() || i + 1 === opts.to)) {
|
|
96
|
-
if (whitespaceStartsAt === opts.from) {
|
|
97
|
-
if (!opts.leadingWhitespaceOK && typeof opts.errCb === "function") {
|
|
98
|
-
opts.errCb([
|
|
99
|
-
[
|
|
100
|
-
whitespaceStartsAt + opts.offset,
|
|
101
|
-
(i + 1 === opts.to ? i + 1 : i) + opts.offset,
|
|
102
|
-
],
|
|
103
|
-
], "Remove whitespace.", fixable);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
else if (!str[i].trim() && i + 1 === opts.to) {
|
|
107
|
-
if (!opts.trailingWhitespaceOK && typeof opts.errCb === "function") {
|
|
108
|
-
opts.errCb([[whitespaceStartsAt + opts.offset, i + 1 + opts.offset]], "Remove whitespace.", fixable);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
else if ((!opts.oneSpaceAfterCommaOK ||
|
|
112
|
-
!(str[i].trim() &&
|
|
113
|
-
i > opts.from + 1 &&
|
|
114
|
-
str[i - 1] === " " &&
|
|
115
|
-
str[i - 2] === ",")) &&
|
|
116
|
-
(!opts.innerWhitespaceAllowed ||
|
|
117
|
-
!(firstNonwhitespaceNonseparatorCharFound &&
|
|
118
|
-
str[whitespaceStartsAt - 1] &&
|
|
119
|
-
str[i].trim() &&
|
|
120
|
-
str[i] !== opts.separator &&
|
|
121
|
-
str[whitespaceStartsAt - 1] !== opts.separator))) {
|
|
122
|
-
let startingIdx = whitespaceStartsAt;
|
|
123
|
-
let endingIdx = i;
|
|
124
|
-
if (i + 1 === opts.to && str[i] !== opts.separator && !str[i].trim()) {
|
|
125
|
-
endingIdx += 1;
|
|
126
|
-
}
|
|
127
|
-
let whatToAdd = "";
|
|
128
|
-
if (opts.oneSpaceAfterCommaOK) {
|
|
129
|
-
if (str[whitespaceStartsAt] === " " &&
|
|
130
|
-
str[whitespaceStartsAt - 1] === opts.separator) {
|
|
131
|
-
startingIdx += 1;
|
|
132
|
-
}
|
|
133
|
-
else if (str[whitespaceStartsAt] !== " ") {
|
|
134
|
-
whatToAdd = " ";
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
let message = "Remove whitespace.";
|
|
138
|
-
if (!opts.innerWhitespaceAllowed &&
|
|
139
|
-
firstNonwhitespaceNonseparatorCharFound &&
|
|
140
|
-
str[whitespaceStartsAt - 1] &&
|
|
141
|
-
str[i].trim() &&
|
|
142
|
-
str[i] !== opts.separator &&
|
|
143
|
-
str[whitespaceStartsAt - 1] !== opts.separator) {
|
|
144
|
-
fixable = false;
|
|
145
|
-
message = "Bad whitespace.";
|
|
146
|
-
}
|
|
147
|
-
if (whatToAdd.length) {
|
|
148
|
-
opts.errCb([[startingIdx + opts.offset, endingIdx + opts.offset, whatToAdd]], message, fixable);
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
opts.errCb([[startingIdx + opts.offset, endingIdx + opts.offset]], message, fixable);
|
|
152
|
-
}
|
|
153
|
-
fixable = true;
|
|
154
|
-
}
|
|
155
|
-
whitespaceStartsAt = null;
|
|
156
|
-
}
|
|
157
|
-
if (str[i] === opts.separator) {
|
|
158
|
-
if (!firstNonwhitespaceNonseparatorCharFound) {
|
|
159
|
-
opts.errCb([[i + opts.offset, i + 1 + opts.offset]], "Remove separator.", fixable);
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
separatorsArr.push(i);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
if (i + 1 === opts.to) {
|
|
166
|
-
separatorsArr.forEach((separatorsIdx) => {
|
|
167
|
-
opts.errCb([[separatorsIdx + opts.offset, separatorsIdx + 1 + opts.offset]], "Remove separator.", fixable);
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export { processCommaSep, version };
|
|
10
|
+
var $="3.0.10";var E=$;function y(o,n){if(typeof o!="string")throw new Error(`string-process-comma-separated: [THROW_ID_01] input must be string! It was given as ${typeof o}, equal to:
|
|
11
|
+
${JSON.stringify(o,null,4)}`);if(!o.length||!n||!n.cb&&!n.errCb)return;let e={...{from:0,to:o.length,offset:0,leadingWhitespaceOK:!1,trailingWhitespaceOK:!1,oneSpaceAfterCommaOK:!1,innerWhitespaceAllowed:!1,separator:",",cb:null,errCb:null},...n};Number.isInteger(n.from)||(e.from=0),Number.isInteger(n.to)||(e.to=o.length),Number.isInteger(n.offset)||(e.offset=0);let l=null,s=null,u=!1,i=[],f=null,a=!0;for(let t=e.from;t<e.to;t++){if(o[t].trim()&&o[t]!==e.separator&&(f=t),l===null&&o[t].trim()&&(!e.separator||o[t]!==e.separator)&&(u||(u=!0),i.length&&(i.length>1&&i.forEach((r,m)=>{m&&e.errCb([[r+e.offset,r+1+e.offset]],"Remove separator.",a)}),i=[]),l=t),Number.isInteger(l)&&(t>l&&e.separator&&o[t]===e.separator||t+1===e.to)){let r=o.slice(l,t+1===e.to&&o[t]!==e.separator&&o[t].trim()?t+1:t);typeof e.cb=="function"&&e.cb(l+e.offset,(t+1===e.to&&o[t]!==e.separator&&o[t].trim()?t+1:f+1)+e.offset),l=null}if(!o[t].trim()&&s===null&&(s=t),s!==null&&(o[t].trim()||t+1===e.to)){if(s===e.from)!e.leadingWhitespaceOK&&typeof e.errCb=="function"&&e.errCb([[s+e.offset,(t+1===e.to?t+1:t)+e.offset]],"Remove whitespace.",a);else if(!o[t].trim()&&t+1===e.to)!e.trailingWhitespaceOK&&typeof e.errCb=="function"&&e.errCb([[s+e.offset,t+1+e.offset]],"Remove whitespace.",a);else if((!e.oneSpaceAfterCommaOK||!(o[t].trim()&&t>e.from+1&&o[t-1]===" "&&o[t-2]===","))&&(!e.innerWhitespaceAllowed||!(u&&o[s-1]&&o[t].trim()&&o[t]!==e.separator&&o[s-1]!==e.separator))){let r=s,m=t;t+1===e.to&&o[t]!==e.separator&&!o[t].trim()&&(m+=1);let c="";e.oneSpaceAfterCommaOK&&(o[s]===" "&&o[s-1]===e.separator?r+=1:o[s]!==" "&&(c=" "));let p="Remove whitespace.";!e.innerWhitespaceAllowed&&u&&o[s-1]&&o[t].trim()&&o[t]!==e.separator&&o[s-1]!==e.separator&&(a=!1,p="Bad whitespace."),c.length?e.errCb([[r+e.offset,m+e.offset,c]],p,a):e.errCb([[r+e.offset,m+e.offset]],p,a),a=!0}s=null}o[t]===e.separator&&(u?i.push(t):e.errCb([[t+e.offset,t+1+e.offset]],"Remove separator.",a)),t+1===e.to&&i.forEach(r=>{e.errCb([[r+e.offset,r+1+e.offset]],"Remove separator.",a)})}}export{y as processCommaSep,E as version};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name string-process-comma-separated
|
|
3
3
|
* @fileoverview Extracts chunks from possibly comma or whatever-separated string
|
|
4
|
-
* @version 3.0.
|
|
4
|
+
* @version 3.0.10
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/string-process-comma-separated/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
var stringProcessCommaSeparated=(()=>{var p=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols;var d=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var E=(t,s,r)=>s in t?p(t,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[s]=r,b=(t,s)=>{for(var r in s||(s={}))d.call(s,r)&&E(t,r,s[r]);if(h)for(var r of h(s))C.call(s,r)&&E(t,r,s[r]);return t};var A=t=>p(t,"__esModule",{value:!0});var D=(t,s)=>{for(var r in s)p(t,r,{get:s[r],enumerable:!0})},O=(t,s,r,e)=>{if(s&&typeof s=="object"||typeof s=="function")for(let a of N(s))!d.call(t,a)&&(r||a!=="default")&&p(t,a,{get:()=>s[a],enumerable:!(e=S(s,a))||e.enumerable});return t};var w=(t=>(s,r)=>t&&t.get(s)||(r=O(A({}),s,1),t&&t.set(s,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var x={};D(x,{processCommaSep:()=>v,version:()=>I});var y="3.0.10";var I=y;function v(t,s){if(typeof t!="string")throw new Error(`string-process-comma-separated: [THROW_ID_01] input must be string! It was given as ${typeof t}, equal to:
|
|
11
|
+
${JSON.stringify(t,null,4)}`);if(!t.length||!s||!s.cb&&!s.errCb)return;let r={from:0,to:t.length,offset:0,leadingWhitespaceOK:!1,trailingWhitespaceOK:!1,oneSpaceAfterCommaOK:!1,innerWhitespaceAllowed:!1,separator:",",cb:null,errCb:null},e=b(b({},r),s);Number.isInteger(s.from)||(e.from=0),Number.isInteger(s.to)||(e.to=t.length),Number.isInteger(s.offset)||(e.offset=0);let a=null,n=null,m=!1,u=[],g=null,i=!0;for(let o=e.from;o<e.to;o++){if(t[o].trim()&&t[o]!==e.separator&&(g=o),a===null&&t[o].trim()&&(!e.separator||t[o]!==e.separator)&&(m||(m=!0),u.length&&(u.length>1&&u.forEach((l,c)=>{c&&e.errCb([[l+e.offset,l+1+e.offset]],"Remove separator.",i)}),u=[]),a=o),Number.isInteger(a)&&(o>a&&e.separator&&t[o]===e.separator||o+1===e.to)){let l=t.slice(a,o+1===e.to&&t[o]!==e.separator&&t[o].trim()?o+1:o);typeof e.cb=="function"&&e.cb(a+e.offset,(o+1===e.to&&t[o]!==e.separator&&t[o].trim()?o+1:g+1)+e.offset),a=null}if(!t[o].trim()&&n===null&&(n=o),n!==null&&(t[o].trim()||o+1===e.to)){if(n===e.from)!e.leadingWhitespaceOK&&typeof e.errCb=="function"&&e.errCb([[n+e.offset,(o+1===e.to?o+1:o)+e.offset]],"Remove whitespace.",i);else if(!t[o].trim()&&o+1===e.to)!e.trailingWhitespaceOK&&typeof e.errCb=="function"&&e.errCb([[n+e.offset,o+1+e.offset]],"Remove whitespace.",i);else if((!e.oneSpaceAfterCommaOK||!(t[o].trim()&&o>e.from+1&&t[o-1]===" "&&t[o-2]===","))&&(!e.innerWhitespaceAllowed||!(m&&t[n-1]&&t[o].trim()&&t[o]!==e.separator&&t[n-1]!==e.separator))){let l=n,c=o;o+1===e.to&&t[o]!==e.separator&&!t[o].trim()&&(c+=1);let f="";e.oneSpaceAfterCommaOK&&(t[n]===" "&&t[n-1]===e.separator?l+=1:t[n]!==" "&&(f=" "));let $="Remove whitespace.";!e.innerWhitespaceAllowed&&m&&t[n-1]&&t[o].trim()&&t[o]!==e.separator&&t[n-1]!==e.separator&&(i=!1,$="Bad whitespace."),f.length?e.errCb([[l+e.offset,c+e.offset,f]],$,i):e.errCb([[l+e.offset,c+e.offset]],$,i),i=!0}n=null}t[o]===e.separator&&(m?u.push(o):e.errCb([[o+e.offset,o+1+e.offset]],"Remove separator.",i)),o+1===e.to&&u.forEach(l=>{e.errCb([[l+e.offset,l+1+e.offset]],"Remove separator.",i)})}}return w(x);})();
|
package/examples/_quickTake.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "string-process-comma-separated",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.10",
|
|
4
4
|
"description": "Extracts chunks from possibly comma or whatever-separated string",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"characters",
|
|
@@ -33,89 +33,34 @@
|
|
|
33
33
|
},
|
|
34
34
|
"types": "types/index.d.ts",
|
|
35
35
|
"scripts": {
|
|
36
|
-
"build": "
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"republish": "npm publish || :",
|
|
49
|
-
"tap": "tap",
|
|
50
|
-
"pretest": "npm run build",
|
|
51
|
-
"test": "npm run test:ci && npm run perf",
|
|
52
|
-
"test:ci": "npm run unittest && npm run test:examples && npm run format",
|
|
53
|
-
"test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier",
|
|
54
|
-
"tsc": "tsc",
|
|
55
|
-
"unittest": "tap --no-only --reporter=terse && tsc -p tsconfig.json --noEmit"
|
|
36
|
+
"build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
|
|
37
|
+
"dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
|
|
38
|
+
"dts": "rollup -c",
|
|
39
|
+
"examples": "node '../../ops/scripts/run-examples.js'",
|
|
40
|
+
"lect": "node '../../ops/lect/lect.js'",
|
|
41
|
+
"letspublish": "yarn publish || :",
|
|
42
|
+
"lint": "eslint . --fix",
|
|
43
|
+
"perf": "node perf/check.js",
|
|
44
|
+
"prepare": "echo 'ready'",
|
|
45
|
+
"pretest": "yarn run lect && yarn run build",
|
|
46
|
+
"test": "c8 yarn run unit && yarn run examples && yarn run lint",
|
|
47
|
+
"unit": "uvu test"
|
|
56
48
|
},
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
51
|
+
},
|
|
52
|
+
"c8": {
|
|
53
|
+
"check-coverage": true,
|
|
54
|
+
"exclude": [
|
|
55
|
+
"**/test/**/*.*"
|
|
63
56
|
],
|
|
64
|
-
"
|
|
57
|
+
"lines": 100
|
|
65
58
|
},
|
|
66
59
|
"lect": {
|
|
67
60
|
"licence": {
|
|
68
61
|
"extras": [
|
|
69
62
|
""
|
|
70
63
|
]
|
|
71
|
-
},
|
|
72
|
-
"req": "{ processCommaSep }",
|
|
73
|
-
"various": {
|
|
74
|
-
"devDependencies": []
|
|
75
64
|
}
|
|
76
|
-
},
|
|
77
|
-
"dependencies": {
|
|
78
|
-
"@babel/runtime": "^7.16.3"
|
|
79
|
-
},
|
|
80
|
-
"devDependencies": {
|
|
81
|
-
"@babel/cli": "^7.16.0",
|
|
82
|
-
"@babel/core": "^7.16.0",
|
|
83
|
-
"@babel/node": "^7.16.0",
|
|
84
|
-
"@babel/plugin-external-helpers": "^7.16.0",
|
|
85
|
-
"@babel/plugin-proposal-class-properties": "^7.16.0",
|
|
86
|
-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
|
|
87
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.16.0",
|
|
88
|
-
"@babel/plugin-proposal-optional-chaining": "^7.16.0",
|
|
89
|
-
"@babel/plugin-transform-runtime": "^7.16.4",
|
|
90
|
-
"@babel/preset-env": "^7.16.4",
|
|
91
|
-
"@babel/preset-typescript": "^7.16.0",
|
|
92
|
-
"@babel/register": "^7.16.0",
|
|
93
|
-
"@istanbuljs/esm-loader-hook": "^0.1.2",
|
|
94
|
-
"@rollup/plugin-babel": "^5.3.0",
|
|
95
|
-
"@rollup/plugin-commonjs": "^21.0.1",
|
|
96
|
-
"@rollup/plugin-json": "^4.1.0",
|
|
97
|
-
"@rollup/plugin-node-resolve": "^13.0.6",
|
|
98
|
-
"@rollup/plugin-strip": "^2.1.0",
|
|
99
|
-
"@rollup/plugin-typescript": "^8.3.0",
|
|
100
|
-
"@types/node": "^16.11.10",
|
|
101
|
-
"@types/tap": "^15.0.5",
|
|
102
|
-
"@typescript-eslint/eslint-plugin": "^5.5.0",
|
|
103
|
-
"@typescript-eslint/parser": "^5.5.0",
|
|
104
|
-
"core-js": "^3.19.2",
|
|
105
|
-
"cross-env": "^7.0.3",
|
|
106
|
-
"eslint": "^8.3.0",
|
|
107
|
-
"lect": "^0.18.7",
|
|
108
|
-
"rollup": "^2.60.1",
|
|
109
|
-
"rollup-plugin-ascii": "^0.0.3",
|
|
110
|
-
"rollup-plugin-banner": "^0.2.1",
|
|
111
|
-
"rollup-plugin-cleanup": "^3.2.1",
|
|
112
|
-
"rollup-plugin-dts": "^4.0.1",
|
|
113
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
114
|
-
"tap": "^15.1.5",
|
|
115
|
-
"tslib": "^2.3.1",
|
|
116
|
-
"typescript": "^4.5.2"
|
|
117
|
-
},
|
|
118
|
-
"engines": {
|
|
119
|
-
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
120
65
|
}
|
|
121
66
|
}
|
package/types/index.d.ts
CHANGED
|
File without changes
|
package/examples/api.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"_quickTake.js":{"title":"Quick Take","content":"import { strict as assert } from \"assert\";\nimport { processCommaSep } from \"string-process-comma-separated\";\n\nconst gatheredChunks = [];\nconst gatheredErrors = [];\nconst rawnbsp = \"\\u00a0\";\n\n// it's a callback-interface:\nprocessCommaSep(`<FRAMESET rows=\" ,,\\t50% ,${rawnbsp} 50% ,\\t\\t,\">`, {\n from: 16, // <- beginning of the attribute's value\n to: 35, // <- ending of the attribute's value\n separator: \",\",\n cb: (idxFrom, idxTo) => {\n gatheredChunks.push([idxFrom, idxTo]);\n },\n errCb: (ranges, message) => {\n gatheredErrors.push({ ranges, message });\n },\n});\n\nassert.deepEqual(gatheredChunks, [\n [20, 23],\n [27, 30],\n]);\n\nassert.deepEqual(gatheredErrors, [\n { ranges: [[16, 17]], message: \"Remove whitespace.\" },\n { ranges: [[17, 18]], message: \"Remove separator.\" },\n { ranges: [[18, 19]], message: \"Remove separator.\" },\n { ranges: [[19, 20]], message: \"Remove whitespace.\" },\n { ranges: [[23, 24]], message: \"Remove whitespace.\" },\n { ranges: [[25, 27]], message: \"Remove whitespace.\" },\n { ranges: [[30, 31]], message: \"Remove whitespace.\" },\n { ranges: [[32, 34]], message: \"Remove whitespace.\" },\n { ranges: [[31, 32]], message: \"Remove separator.\" },\n { ranges: [[34, 35]], message: \"Remove separator.\" },\n]);"}}
|