string-process-comma-separated 4.3.0 → 4.3.1
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,13 +3,19 @@
|
|
|
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
|
+
## 4.3.1 (2026-08-22)
|
|
7
|
+
|
|
8
|
+
### Performance Improvements
|
|
9
|
+
|
|
10
|
+
- optimise package hot paths and JSON editing ([f3112bd](https://github.com/codsen/codsen/commit/f3112bd7fc0d7c9bc09312d3744c950691d72ca5))
|
|
11
|
+
|
|
6
12
|
## 4.3.0 (2026-08-19)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
|
9
15
|
|
|
10
16
|
- make validation diagnostics safe ([7b01074](https://github.com/codsen/codsen/commit/7b0107476f12734aeb8e82852ba980b187280110))
|
|
11
17
|
- repair representative perf workloads ([975e958](https://github.com/codsen/codsen/commit/975e958c0794ec256eba84e088b472483fb69e52))
|
|
12
|
-
- resolve review findings
|
|
18
|
+
- resolve various review findings ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
|
|
13
19
|
- retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
|
|
14
20
|
- standardise comma processor errs ([405835e](https://github.com/codsen/codsen/commit/405835e731ead8ee97319dcc228167d41e757477))
|
|
15
21
|
|
|
@@ -1,11 +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 4.3.
|
|
4
|
+
* @version 4.3.1
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/string-process-comma-separated/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import{formatDiagnosticValue as d}from"codsen-utils";var $="4.3.
|
|
10
|
+
import{formatDiagnosticValue as d}from"codsen-utils";var $="4.3.1";var y=$;function E(s,i){if(typeof s!="string")throw new Error(`string-process-comma-separated/processCommaSep(): [THROW_ID_01] input must be string! It was given as ${typeof s}, equal to:
|
|
11
11
|
${d(s,4)}`);if(!s.length||!i||!i.cb&&!i.errCb)return;let e={...{from:0,to:s.length,offset:0,leadingWhitespaceOK:!1,trailingWhitespaceOK:!1,oneSpaceAfterCommaOK:!1,innerWhitespaceAllowed:!1,separator:",",cb:null,errCb:null},...i};Number.isInteger(i.from)||(e.from=0),Number.isInteger(i.to)||(e.to=s.length),Number.isInteger(i.offset)||(e.offset=0);let a=null,o=null,p=!1,l=[],f=null,r=!0;for(let t=e.from;t<e.to;t++){if(s[t].trim()&&s[t]!==e.separator&&(f=t),a===null&&s[t].trim()&&(!e.separator||s[t]!==e.separator)&&(p||(p=!0),l.length&&(l.length>1&&l.forEach((n,m)=>{m&&e.errCb&&e.errCb([[n+e.offset,n+1+e.offset]],"Remove separator.",r)}),l=[]),a=t),Number.isInteger(a)&&(t>a&&e.separator&&s[t]===e.separator||t+1===e.to)&&(typeof e.cb=="function"&&e.cb(a+e.offset,(t+1===e.to&&s[t]!==e.separator&&s[t].trim()?t+1:f+1)+e.offset),a=null),!s[t].trim()&&o===null&&(o=t),o!==null&&(s[t].trim()||t+1===e.to)){if(o===e.from)!e.leadingWhitespaceOK&&typeof e.errCb=="function"&&e.errCb([[o+e.offset,(t+1===e.to?t+1:t)+e.offset]],"Remove whitespace.",r);else if(!s[t].trim()&&t+1===e.to)!e.trailingWhitespaceOK&&typeof e.errCb=="function"&&e.errCb([[o+e.offset,t+1+e.offset]],"Remove whitespace.",r);else if((!e.oneSpaceAfterCommaOK||!(s[t].trim()&&t>e.from+1&&s[t-1]===" "&&s[t-2]===","))&&(!e.innerWhitespaceAllowed||!(p&&s[o-1]&&s[t].trim()&&s[t]!==e.separator&&s[o-1]!==e.separator))){let n=o,m=t;t+1===e.to&&s[t]!==e.separator&&!s[t].trim()&&(m+=1);let c="";e.oneSpaceAfterCommaOK&&(s[o]===" "&&s[o-1]===e.separator?n+=1:s[o]!==" "&&(c=" "));let u="Remove whitespace.";!e.innerWhitespaceAllowed&&p&&s[o-1]&&s[t].trim()&&s[t]!==e.separator&&s[o-1]!==e.separator&&(r=!1,u="Bad whitespace."),c.length&&e.errCb?e.errCb([[n+e.offset,m+e.offset,c]],u,r):e.errCb&&e.errCb([[n+e.offset,m+e.offset]],u,r),r=!0}o=null}s[t]===e.separator&&(!p&&e.errCb?e.errCb([[t+e.offset,t+1+e.offset]],"Remove separator.",r):l.push(t)),t+1===e.to&&e.errCb&&l.forEach(n=>{e.errCb([[n+e.offset,n+1+e.offset]],"Remove separator.",r)})}}export{E as processCommaSep,y as version};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name string-process-comma-separated
|
|
3
3
|
* @fileoverview Extracts chunks from possibly comma or whatever-separated string
|
|
4
|
-
* @version 4.3.
|
|
4
|
+
* @version 4.3.1
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/string-process-comma-separated/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";var stringProcessCommaSeparated=(()=>{var A=Object.defineProperty;var
|
|
10
|
+
"use strict";var stringProcessCommaSeparated=(()=>{var A=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames,S=Object.getOwnPropertySymbols;var x=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var w=(t,n,r)=>n in t?A(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,C=(t,n)=>{for(var r in n||(n={}))x.call(n,r)&&w(t,r,n[r]);if(S)for(var r of S(n))R.call(n,r)&&w(t,r,n[r]);return t};var V=(t,n)=>{for(var r in n)A(t,r,{get:n[r],enumerable:!0})},M=(t,n,r,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of I(n))!x.call(t,a)&&a!==r&&A(t,a,{get:()=>n[a],enumerable:!(e=j(n,a))||e.enumerable});return t};var T=t=>M(A({},"__esModule",{value:!0}),t);var K={};V(K,{processCommaSep:()=>J,version:()=>U});function P(){let t=[],n=0,r=!1;return{append(e){return r?!1:n+e.length>1999?(t.push("\u2026"),n+=1,r=!0,!1):(t.push(e),n+=e.length,!0)},result(){return t.join("")},stopped(){return r}}}function B(t){return"\\u".concat(t.toString(16).padStart(4,"0"))}function O(t,n){if(t.append('"')){for(let r=0;r<n.length&&!t.stopped();r+=1){let e=n.charCodeAt(r);e===34?t.append('\\"'):e===92?t.append("\\\\"):e===8?t.append("\\b"):e===9?t.append("\\t"):e===10?t.append("\\n"):e===12?t.append("\\f"):e===13?t.append("\\r"):e<32||e===8232||e===8233||e>=55296&&e<=57343?t.append(B(e)):t.append(n[r])}t.append('"')}}function L(t){return t.get&&t.set?"[Getter/Setter]":t.get?"[Getter]":t.set?"[Setter]":"[Accessor]"}function k(t,n){t.append("Symbol(");let r=String(n);r.length>8&&O(t,r.slice(7,-1)),t.append(")")}function D(t,n){typeof n=="symbol"?k(t,n):O(t,String(n))}function N(t,n=0){let r=P(),e=n===4?4:0,a=new WeakSet,l=0;function g(o){e&&r.append(" ".repeat(o*e))}function p(o,i){o&&r.append(","),e&&(r.append("\n"),g(i+1))}function v(o,i,f){e&&i&&(r.append("\n"),g(f)),r.append(o)}function u(o,i){Object.prototype.hasOwnProperty.call(o,"value")?y(o.value,i):r.append(L(o))}function s(o,i){let f;try{f=Reflect.getOwnPropertyDescriptor(o,"length")}catch(d){r.append("[Uninspectable]");return}let c=f==null?void 0:f.value;if(!Number.isSafeInteger(c)||c<0){r.append("[Uninspectable]");return}r.append("[");let m=!1;for(let d=0;d<c&&!r.stopped();d+=1){if(p(m,i),m=!0,l>=50){r.append("[MaxEntries]");break}l+=1;let $;try{$=Reflect.getOwnPropertyDescriptor(o,String(d))}catch(G){r.append("[Uninspectable]");continue}$!=null&&$.enumerable?u($,i+1):r.append("[Empty]")}v("]",m,i)}function h(o,i){let f;try{f=Reflect.ownKeys(o)}catch(m){r.append("[Uninspectable]");return}r.append("{");let c=!1;for(let m of f){if(r.stopped())break;if(l>=50){p(c,i),c=!0,O(r,"\u2026"),r.append(e?": ":":"),r.append("[MaxEntries]");break}l+=1;let d;try{d=Reflect.getOwnPropertyDescriptor(o,m)}catch($){p(c,i),c=!0,D(r,m),r.append(e?": ":":"),r.append("[Uninspectable]");continue}d!=null&&d.enumerable&&(p(c,i),c=!0,D(r,m),r.append(e?": ":":"),u(d,i+1))}v("}",c,i)}function b(o,i){if(a.has(o)){r.append("[Circular]");return}if(i>=5){r.append("[MaxDepth]");return}let f;try{f=Array.isArray(o)}catch(c){r.append("[Uninspectable]");return}a.add(o);try{f?s(o,i):h(o,i)}finally{a.delete(o)}}function y(o,i){o===null?r.append("null"):typeof o=="string"?O(r,o):typeof o=="number"?r.append(Object.is(o,-0)?"-0":String(o)):typeof o=="boolean"?r.append(o?"true":"false"):typeof o>"u"?r.append("undefined"):typeof o=="bigint"?r.append("".concat(o,"n")):typeof o=="symbol"?k(r,o):typeof o=="function"?r.append("[Function]"):b(o,i)}try{return y(t,0),r.result()}catch(o){return"[Uninspectable]"}}var Q=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]);var E,q=(E=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:E.get;var z=Date.prototype.getTime;var W="4.3.1";var U=W;function J(t,n){if(typeof t!="string")throw new Error("string-process-comma-separated/processCommaSep(): [THROW_ID_01] input must be string! It was given as ".concat(typeof t,", equal to:\n").concat(N(t,4)));if(!t.length||!n||!n.cb&&!n.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=C(C({},r),n);Number.isInteger(n.from)||(e.from=0),Number.isInteger(n.to)||(e.to=t.length),Number.isInteger(n.offset)||(e.offset=0);let a=null,l=null,g=!1,p=[],v=null,u=!0;for(let s=e.from;s<e.to;s++){if(t[s].trim()&&t[s]!==e.separator&&(v=s),a===null&&t[s].trim()&&(!e.separator||t[s]!==e.separator)&&(g||(g=!0),p.length&&(p.length>1&&p.forEach((h,b)=>{b&&e.errCb&&e.errCb([[h+e.offset,h+1+e.offset]],"Remove separator.",u)}),p=[]),a=s),Number.isInteger(a)&&(s>a&&e.separator&&t[s]===e.separator||s+1===e.to)&&(typeof e.cb=="function"&&e.cb(a+e.offset,(s+1===e.to&&t[s]!==e.separator&&t[s].trim()?s+1:v+1)+e.offset),a=null),!t[s].trim()&&l===null&&(l=s),l!==null&&(t[s].trim()||s+1===e.to)){if(l===e.from)!e.leadingWhitespaceOK&&typeof e.errCb=="function"&&e.errCb([[l+e.offset,(s+1===e.to?s+1:s)+e.offset]],"Remove whitespace.",u);else if(!t[s].trim()&&s+1===e.to)!e.trailingWhitespaceOK&&typeof e.errCb=="function"&&e.errCb([[l+e.offset,s+1+e.offset]],"Remove whitespace.",u);else if((!e.oneSpaceAfterCommaOK||!(t[s].trim()&&s>e.from+1&&t[s-1]===" "&&t[s-2]===","))&&(!e.innerWhitespaceAllowed||!(g&&t[l-1]&&t[s].trim()&&t[s]!==e.separator&&t[l-1]!==e.separator))){let h=l,b=s;s+1===e.to&&t[s]!==e.separator&&!t[s].trim()&&(b+=1);let y="";e.oneSpaceAfterCommaOK&&(t[l]===" "&&t[l-1]===e.separator?h+=1:t[l]!==" "&&(y=" "));let o="Remove whitespace.";!e.innerWhitespaceAllowed&&g&&t[l-1]&&t[s].trim()&&t[s]!==e.separator&&t[l-1]!==e.separator&&(u=!1,o="Bad whitespace."),y.length&&e.errCb?e.errCb([[h+e.offset,b+e.offset,y]],o,u):e.errCb&&e.errCb([[h+e.offset,b+e.offset]],o,u),u=!0}l=null}t[s]===e.separator&&(!g&&e.errCb?e.errCb([[s+e.offset,s+1+e.offset]],"Remove separator.",u):p.push(s)),s+1===e.to&&e.errCb&&p.forEach(h=>{e.errCb([[h+e.offset,h+1+e.offset]],"Remove separator.",u)})}}return T(K);})();
|
|
11
11
|
/**
|
|
12
12
|
* @name codsen-utils
|
|
13
13
|
* @fileoverview Various utility functions
|
|
14
|
-
* @version 1.
|
|
14
|
+
* @version 1.9.0
|
|
15
15
|
* @author Roy Revelt
|
|
16
16
|
* @license MIT
|
|
17
17
|
* {@link https://codsen.com/os/codsen-utils/}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "string-process-comma-separated",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.1",
|
|
4
4
|
"description": "Extracts chunks from possibly comma or whatever-separated string",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"characters",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"codsen-utils": "^1.
|
|
69
|
+
"codsen-utils": "^1.9.0"
|
|
70
70
|
},
|
|
71
71
|
"engines": {
|
|
72
72
|
"node": ">=18.20.8"
|