string-split-by-whitespace 4.0.33 → 4.1.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 ADDED
@@ -0,0 +1 @@
1
+ [{"/home/runner/work/codsen/codsen/packages/string-split-by-whitespace/examples/_quickTake.js":"1","/home/runner/work/codsen/codsen/packages/string-split-by-whitespace/perf/check.js":"2","/home/runner/work/codsen/codsen/packages/string-split-by-whitespace/rollup.config.js":"3","/home/runner/work/codsen/codsen/packages/string-split-by-whitespace/src/main.ts":"4","/home/runner/work/codsen/codsen/packages/string-split-by-whitespace/test/test.js":"5"},{"size":773,"mtime":1760566739156,"results":"6","hashOfConfig":"7"},{"size":414,"mtime":1760566739156,"results":"8","hashOfConfig":"9"},{"size":373,"mtime":1760566739156,"results":"10","hashOfConfig":"7"},{"size":2262,"mtime":1760566739156,"results":"11","hashOfConfig":"9"},{"size":3713,"mtime":1760566739156,"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-split-by-whitespace/examples/_quickTake.js",[],[],"/home/runner/work/codsen/codsen/packages/string-split-by-whitespace/perf/check.js",[],[],"/home/runner/work/codsen/codsen/packages/string-split-by-whitespace/rollup.config.js",[],[],"/home/runner/work/codsen/codsen/packages/string-split-by-whitespace/src/main.ts",[],[],"/home/runner/work/codsen/codsen/packages/string-split-by-whitespace/test/test.js",[],["29","30","31","32","33"],{"ruleId":"34","severity":2,"message":"35","line":3,"column":17,"nodeType":null,"messageId":"36","endLine":3,"endColumn":19,"suppressions":"37"},{"ruleId":"34","severity":2,"message":"38","line":3,"column":21,"nodeType":null,"messageId":"36","endLine":3,"endColumn":23,"suppressions":"39"},{"ruleId":"34","severity":2,"message":"40","line":3,"column":33,"nodeType":null,"messageId":"36","endLine":3,"endColumn":37,"suppressions":"41"},{"ruleId":"34","severity":2,"message":"42","line":3,"column":39,"nodeType":null,"messageId":"36","endLine":3,"endColumn":42,"suppressions":"43"},{"ruleId":"34","severity":2,"message":"44","line":3,"column":44,"nodeType":null,"messageId":"36","endLine":3,"endColumn":49,"suppressions":"45"},"@typescript-eslint/no-unused-vars","'is' is defined but never used.","unusedVar",["46"],"'ok' is defined but never used.",["47"],"'type' is defined but never used.",["48"],"'not' is defined but never used.",["49"],"'match' is defined but never used.",["50"],{"kind":"51","justification":"52"},{"kind":"51","justification":"52"},{"kind":"51","justification":"52"},{"kind":"51","justification":"52"},{"kind":"51","justification":"52"},"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.1.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.0.0 (2022-12-01)
7
13
 
8
14
  ### BREAKING CHANGES
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2010-2025 Roy Revelt and other contributors
3
+ Copyright © 2010-2025 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
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
19
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
20
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
21
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -59,7 +59,7 @@ assert.deepEqual(
59
59
 
60
60
  ## Documentation
61
61
 
62
- Please [visit codsen.com](https://codsen.com/os/string-split-by-whitespace/) for a full description of the API.
62
+ Please [visit codsen.com](https://codsen.com/os/string-split-by-whitespace/) 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-split-by-whitespace/CHANGELOG.md).
63
63
 
64
64
  ## Contributing
65
65
 
@@ -67,8 +67,8 @@ To report bugs or request features or assistance, [raise an issue](https://githu
67
67
 
68
68
  ## Licence
69
69
 
70
- MIT License.
70
+ MIT License
71
71
 
72
- Copyright © 2010-2025 Roy Revelt and other contributors.
72
+ Copyright © 2010-2025 Roy Revelt and other contributors
73
73
 
74
74
  <p align="center"><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"></p>
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @name string-split-by-whitespace
3
3
  * @fileoverview Split string into array by chunks of whitespace
4
- * @version 4.0.33
5
- * @author Roy Revelt, Codsen Ltd
4
+ * @version 4.1.0
5
+ * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/string-split-by-whitespace/}
8
8
  */
9
9
 
10
- import{isIndexWithin as o}from"ranges-is-index-within";var p="4.0.33";var y=p,g={ignoreRanges:[]};function b(t,l){if(t===void 0)throw new Error("string-split-by-whitespace: [THROW_ID_01] The input is missing!");if(typeof t!="string")return t;if(t.trim()==="")return[];let s={...g,...l};if(s.ignoreRanges.length&&!s.ignoreRanges.every(e=>Array.isArray(e)))throw new Error("string-split-by-whitespace: [THROW_ID_03] The resolvedOpts.ignoreRanges contains elements which are not arrays!");let n=null,i=[];for(let e=0,a=t.length;e<a;e++)n===null&&t[e].trim()&&(!s?.ignoreRanges?.length||s.ignoreRanges.length&&!o(e,s.ignoreRanges.map(r=>[r[0],r[1]-1]),{inclusiveRangeEnds:!0}))&&(n=e),n!==null&&(t[e].trim()?s.ignoreRanges.length&&o(e,s.ignoreRanges)?(i.push(t.slice(n,e-1)),n=null):t[e+1]===void 0&&i.push(t.slice(n,e+1)):(i.push(t.slice(n,e)),n=null));return i}export{g as defaults,b as splitByW,y as version};
10
+ import{isIndexWithin as o}from"ranges-is-index-within";var p="4.1.0";var y=p,g={ignoreRanges:[]};function b(t,l){if(t===void 0)throw new Error("string-split-by-whitespace: [THROW_ID_01] The input is missing!");if(typeof t!="string")return t;if(t.trim()==="")return[];let s={...g,...l};if(s.ignoreRanges.length&&!s.ignoreRanges.every(e=>Array.isArray(e)))throw new Error("string-split-by-whitespace: [THROW_ID_03] The resolvedOpts.ignoreRanges contains elements which are not arrays!");let n=null,i=[];for(let e=0,a=t.length;e<a;e++)n===null&&t[e].trim()&&(!s?.ignoreRanges?.length||s.ignoreRanges.length&&!o(e,s.ignoreRanges.map(r=>[r[0],r[1]-1]),{inclusiveRangeEnds:!0}))&&(n=e),n!==null&&(t[e].trim()?s.ignoreRanges.length&&o(e,s.ignoreRanges)?(i.push(t.slice(n,e-1)),n=null):t[e+1]===void 0&&i.push(t.slice(n,e+1)):(i.push(t.slice(n,e)),n=null));return i}export{g as defaults,b as splitByW,y as version};
@@ -1,18 +1,18 @@
1
1
  /**
2
2
  * @name string-split-by-whitespace
3
3
  * @fileoverview Split string into array by chunks of whitespace
4
- * @version 4.0.33
5
- * @author Roy Revelt, Codsen Ltd
4
+ * @version 4.1.0
5
+ * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/string-split-by-whitespace/}
8
8
  */
9
9
 
10
- "use strict";var stringSplitByWhitespace=(()=>{var o=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames,g=Object.getOwnPropertySymbols;var d=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var c=(e,t,n)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,p=(e,t)=>{for(var n in t||(t={}))d.call(t,n)&&c(e,n,t[n]);if(g)for(var n of g(t))b.call(t,n)&&c(e,n,t[n]);return e};var v=(e,t)=>{for(var n in t)o(e,n,{get:t[n],enumerable:!0})},w=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of R(t))!d.call(e,s)&&s!==n&&o(e,s,{get:()=>t[s],enumerable:!(i=y(t,s))||i.enumerable});return e};var x=e=>w(o({},"__esModule",{value:!0}),e);var T={};v(T,{defaults:()=>h,splitByW:()=>O,version:()=>E});var j={inclusiveRangeEnds:!1,returnMatchedRangeInsteadOfTrue:!1};function a(e,t,n){let i=p(p({},j),n);if(!Number.isInteger(e))throw new Error("ranges-is-index-within: [THROW_ID_01] the first input argument should be string index, a natural number (or zero). It was given as ".concat(e," (type ").concat(typeof e,")"));return Array.isArray(t)?i.returnMatchedRangeInsteadOfTrue?t.find(s=>i.inclusiveRangeEnds?e>=s[0]&&e<=s[1]:e>s[0]&&e<s[1])||!1:t.some(s=>i.inclusiveRangeEnds?e>=s[0]&&e<=s[1]:e>s[0]&&e<s[1]):!1}var m="4.0.33";var E=m,h={ignoreRanges:[]};function O(e,t){var l;if(e===void 0)throw new Error("string-split-by-whitespace: [THROW_ID_01] The input is missing!");if(typeof e!="string")return e;if(e.trim()==="")return[];let n=p(p({},h),t);if(n.ignoreRanges.length&&!n.ignoreRanges.every(r=>Array.isArray(r)))throw new Error("string-split-by-whitespace: [THROW_ID_03] The resolvedOpts.ignoreRanges contains elements which are not arrays!");let i=null,s=[];for(let r=0,f=e.length;r<f;r++)i===null&&e[r].trim()&&(!((l=n==null?void 0:n.ignoreRanges)!=null&&l.length)||n.ignoreRanges.length&&!a(r,n.ignoreRanges.map(u=>[u[0],u[1]-1]),{inclusiveRangeEnds:!0}))&&(i=r),i!==null&&(e[r].trim()?n.ignoreRanges.length&&a(r,n.ignoreRanges)?(s.push(e.slice(i,r-1)),i=null):e[r+1]===void 0&&s.push(e.slice(i,r+1)):(s.push(e.slice(i,r)),i=null));return s}return x(T);})();
10
+ "use strict";var stringSplitByWhitespace=(()=>{var p=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols;var d=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var g=(e,t,n)=>t in e?p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,o=(e,t)=>{for(var n in t||(t={}))d.call(t,n)&&g(e,n,t[n]);if(c)for(var n of c(t))b.call(t,n)&&g(e,n,t[n]);return e};var v=(e,t)=>{for(var n in t)p(e,n,{get:t[n],enumerable:!0})},w=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of R(t))!d.call(e,s)&&s!==n&&p(e,s,{get:()=>t[s],enumerable:!(i=y(t,s))||i.enumerable});return e};var x=e=>w(p({},"__esModule",{value:!0}),e);var T={};v(T,{defaults:()=>h,splitByW:()=>O,version:()=>E});var j={inclusiveRangeEnds:!1,returnMatchedRangeInsteadOfTrue:!1};function a(e,t,n){let i=o(o({},j),n);if(!Number.isInteger(e))throw new Error("ranges-is-index-within: [THROW_ID_01] the first input argument should be string index, a natural number (or zero). It was given as ".concat(e," (type ").concat(typeof e,")"));return Array.isArray(t)?i.returnMatchedRangeInsteadOfTrue?t.find(s=>i.inclusiveRangeEnds?e>=s[0]&&e<=s[1]:e>s[0]&&e<s[1])||!1:t.some(s=>i.inclusiveRangeEnds?e>=s[0]&&e<=s[1]:e>s[0]&&e<s[1]):!1}var m="4.1.0";var E=m,h={ignoreRanges:[]};function O(e,t){var l;if(e===void 0)throw new Error("string-split-by-whitespace: [THROW_ID_01] The input is missing!");if(typeof e!="string")return e;if(e.trim()==="")return[];let n=o(o({},h),t);if(n.ignoreRanges.length&&!n.ignoreRanges.every(r=>Array.isArray(r)))throw new Error("string-split-by-whitespace: [THROW_ID_03] The resolvedOpts.ignoreRanges contains elements which are not arrays!");let i=null,s=[];for(let r=0,f=e.length;r<f;r++)i===null&&e[r].trim()&&(!((l=n==null?void 0:n.ignoreRanges)!=null&&l.length)||n.ignoreRanges.length&&!a(r,n.ignoreRanges.map(u=>[u[0],u[1]-1]),{inclusiveRangeEnds:!0}))&&(i=r),i!==null&&(e[r].trim()?n.ignoreRanges.length&&a(r,n.ignoreRanges)?(s.push(e.slice(i,r-1)),i=null):e[r+1]===void 0&&s.push(e.slice(i,r+1)):(s.push(e.slice(i,r)),i=null));return s}return x(T);})();
11
11
  /**
12
12
  * @name ranges-is-index-within
13
13
  * @fileoverview Checks if index is within any of the given string index ranges
14
- * @version 4.0.23
15
- * @author Roy Revelt, Codsen Ltd
14
+ * @version 4.1.0
15
+ * @author Roy Revelt
16
16
  * @license MIT
17
17
  * {@link https://codsen.com/os/ranges-is-index-within/}
18
18
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "string-split-by-whitespace",
3
- "version": "4.0.33",
3
+ "version": "4.1.0",
4
4
  "description": "Split string into array by chunks of whitespace",
5
5
  "keywords": [
6
6
  "alt",
@@ -47,7 +47,7 @@
47
47
  "examples": "node '../../ops/scripts/run-examples.js'",
48
48
  "lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
49
49
  "letspublish": "npm publish --provenance || :",
50
- "lint": "eslint . --fix",
50
+ "lint": "eslint . --fix --concurrency=auto --cache",
51
51
  "perf": "node perf/check.js",
52
52
  "prep": "echo 'ready'",
53
53
  "prettier": "prettier",
@@ -74,10 +74,10 @@
74
74
  }
75
75
  },
76
76
  "dependencies": {
77
- "ranges-is-index-within": "^4.0.23"
77
+ "ranges-is-index-within": "^4.1.0"
78
78
  },
79
79
  "devDependencies": {
80
- "string-find-heads-tails": "^6.0.33"
80
+ "string-find-heads-tails": "^6.1.0"
81
81
  },
82
82
  "publishConfig": {
83
83
  "registry": "https://registry.npmjs.org/"