string-process-comma-separated 3.0.4 → 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/CHANGELOG.md CHANGED
@@ -3,26 +3,6 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## 3.0.3 (2021-11-02)
7
-
8
- ### Bug Fixes
9
-
10
- - bump TS and separate ESLint plugins away from this monorepo ([b1ebce1](https://github.com/codsen/codsen/commit/b1ebce1637d8c41c2d848fc24b0ba4058865bd5d))
11
-
12
- ### Features
13
-
14
- - migrate to ES Modules ([c579dff](https://github.com/codsen/codsen/commit/c579dff3b23205e383035ca10ddcec671e35d0fe))
15
-
16
- ### BREAKING CHANGES
17
-
18
- - programs now are in ES Modules and won't work with Common JS require()
19
-
20
- ## 3.0.1 (2021-09-13)
21
-
22
- ### Bug Fixes
23
-
24
- - bump TS and separate ESLint plugins away from this monorepo ([2e07d42](https://github.com/codsen/codsen/commit/2e07d424222b6ffedf5fb45c83ad453627ec2904))
25
-
26
6
  ## 3.0.0 (2021-09-09)
27
7
 
28
8
  ### Features
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2010-%YEAR% Roy Revelt and other contributors
3
+ Copyright (c) 2010-2021 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
@@ -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 and examples.
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,131 +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
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 version$1 = "3.0.4";
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
- } else if (!str.length || !originalOpts || !originalOpts.cb && !originalOpts.errCb) {
17
- return;
18
- }
19
- const defaults = {
20
- from: 0,
21
- to: str.length,
22
- offset: 0,
23
- leadingWhitespaceOK: false,
24
- trailingWhitespaceOK: false,
25
- oneSpaceAfterCommaOK: false,
26
- innerWhitespaceAllowed: false,
27
- separator: ",",
28
- cb: null,
29
- errCb: null
30
- };
31
- const opts = { ...defaults,
32
- ...originalOpts
33
- };
34
- if (!Number.isInteger(originalOpts.from)) {
35
- opts.from = 0;
36
- }
37
- if (!Number.isInteger(originalOpts.to)) {
38
- opts.to = str.length;
39
- }
40
- if (!Number.isInteger(originalOpts.offset)) {
41
- opts.offset = 0;
42
- }
43
- let chunkStartsAt = null;
44
- let whitespaceStartsAt = null;
45
- let firstNonwhitespaceNonseparatorCharFound = false;
46
- let separatorsArr = [];
47
- let lastNonWhitespaceCharAt = null;
48
- let fixable = true;
49
- for (let i = opts.from; i < opts.to; i++) {
50
- if (str[i].trim() && str[i] !== opts.separator) {
51
- lastNonWhitespaceCharAt = i;
52
- }
53
- if (chunkStartsAt === null && str[i].trim() && (!opts.separator || str[i] !== opts.separator)) {
54
- if (!firstNonwhitespaceNonseparatorCharFound) {
55
- firstNonwhitespaceNonseparatorCharFound = true;
56
- }
57
- if (separatorsArr.length) {
58
- if (separatorsArr.length > 1) {
59
- separatorsArr.forEach((separatorsIdx, orderNumber) => {
60
- if (orderNumber) {
61
- opts.errCb([[separatorsIdx + opts.offset, separatorsIdx + 1 + opts.offset]], "Remove separator.", fixable);
62
- }
63
- });
64
- }
65
- separatorsArr = [];
66
- }
67
- chunkStartsAt = i;
68
- }
69
- if (Number.isInteger(chunkStartsAt) && (i > chunkStartsAt && opts.separator && str[i] === opts.separator || i + 1 === opts.to)) {
70
- str.slice(chunkStartsAt, i + 1 === opts.to && str[i] !== opts.separator && str[i].trim() ? i + 1 : i);
71
- if (typeof opts.cb === "function") {
72
- opts.cb(chunkStartsAt + opts.offset, (i + 1 === opts.to && str[i] !== opts.separator && str[i].trim() ? i + 1 : lastNonWhitespaceCharAt + 1) + opts.offset);
73
- }
74
- chunkStartsAt = null;
75
- }
76
- if (!str[i].trim() && whitespaceStartsAt === null) {
77
- whitespaceStartsAt = i;
78
- }
79
- if (whitespaceStartsAt !== null && (str[i].trim() || i + 1 === opts.to)) {
80
- if (whitespaceStartsAt === opts.from) {
81
- if (!opts.leadingWhitespaceOK && typeof opts.errCb === "function") {
82
- opts.errCb([[whitespaceStartsAt + opts.offset, (i + 1 === opts.to ? i + 1 : i) + opts.offset]], "Remove whitespace.", fixable);
83
- }
84
- } else if (!str[i].trim() && i + 1 === opts.to) {
85
- if (!opts.trailingWhitespaceOK && typeof opts.errCb === "function") {
86
- opts.errCb([[whitespaceStartsAt + opts.offset, i + 1 + opts.offset]], "Remove whitespace.", fixable);
87
- }
88
- } else if ((!opts.oneSpaceAfterCommaOK || !(str[i].trim() && i > opts.from + 1 && str[i - 1] === " " && str[i - 2] === ",")) && (!opts.innerWhitespaceAllowed || !(firstNonwhitespaceNonseparatorCharFound && str[whitespaceStartsAt - 1] && str[i].trim() && str[i] !== opts.separator && str[whitespaceStartsAt - 1] !== opts.separator))) {
89
- let startingIdx = whitespaceStartsAt;
90
- let endingIdx = i;
91
- if (i + 1 === opts.to && str[i] !== opts.separator && !str[i].trim()) {
92
- endingIdx += 1;
93
- }
94
- let whatToAdd = "";
95
- if (opts.oneSpaceAfterCommaOK) {
96
- if (str[whitespaceStartsAt] === " " && str[whitespaceStartsAt - 1] === opts.separator) {
97
- startingIdx += 1;
98
- } else if (str[whitespaceStartsAt] !== " ") {
99
- whatToAdd = " ";
100
- }
101
- }
102
- let message = "Remove whitespace.";
103
- if (!opts.innerWhitespaceAllowed && firstNonwhitespaceNonseparatorCharFound && str[whitespaceStartsAt - 1] && str[i].trim() && str[i] !== opts.separator && str[whitespaceStartsAt - 1] !== opts.separator) {
104
- fixable = false;
105
- message = "Bad whitespace.";
106
- }
107
- if (whatToAdd.length) {
108
- opts.errCb([[startingIdx + opts.offset, endingIdx + opts.offset, whatToAdd]], message, fixable);
109
- } else {
110
- opts.errCb([[startingIdx + opts.offset, endingIdx + opts.offset]], message, fixable);
111
- }
112
- fixable = true;
113
- }
114
- whitespaceStartsAt = null;
115
- }
116
- if (str[i] === opts.separator) {
117
- if (!firstNonwhitespaceNonseparatorCharFound) {
118
- opts.errCb([[i + opts.offset, i + 1 + opts.offset]], "Remove separator.", fixable);
119
- } else {
120
- separatorsArr.push(i);
121
- }
122
- }
123
- if (i + 1 === opts.to) {
124
- separatorsArr.forEach(separatorsIdx => {
125
- opts.errCb([[separatorsIdx + opts.offset, separatorsIdx + 1 + opts.offset]], "Remove separator.", fixable);
126
- });
127
- }
128
- }
129
- }
130
-
131
- 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
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
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).stringProcessCommaSeparated={})}(this,(function(e){"use strict";e.processCommaSep=function(e,t){if("string"!=typeof e)throw new Error(`string-process-comma-separated: [THROW_ID_01] input must be string! It was given as ${typeof e}, equal to:\n${JSON.stringify(e,null,4)}`);if(!e.length||!t||!t.cb&&!t.errCb)return;const r={...{from:0,to:e.length,offset:0,leadingWhitespaceOK:!1,trailingWhitespaceOK:!1,oneSpaceAfterCommaOK:!1,innerWhitespaceAllowed:!1,separator:",",cb:null,errCb:null},...t};Number.isInteger(t.from)||(r.from=0),Number.isInteger(t.to)||(r.to=e.length),Number.isInteger(t.offset)||(r.offset=0);let o=null,s=null,f=!1,a=[],i=null,n=!0;for(let t=r.from;t<r.to;t++){if(e[t].trim()&&e[t]!==r.separator&&(i=t),null!==o||!e[t].trim()||r.separator&&e[t]===r.separator||(f||(f=!0),a.length&&(a.length>1&&a.forEach(((e,t)=>{t&&r.errCb([[e+r.offset,e+1+r.offset]],"Remove separator.",n)})),a=[]),o=t),Number.isInteger(o)&&(t>o&&r.separator&&e[t]===r.separator||t+1===r.to)&&(e.slice(o,t+1===r.to&&e[t]!==r.separator&&e[t].trim()?t+1:t),"function"==typeof r.cb&&r.cb(o+r.offset,(t+1===r.to&&e[t]!==r.separator&&e[t].trim()?t+1:i+1)+r.offset),o=null),e[t].trim()||null!==s||(s=t),null!==s&&(e[t].trim()||t+1===r.to)){if(s===r.from)r.leadingWhitespaceOK||"function"!=typeof r.errCb||r.errCb([[s+r.offset,(t+1===r.to?t+1:t)+r.offset]],"Remove whitespace.",n);else if(e[t].trim()||t+1!==r.to){if(!(r.oneSpaceAfterCommaOK&&e[t].trim()&&t>r.from+1&&" "===e[t-1]&&","===e[t-2]||r.innerWhitespaceAllowed&&f&&e[s-1]&&e[t].trim()&&e[t]!==r.separator&&e[s-1]!==r.separator)){let o=s,a=t;t+1!==r.to||e[t]===r.separator||e[t].trim()||(a+=1);let i="";r.oneSpaceAfterCommaOK&&(" "===e[s]&&e[s-1]===r.separator?o+=1:" "!==e[s]&&(i=" "));let l="Remove whitespace.";!r.innerWhitespaceAllowed&&f&&e[s-1]&&e[t].trim()&&e[t]!==r.separator&&e[s-1]!==r.separator&&(n=!1,l="Bad whitespace."),r.errCb(i.length?[[o+r.offset,a+r.offset,i]]:[[o+r.offset,a+r.offset]],l,n),n=!0}}else r.trailingWhitespaceOK||"function"!=typeof r.errCb||r.errCb([[s+r.offset,t+1+r.offset]],"Remove whitespace.",n);s=null}e[t]===r.separator&&(f?a.push(t):r.errCb([[t+r.offset,t+1+r.offset]],"Remove separator.",n)),t+1===r.to&&a.forEach((e=>{r.errCb([[e+r.offset,e+1+r.offset]],"Remove separator.",n)}))}},e.version="3.0.4",Object.defineProperty(e,"__esModule",{value:!0})}));
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);})();
@@ -1,6 +1,7 @@
1
1
  // Quick Take
2
2
 
3
3
  import { strict as assert } from "assert";
4
+
4
5
  import { processCommaSep } from "../dist/string-process-comma-separated.esm.js";
5
6
 
6
7
  const gatheredChunks = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "string-process-comma-separated",
3
- "version": "3.0.4",
3
+ "version": "3.0.10",
4
4
  "description": "Extracts chunks from possibly comma or whatever-separated string",
5
5
  "keywords": [
6
6
  "characters",
@@ -33,93 +33,34 @@
33
33
  },
34
34
  "types": "types/index.d.ts",
35
35
  "scripts": {
36
- "build": "rollup -c",
37
- "ci_test": "npm run build && npm run format && tap --no-only --reporter=silent --output-file=testStats.md && npm run clean_cov",
38
- "clean_cov": "../../scripts/leaveCoverageTotalOnly.js",
39
- "clean_types": "../../scripts/cleanTypes.js",
40
- "dev": "rollup -c --dev",
41
- "devunittest": "npm run dev && tap --only -R 'base'",
42
- "esbuild": "node '../../scripts/esbuild.js'",
43
- "esbuild_dev": "cross-env MODE=dev node '../../scripts/esbuild.js'",
44
- "format": "npm run lect && npm run prettier && npm run lint",
45
- "lect": "lect",
46
- "lint": "../../node_modules/eslint/bin/eslint.js . --ext .js --ext .ts --fix --config \"../../.eslintrc.json\" --quiet",
47
- "perf": "node perf/check",
48
- "prettier": "../../node_modules/prettier/bin-prettier.js '*.{js,css,scss,vue,md,ts}' --write --loglevel silent",
49
- "republish": "npm publish || :",
50
- "tap": "tap",
51
- "pretest": "npm run build",
52
- "test": "npm run lint && npm run unittest && npm run test:examples && npm run clean_cov && npm run format",
53
- "test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier",
54
- "tsc": "tsc",
55
- "unittest": "tap --no-only --output-file=testStats.md --reporter=terse && tsc -p tsconfig.json --noEmit && npm run clean_cov && npm run perf"
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
- "tap": {
58
- "check-coverage": false,
59
- "coverage-report": [
60
- "json-summary",
61
- "text"
62
- ],
63
- "node-arg": [
64
- "--no-warnings",
65
- "--experimental-loader",
66
- "@istanbuljs/esm-loader-hook"
49
+ "engines": {
50
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
51
+ },
52
+ "c8": {
53
+ "check-coverage": true,
54
+ "exclude": [
55
+ "**/test/**/*.*"
67
56
  ],
68
- "timeout": 0
57
+ "lines": 100
69
58
  },
70
59
  "lect": {
71
60
  "licence": {
72
61
  "extras": [
73
62
  ""
74
63
  ]
75
- },
76
- "req": "{ processCommaSep }",
77
- "various": {
78
- "devDependencies": []
79
64
  }
80
- },
81
- "dependencies": {
82
- "@babel/runtime": "^7.16.0"
83
- },
84
- "devDependencies": {
85
- "@babel/cli": "^7.16.0",
86
- "@babel/core": "^7.16.0",
87
- "@babel/node": "^7.16.0",
88
- "@babel/plugin-external-helpers": "^7.16.0",
89
- "@babel/plugin-proposal-class-properties": "^7.16.0",
90
- "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
91
- "@babel/plugin-proposal-object-rest-spread": "^7.16.0",
92
- "@babel/plugin-proposal-optional-chaining": "^7.16.0",
93
- "@babel/plugin-transform-runtime": "^7.16.0",
94
- "@babel/preset-env": "^7.16.0",
95
- "@babel/preset-typescript": "^7.16.0",
96
- "@babel/register": "^7.16.0",
97
- "@istanbuljs/esm-loader-hook": "^0.1.2",
98
- "@rollup/plugin-babel": "^5.3.0",
99
- "@rollup/plugin-commonjs": "^21.0.1",
100
- "@rollup/plugin-json": "^4.1.0",
101
- "@rollup/plugin-node-resolve": "^13.0.6",
102
- "@rollup/plugin-strip": "^2.1.0",
103
- "@rollup/plugin-typescript": "^8.3.0",
104
- "@types/node": "^16.11.6",
105
- "@types/tap": "^15.0.5",
106
- "@typescript-eslint/eslint-plugin": "^5.3.0",
107
- "@typescript-eslint/parser": "^5.3.0",
108
- "core-js": "^3.19.1",
109
- "cross-env": "^7.0.3",
110
- "eslint": "^8.1.0",
111
- "lect": "^0.18.4",
112
- "rollup": "^2.59.0",
113
- "rollup-plugin-ascii": "^0.0.3",
114
- "rollup-plugin-banner": "^0.2.1",
115
- "rollup-plugin-cleanup": "^3.2.1",
116
- "rollup-plugin-dts": "^4.0.0",
117
- "rollup-plugin-terser": "^7.0.2",
118
- "tap": "^15.0.10",
119
- "tslib": "^2.3.1",
120
- "typescript": "^4.4.4"
121
- },
122
- "engines": {
123
- "node": ">=12"
124
65
  }
125
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 &#x7B; strict as assert &#x7D; from \"assert\";\nimport &#x7B; processCommaSep &#x7D; from \"string-process-comma-separated\";\n\nconst gatheredChunks = [];\nconst gatheredErrors = [];\nconst rawnbsp = \"\\u00a0\";\n\n// it's a callback-interface:\nprocessCommaSep(`<FRAMESET rows=\" ,,\\t50% ,$&#x7B;rawnbsp&#x7D; 50% ,\\t\\t,\">`, &#x7B;\n from: 16, // <- beginning of the attribute's value\n to: 35, // <- ending of the attribute's value\n separator: \",\",\n cb: (idxFrom, idxTo) => &#x7B;\n gatheredChunks.push([idxFrom, idxTo]);\n &#x7D;,\n errCb: (ranges, message) => &#x7B;\n gatheredErrors.push(&#x7B; ranges, message &#x7D;);\n &#x7D;,\n&#x7D;);\n\nassert.deepEqual(gatheredChunks, [\n [20, 23],\n [27, 30],\n]);\n\nassert.deepEqual(gatheredErrors, [\n &#x7B; ranges: [[16, 17]], message: \"Remove whitespace.\" &#x7D;,\n &#x7B; ranges: [[17, 18]], message: \"Remove separator.\" &#x7D;,\n &#x7B; ranges: [[18, 19]], message: \"Remove separator.\" &#x7D;,\n &#x7B; ranges: [[19, 20]], message: \"Remove whitespace.\" &#x7D;,\n &#x7B; ranges: [[23, 24]], message: \"Remove whitespace.\" &#x7D;,\n &#x7B; ranges: [[25, 27]], message: \"Remove whitespace.\" &#x7D;,\n &#x7B; ranges: [[30, 31]], message: \"Remove whitespace.\" &#x7D;,\n &#x7B; ranges: [[32, 34]], message: \"Remove whitespace.\" &#x7D;,\n &#x7B; ranges: [[31, 32]], message: \"Remove separator.\" &#x7D;,\n &#x7B; ranges: [[34, 35]], message: \"Remove separator.\" &#x7D;,\n]);"}}