string-process-comma-separated 4.1.20 → 4.2.0

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/.eslintcache CHANGED
@@ -1 +1 @@
1
- [{"/home/runner/work/codsen/codsen/packages/string-process-comma-separated/examples/_quickTake.js":"1","/home/runner/work/codsen/codsen/packages/string-process-comma-separated/perf/check.js":"2","/home/runner/work/codsen/codsen/packages/string-process-comma-separated/rollup.config.js":"3","/home/runner/work/codsen/codsen/packages/string-process-comma-separated/src/main.ts":"4","/home/runner/work/codsen/codsen/packages/string-process-comma-separated/test/test.js":"5"},{"size":1275,"mtime":1760280945970,"results":"6","hashOfConfig":"7"},{"size":851,"mtime":1760280945970,"results":"8","hashOfConfig":"9"},{"size":373,"mtime":1760280945970,"results":"10","hashOfConfig":"7"},{"size":15672,"mtime":1760280945970,"results":"11","hashOfConfig":"9"},{"size":15098,"mtime":1760280945970,"results":"12","hashOfConfig":"13"},{"filePath":"14","messages":"15","suppressedMessages":"16","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1f1u168",{"filePath":"17","messages":"18","suppressedMessages":"19","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"91l1rm",{"filePath":"20","messages":"21","suppressedMessages":"22","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"23","messages":"24","suppressedMessages":"25","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"26","messages":"27","suppressedMessages":"28","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"ns3qdb","/home/runner/work/codsen/codsen/packages/string-process-comma-separated/examples/_quickTake.js",[],[],"/home/runner/work/codsen/codsen/packages/string-process-comma-separated/perf/check.js",[],[],"/home/runner/work/codsen/codsen/packages/string-process-comma-separated/rollup.config.js",[],[],"/home/runner/work/codsen/codsen/packages/string-process-comma-separated/src/main.ts",[],[],"/home/runner/work/codsen/codsen/packages/string-process-comma-separated/test/test.js",[],["29","30","31","32"],{"ruleId":"33","severity":2,"message":"34","line":5,"column":17,"nodeType":null,"messageId":"35","endLine":5,"endColumn":19,"suppressions":"36"},{"ruleId":"33","severity":2,"message":"37","line":5,"column":21,"nodeType":null,"messageId":"35","endLine":5,"endColumn":23,"suppressions":"38"},{"ruleId":"33","severity":2,"message":"39","line":5,"column":33,"nodeType":null,"messageId":"35","endLine":5,"endColumn":37,"suppressions":"40"},{"ruleId":"33","severity":2,"message":"41","line":5,"column":44,"nodeType":null,"messageId":"35","endLine":5,"endColumn":49,"suppressions":"42"},"@typescript-eslint/no-unused-vars","'is' is defined but never used.","unusedVar",["43"],"'ok' is defined but never used.",["44"],"'type' is defined but never used.",["45"],"'match' is defined but never used.",["46"],{"kind":"47","justification":"48"},{"kind":"47","justification":"48"},{"kind":"47","justification":"48"},{"kind":"47","justification":"48"},"directive",""]
1
+ [{"/home/runner/work/codsen/codsen/packages/string-process-comma-separated/examples/_quickTake.js":"1","/home/runner/work/codsen/codsen/packages/string-process-comma-separated/perf/check.js":"2","/home/runner/work/codsen/codsen/packages/string-process-comma-separated/rollup.config.js":"3","/home/runner/work/codsen/codsen/packages/string-process-comma-separated/src/main.ts":"4","/home/runner/work/codsen/codsen/packages/string-process-comma-separated/test/test.js":"5"},{"size":1275,"mtime":1760566739152,"results":"6","hashOfConfig":"7"},{"size":851,"mtime":1760566739152,"results":"8","hashOfConfig":"9"},{"size":373,"mtime":1760566739152,"results":"10","hashOfConfig":"7"},{"size":15672,"mtime":1760566739152,"results":"11","hashOfConfig":"9"},{"size":15098,"mtime":1760566739152,"results":"12","hashOfConfig":"13"},{"filePath":"14","messages":"15","suppressedMessages":"16","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1nlhngw",{"filePath":"17","messages":"18","suppressedMessages":"19","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1xjytlu",{"filePath":"20","messages":"21","suppressedMessages":"22","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"23","messages":"24","suppressedMessages":"25","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"26","messages":"27","suppressedMessages":"28","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"nrihsz","/home/runner/work/codsen/codsen/packages/string-process-comma-separated/examples/_quickTake.js",[],[],"/home/runner/work/codsen/codsen/packages/string-process-comma-separated/perf/check.js",[],[],"/home/runner/work/codsen/codsen/packages/string-process-comma-separated/rollup.config.js",[],[],"/home/runner/work/codsen/codsen/packages/string-process-comma-separated/src/main.ts",[],[],"/home/runner/work/codsen/codsen/packages/string-process-comma-separated/test/test.js",[],["29","30","31","32"],{"ruleId":"33","severity":2,"message":"34","line":5,"column":17,"nodeType":null,"messageId":"35","endLine":5,"endColumn":19,"suppressions":"36"},{"ruleId":"33","severity":2,"message":"37","line":5,"column":21,"nodeType":null,"messageId":"35","endLine":5,"endColumn":23,"suppressions":"38"},{"ruleId":"33","severity":2,"message":"39","line":5,"column":33,"nodeType":null,"messageId":"35","endLine":5,"endColumn":37,"suppressions":"40"},{"ruleId":"33","severity":2,"message":"41","line":5,"column":44,"nodeType":null,"messageId":"35","endLine":5,"endColumn":49,"suppressions":"42"},"@typescript-eslint/no-unused-vars","'is' is defined but never used.","unusedVar",["43"],"'ok' is defined but never used.",["44"],"'type' is defined but never used.",["45"],"'match' is defined but never used.",["46"],{"kind":"47","justification":"48"},{"kind":"47","justification":"48"},{"kind":"47","justification":"48"},{"kind":"47","justification":"48"},"directive",""]
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
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.2.0 (2025-10-15)
7
+
8
+ ### Features
9
+
10
+ - if value to be added is a number, keep it as is, don't stringify ([ce3e1a5](https://github.com/codsen/codsen/commit/ce3e1a525998ca3c0abf0142affef95b14cd1990))
11
+
6
12
  ## 4.1.0 (2023-05-13)
7
13
 
8
14
  ### Features
package/README.md CHANGED
@@ -74,7 +74,7 @@ assert.deepEqual(gatheredErrors, [
74
74
 
75
75
  ## Documentation
76
76
 
77
- Please [visit codsen.com](https://codsen.com/os/string-process-comma-separated/) for a full description of the API.
77
+ Please [visit codsen.com](https://codsen.com/os/string-process-comma-separated/) for a full description of the API. If you’re looking for the **Changelog**, it’s [here](https://github.com/codsen/codsen/blob/main/packages/string-process-comma-separated/CHANGELOG.md).
78
78
 
79
79
  ## Contributing
80
80
 
@@ -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.1.20
4
+ * @version 4.2.0
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
- var $="4.1.20";var O=$;function E(s,l){if(typeof s!="string")throw new Error(`string-process-comma-separated: [THROW_ID_01] input must be string! It was given as ${typeof s}, equal to:
10
+ var $="4.2.0";var O=$;function E(s,l){if(typeof s!="string")throw new Error(`string-process-comma-separated: [THROW_ID_01] input must be string! It was given as ${typeof s}, equal to:
11
11
  ${JSON.stringify(s,null,4)}`);if(!s.length||!l||!l.cb&&!l.errCb)return;let e={...{from:0,to:s.length,offset:0,leadingWhitespaceOK:!1,trailingWhitespaceOK:!1,oneSpaceAfterCommaOK:!1,innerWhitespaceAllowed:!1,separator:",",cb:null,errCb:null},...l};Number.isInteger(l.from)||(e.from=0),Number.isInteger(l.to)||(e.to=s.length),Number.isInteger(l.offset)||(e.offset=0);let i=null,o=null,p=!1,a=[],f=null,n=!0;for(let t=e.from;t<e.to;t++){if(s[t].trim()&&s[t]!==e.separator&&(f=t),i===null&&s[t].trim()&&(!e.separator||s[t]!==e.separator)&&(p||(p=!0),a.length&&(a.length>1&&a.forEach((r,u)=>{u&&e.errCb&&e.errCb([[r+e.offset,r+1+e.offset]],"Remove separator.",n)}),a=[]),i=t),Number.isInteger(i)&&(t>i&&e.separator&&s[t]===e.separator||t+1===e.to)){let r=s.slice(i,t+1===e.to&&s[t]!==e.separator&&s[t].trim()?t+1:t);typeof e.cb=="function"&&e.cb(i+e.offset,(t+1===e.to&&s[t]!==e.separator&&s[t].trim()?t+1:f+1)+e.offset),i=null}if(!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.",n);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.",n);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 r=o,u=t;t+1===e.to&&s[t]!==e.separator&&!s[t].trim()&&(u+=1);let m="";e.oneSpaceAfterCommaOK&&(s[o]===" "&&s[o-1]===e.separator?r+=1:s[o]!==" "&&(m=" "));let c="Remove whitespace.";!e.innerWhitespaceAllowed&&p&&s[o-1]&&s[t].trim()&&s[t]!==e.separator&&s[o-1]!==e.separator&&(n=!1,c="Bad whitespace."),m.length&&e.errCb?e.errCb([[r+e.offset,u+e.offset,m]],c,n):e.errCb&&e.errCb([[r+e.offset,u+e.offset]],c,n),n=!0}o=null}s[t]===e.separator&&(!p&&e.errCb?e.errCb([[t+e.offset,t+1+e.offset]],"Remove separator.",n):a.push(t)),t+1===e.to&&e.errCb&&a.forEach(r=>{e.errCb([[r+e.offset,r+1+e.offset]],"Remove separator.",n)})}}export{E as processCommaSep,O as version};
@@ -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 4.1.20
4
+ * @version 4.2.0
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 c=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames,g=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var h=(t,o,r)=>o in t?c(t,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[o]=r,b=(t,o)=>{for(var r in o||(o={}))O.call(o,r)&&h(t,r,o[r]);if(g)for(var r of g(o))y.call(o,r)&&h(t,r,o[r]);return t};var C=(t,o)=>{for(var r in o)c(t,r,{get:o[r],enumerable:!0})},N=(t,o,r,e)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of S(o))!O.call(t,l)&&l!==r&&c(t,l,{get:()=>o[l],enumerable:!(e=v(o,l))||e.enumerable});return t};var A=t=>N(c({},"__esModule",{value:!0}),t);var x={};C(x,{processCommaSep:()=>V,version:()=>D});var E="4.1.20";var D=E;function V(t,o){if(typeof t!="string")throw new Error("string-process-comma-separated: [THROW_ID_01] input must be string! It was given as ".concat(typeof t,", equal to:\n").concat(JSON.stringify(t,null,4)));if(!t.length||!o||!o.cb&&!o.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),o);Number.isInteger(o.from)||(e.from=0),Number.isInteger(o.to)||(e.to=t.length),Number.isInteger(o.offset)||(e.offset=0);let l=null,n=null,u=!1,p=[],d=null,a=!0;for(let s=e.from;s<e.to;s++){if(t[s].trim()&&t[s]!==e.separator&&(d=s),l===null&&t[s].trim()&&(!e.separator||t[s]!==e.separator)&&(u||(u=!0),p.length&&(p.length>1&&p.forEach((i,m)=>{m&&e.errCb&&e.errCb([[i+e.offset,i+1+e.offset]],"Remove separator.",a)}),p=[]),l=s),Number.isInteger(l)&&(s>l&&e.separator&&t[s]===e.separator||s+1===e.to)){let i=t.slice(l,s+1===e.to&&t[s]!==e.separator&&t[s].trim()?s+1:s);typeof e.cb=="function"&&e.cb(l+e.offset,(s+1===e.to&&t[s]!==e.separator&&t[s].trim()?s+1:d+1)+e.offset),l=null}if(!t[s].trim()&&n===null&&(n=s),n!==null&&(t[s].trim()||s+1===e.to)){if(n===e.from)!e.leadingWhitespaceOK&&typeof e.errCb=="function"&&e.errCb([[n+e.offset,(s+1===e.to?s+1:s)+e.offset]],"Remove whitespace.",a);else if(!t[s].trim()&&s+1===e.to)!e.trailingWhitespaceOK&&typeof e.errCb=="function"&&e.errCb([[n+e.offset,s+1+e.offset]],"Remove whitespace.",a);else if((!e.oneSpaceAfterCommaOK||!(t[s].trim()&&s>e.from+1&&t[s-1]===" "&&t[s-2]===","))&&(!e.innerWhitespaceAllowed||!(u&&t[n-1]&&t[s].trim()&&t[s]!==e.separator&&t[n-1]!==e.separator))){let i=n,m=s;s+1===e.to&&t[s]!==e.separator&&!t[s].trim()&&(m+=1);let f="";e.oneSpaceAfterCommaOK&&(t[n]===" "&&t[n-1]===e.separator?i+=1:t[n]!==" "&&(f=" "));let $="Remove whitespace.";!e.innerWhitespaceAllowed&&u&&t[n-1]&&t[s].trim()&&t[s]!==e.separator&&t[n-1]!==e.separator&&(a=!1,$="Bad whitespace."),f.length&&e.errCb?e.errCb([[i+e.offset,m+e.offset,f]],$,a):e.errCb&&e.errCb([[i+e.offset,m+e.offset]],$,a),a=!0}n=null}t[s]===e.separator&&(!u&&e.errCb?e.errCb([[s+e.offset,s+1+e.offset]],"Remove separator.",a):p.push(s)),s+1===e.to&&e.errCb&&p.forEach(i=>{e.errCb([[i+e.offset,i+1+e.offset]],"Remove separator.",a)})}}return A(x);})();
10
+ "use strict";var stringProcessCommaSeparated=(()=>{var c=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames,g=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var h=(t,o,r)=>o in t?c(t,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[o]=r,b=(t,o)=>{for(var r in o||(o={}))O.call(o,r)&&h(t,r,o[r]);if(g)for(var r of g(o))y.call(o,r)&&h(t,r,o[r]);return t};var C=(t,o)=>{for(var r in o)c(t,r,{get:o[r],enumerable:!0})},N=(t,o,r,e)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of S(o))!O.call(t,l)&&l!==r&&c(t,l,{get:()=>o[l],enumerable:!(e=v(o,l))||e.enumerable});return t};var A=t=>N(c({},"__esModule",{value:!0}),t);var x={};C(x,{processCommaSep:()=>V,version:()=>D});var E="4.2.0";var D=E;function V(t,o){if(typeof t!="string")throw new Error("string-process-comma-separated: [THROW_ID_01] input must be string! It was given as ".concat(typeof t,", equal to:\n").concat(JSON.stringify(t,null,4)));if(!t.length||!o||!o.cb&&!o.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),o);Number.isInteger(o.from)||(e.from=0),Number.isInteger(o.to)||(e.to=t.length),Number.isInteger(o.offset)||(e.offset=0);let l=null,n=null,u=!1,p=[],d=null,a=!0;for(let s=e.from;s<e.to;s++){if(t[s].trim()&&t[s]!==e.separator&&(d=s),l===null&&t[s].trim()&&(!e.separator||t[s]!==e.separator)&&(u||(u=!0),p.length&&(p.length>1&&p.forEach((i,m)=>{m&&e.errCb&&e.errCb([[i+e.offset,i+1+e.offset]],"Remove separator.",a)}),p=[]),l=s),Number.isInteger(l)&&(s>l&&e.separator&&t[s]===e.separator||s+1===e.to)){let i=t.slice(l,s+1===e.to&&t[s]!==e.separator&&t[s].trim()?s+1:s);typeof e.cb=="function"&&e.cb(l+e.offset,(s+1===e.to&&t[s]!==e.separator&&t[s].trim()?s+1:d+1)+e.offset),l=null}if(!t[s].trim()&&n===null&&(n=s),n!==null&&(t[s].trim()||s+1===e.to)){if(n===e.from)!e.leadingWhitespaceOK&&typeof e.errCb=="function"&&e.errCb([[n+e.offset,(s+1===e.to?s+1:s)+e.offset]],"Remove whitespace.",a);else if(!t[s].trim()&&s+1===e.to)!e.trailingWhitespaceOK&&typeof e.errCb=="function"&&e.errCb([[n+e.offset,s+1+e.offset]],"Remove whitespace.",a);else if((!e.oneSpaceAfterCommaOK||!(t[s].trim()&&s>e.from+1&&t[s-1]===" "&&t[s-2]===","))&&(!e.innerWhitespaceAllowed||!(u&&t[n-1]&&t[s].trim()&&t[s]!==e.separator&&t[n-1]!==e.separator))){let i=n,m=s;s+1===e.to&&t[s]!==e.separator&&!t[s].trim()&&(m+=1);let f="";e.oneSpaceAfterCommaOK&&(t[n]===" "&&t[n-1]===e.separator?i+=1:t[n]!==" "&&(f=" "));let $="Remove whitespace.";!e.innerWhitespaceAllowed&&u&&t[n-1]&&t[s].trim()&&t[s]!==e.separator&&t[n-1]!==e.separator&&(a=!1,$="Bad whitespace."),f.length&&e.errCb?e.errCb([[i+e.offset,m+e.offset,f]],$,a):e.errCb&&e.errCb([[i+e.offset,m+e.offset]],$,a),a=!0}n=null}t[s]===e.separator&&(!u&&e.errCb?e.errCb([[s+e.offset,s+1+e.offset]],"Remove separator.",a):p.push(s)),s+1===e.to&&e.errCb&&p.forEach(i=>{e.errCb([[i+e.offset,i+1+e.offset]],"Remove separator.",a)})}}return A(x);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "string-process-comma-separated",
3
- "version": "4.1.20",
3
+ "version": "4.2.0",
4
4
  "description": "Extracts chunks from possibly comma or whatever-separated string",
5
5
  "keywords": [
6
6
  "characters",
@@ -70,7 +70,7 @@
70
70
  }
71
71
  },
72
72
  "dependencies": {
73
- "codsen-utils": "^1.6.19"
73
+ "codsen-utils": "^1.7.0"
74
74
  },
75
75
  "publishConfig": {
76
76
  "registry": "https://registry.npmjs.org/"