string-split-by-whitespace 4.0.34 → 4.1.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,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/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
 
@@ -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.34
4
+ * @version 4.1.3
5
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.34";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.3";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,17 +1,17 @@
1
1
  /**
2
2
  * @name string-split-by-whitespace
3
3
  * @fileoverview Split string into array by chunks of whitespace
4
- * @version 4.0.34
4
+ * @version 4.1.3
5
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 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.0.34";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);})();
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.3";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.24
14
+ * @version 4.1.3
15
15
  * @author Roy Revelt
16
16
  * @license MIT
17
17
  * {@link https://codsen.com/os/ranges-is-index-within/}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "string-split-by-whitespace",
3
- "version": "4.0.34",
3
+ "version": "4.1.3",
4
4
  "description": "Split string into array by chunks of whitespace",
5
5
  "keywords": [
6
6
  "alt",
@@ -74,10 +74,10 @@
74
74
  }
75
75
  },
76
76
  "dependencies": {
77
- "ranges-is-index-within": "^4.0.24"
77
+ "ranges-is-index-within": "^4.1.3"
78
78
  },
79
79
  "devDependencies": {
80
- "string-find-heads-tails": "^6.0.34"
80
+ "string-find-heads-tails": "^6.1.3"
81
81
  },
82
82
  "publishConfig": {
83
83
  "registry": "https://registry.npmjs.org/"
package/.eslintcache DELETED
@@ -1 +0,0 @@
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":1760280945974,"results":"6","hashOfConfig":"7"},{"size":414,"mtime":1760280945974,"results":"8","hashOfConfig":"9"},{"size":373,"mtime":1760280945975,"results":"10","hashOfConfig":"7"},{"size":2262,"mtime":1760280945975,"results":"11","hashOfConfig":"9"},{"size":3713,"mtime":1760280945975,"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-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",""]