string-process-comma-separated 3.0.2 → 3.0.3
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,6 +3,20 @@
|
|
|
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
|
+
|
|
6
20
|
## 3.0.1 (2021-09-13)
|
|
7
21
|
|
|
8
22
|
### Bug Fixes
|
|
@@ -1,13 +1,13 @@
|
|
|
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.3
|
|
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.
|
|
10
|
+
var version$1 = "3.0.3";
|
|
11
11
|
|
|
12
12
|
const version = version$1;
|
|
13
13
|
function processCommaSep(str, originalOpts) {
|
|
@@ -1,10 +1,10 @@
|
|
|
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.3
|
|
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.
|
|
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.3",Object.defineProperty(e,"__esModule",{value:!0})}));
|
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.3",
|
|
4
4
|
"description": "Extracts chunks from possibly comma or whatever-separated string",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"characters",
|
|
@@ -34,11 +34,13 @@
|
|
|
34
34
|
"types": "types/index.d.ts",
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "rollup -c",
|
|
37
|
-
"esbuild": "node '../../scripts/esbuild.js'",
|
|
38
|
-
"esbuild_dev": "cross-env MODE=dev node '../../scripts/esbuild.js'",
|
|
39
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
40
|
"dev": "rollup -c --dev",
|
|
41
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'",
|
|
42
44
|
"format": "npm run lect && npm run prettier && npm run lint",
|
|
43
45
|
"lect": "lect",
|
|
44
46
|
"lint": "../../node_modules/eslint/bin/eslint.js . --ext .js --ext .ts --fix --config \"../../.eslintrc.json\" --quiet",
|
|
@@ -46,13 +48,11 @@
|
|
|
46
48
|
"prettier": "../../node_modules/prettier/bin-prettier.js '*.{js,css,scss,vue,md,ts}' --write --loglevel silent",
|
|
47
49
|
"republish": "npm publish || :",
|
|
48
50
|
"tap": "tap",
|
|
49
|
-
"tsc": "tsc",
|
|
50
51
|
"pretest": "npm run build",
|
|
51
52
|
"test": "npm run lint && npm run unittest && npm run test:examples && npm run clean_cov && npm run format",
|
|
52
53
|
"test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier",
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"clean_types": "../../scripts/cleanTypes.js"
|
|
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"
|
|
56
56
|
},
|
|
57
57
|
"tap": {
|
|
58
58
|
"check-coverage": false,
|
|
@@ -79,45 +79,45 @@
|
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@babel/runtime": "^7.
|
|
82
|
+
"@babel/runtime": "^7.16.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@babel/cli": "^7.
|
|
86
|
-
"@babel/core": "^7.
|
|
87
|
-
"@babel/node": "^7.
|
|
88
|
-
"@babel/plugin-external-helpers": "^7.
|
|
89
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
90
|
-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.
|
|
91
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.
|
|
92
|
-
"@babel/plugin-proposal-optional-chaining": "^7.
|
|
93
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
94
|
-
"@babel/preset-env": "^7.
|
|
95
|
-
"@babel/preset-typescript": "^7.
|
|
96
|
-
"@babel/register": "^7.
|
|
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
97
|
"@istanbuljs/esm-loader-hook": "^0.1.2",
|
|
98
98
|
"@rollup/plugin-babel": "^5.3.0",
|
|
99
|
-
"@rollup/plugin-commonjs": "^
|
|
99
|
+
"@rollup/plugin-commonjs": "^21.0.1",
|
|
100
100
|
"@rollup/plugin-json": "^4.1.0",
|
|
101
|
-
"@rollup/plugin-node-resolve": "^13.0.
|
|
101
|
+
"@rollup/plugin-node-resolve": "^13.0.6",
|
|
102
102
|
"@rollup/plugin-strip": "^2.1.0",
|
|
103
|
-
"@rollup/plugin-typescript": "^8.
|
|
104
|
-
"@types/node": "^16.
|
|
103
|
+
"@rollup/plugin-typescript": "^8.3.0",
|
|
104
|
+
"@types/node": "^16.11.6",
|
|
105
105
|
"@types/tap": "^15.0.5",
|
|
106
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
107
|
-
"@typescript-eslint/parser": "^
|
|
108
|
-
"core-js": "^3.
|
|
106
|
+
"@typescript-eslint/eslint-plugin": "^5.2.0",
|
|
107
|
+
"@typescript-eslint/parser": "^5.2.0",
|
|
108
|
+
"core-js": "^3.19.0",
|
|
109
109
|
"cross-env": "^7.0.3",
|
|
110
|
-
"eslint": "^
|
|
111
|
-
"lect": "^0.18.
|
|
112
|
-
"rollup": "^2.
|
|
110
|
+
"eslint": "^8.1.0",
|
|
111
|
+
"lect": "^0.18.3",
|
|
112
|
+
"rollup": "^2.59.0",
|
|
113
113
|
"rollup-plugin-ascii": "^0.0.3",
|
|
114
114
|
"rollup-plugin-banner": "^0.2.1",
|
|
115
115
|
"rollup-plugin-cleanup": "^3.2.1",
|
|
116
116
|
"rollup-plugin-dts": "^4.0.0",
|
|
117
117
|
"rollup-plugin-terser": "^7.0.2",
|
|
118
|
-
"tap": "^15.0.
|
|
118
|
+
"tap": "^15.0.10",
|
|
119
119
|
"tslib": "^2.3.1",
|
|
120
|
-
"typescript": "^4.4.
|
|
120
|
+
"typescript": "^4.4.4"
|
|
121
121
|
},
|
|
122
122
|
"engines": {
|
|
123
123
|
"node": ">=12"
|