string-split-by-whitespace 4.2.1 → 4.2.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,11 +3,17 @@
|
|
|
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.2 (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.2.0 (2026-08-19)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
|
9
15
|
|
|
10
|
-
- resolve review findings
|
|
16
|
+
- resolve various review findings ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
|
|
11
17
|
- retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
|
|
12
18
|
- standardise whitespace splitting errs ([ff79fd8](https://github.com/codsen/codsen/commit/ff79fd897daeae0ac857dc4dca41caccb1bd60ce))
|
|
13
19
|
|
|
@@ -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.2.
|
|
4
|
+
* @version 4.2.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 p}from"ranges-is-index-within";var o="4.2.
|
|
10
|
+
import{isIndexWithin as p}from"ranges-is-index-within";var o="4.2.3";var h=o,g={ignoreRanges:[]};function y(t,l){if(t===void 0)throw new Error("string-split-by-whitespace/splitByW(): [THROW_ID_01] The input is missing!");if(typeof t!="string")return t;if(t.trim()==="")return[];let n={...g,...l};if(n.ignoreRanges.length&&!n.ignoreRanges.every(e=>Array.isArray(e)))throw new Error("string-split-by-whitespace/splitByW(): [THROW_ID_02] The resolvedOpts.ignoreRanges contains elements which are not arrays!");let s=null,i=[];for(let e=0,c=t.length;e<c;e++)s===null&&t[e].trim()&&(!n?.ignoreRanges?.length||n.ignoreRanges.length&&!p(e,n.ignoreRanges.map(r=>[r[0],r[1]-1]),{inclusiveRangeEnds:!0}))&&(s=e),s!==null&&(t[e].trim()?n.ignoreRanges.length&&p(e,n.ignoreRanges)?(i.push(t.slice(s,e-1)),s=null):t[e+1]===void 0&&i.push(t.slice(s,e+1)):(i.push(t.slice(s,e)),s=null));return i}export{g as defaults,y as splitByW,h as version};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name string-split-by-whitespace
|
|
3
3
|
* @fileoverview Split string into array by chunks of whitespace
|
|
4
|
-
* @version 4.2.
|
|
4
|
+
* @version 4.2.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 l=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols;var m=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var d=(e,n,t)=>n in e?l(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,c=(e,n)=>{for(var t in n||(n={}))m.call(n,t)&&d(e,t,n[t]);if(u)for(var t of u(n))w.call(n,t)&&d(e,t,n[t]);return e};var v=(e,n)=>{for(var t in n)l(e,t,{get:n[t],enumerable:!0})},R=(e,n,t,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of b(n))!m.call(e,r)&&r!==t&&l(e,r,{get:()=>n[r],enumerable:!(i=y(n,r))||i.enumerable});return e};var x=e=>R(l({},"__esModule",{value:!0}),e);var T={};v(T,{defaults:()=>f,splitByW:()=>I,version:()=>k});function g(e,n,t){var p,s;if(!Number.isInteger(e)||e<0)throw new TypeError("ranges-is-index-within/isIndexWithin(): [THROW_ID_01] The first input argument should be a string index: a natural number or zero. It was ".concat(e," (type ").concat(typeof e,")."));if(!Array.isArray(n))return!1;let i=(p=t==null?void 0:t.inclusiveRangeEnds)!=null?p:!1,r=(s=t==null?void 0:t.returnMatchedRangeInsteadOfTrue)!=null?s:!1;for(let a=0;a<n.length;a++){let o=n[a];if(i?e>=o[0]&&e<=o[1]:e>o[0]&&e<o[1])return r?o:!0}return!1}var h="4.2.
|
|
10
|
+
"use strict";var stringSplitByWhitespace=(()=>{var l=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols;var m=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var d=(e,n,t)=>n in e?l(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,c=(e,n)=>{for(var t in n||(n={}))m.call(n,t)&&d(e,t,n[t]);if(u)for(var t of u(n))w.call(n,t)&&d(e,t,n[t]);return e};var v=(e,n)=>{for(var t in n)l(e,t,{get:n[t],enumerable:!0})},R=(e,n,t,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of b(n))!m.call(e,r)&&r!==t&&l(e,r,{get:()=>n[r],enumerable:!(i=y(n,r))||i.enumerable});return e};var x=e=>R(l({},"__esModule",{value:!0}),e);var T={};v(T,{defaults:()=>f,splitByW:()=>I,version:()=>k});function g(e,n,t){var p,s;if(!Number.isInteger(e)||e<0)throw new TypeError("ranges-is-index-within/isIndexWithin(): [THROW_ID_01] The first input argument should be a string index: a natural number or zero. It was ".concat(e," (type ").concat(typeof e,")."));if(!Array.isArray(n))return!1;let i=(p=t==null?void 0:t.inclusiveRangeEnds)!=null?p:!1,r=(s=t==null?void 0:t.returnMatchedRangeInsteadOfTrue)!=null?s:!1;for(let a=0;a<n.length;a++){let o=n[a];if(i?e>=o[0]&&e<=o[1]:e>o[0]&&e<o[1])return r?o:!0}return!1}var h="4.2.3";var k=h,f={ignoreRanges:[]};function I(e,n){var p;if(e===void 0)throw new Error("string-split-by-whitespace/splitByW(): [THROW_ID_01] The input is missing!");if(typeof e!="string")return e;if(e.trim()==="")return[];let t=c(c({},f),n);if(t.ignoreRanges.length&&!t.ignoreRanges.every(s=>Array.isArray(s)))throw new Error("string-split-by-whitespace/splitByW(): [THROW_ID_02] The resolvedOpts.ignoreRanges contains elements which are not arrays!");let i=null,r=[];for(let s=0,a=e.length;s<a;s++)i===null&&e[s].trim()&&(!((p=t==null?void 0:t.ignoreRanges)!=null&&p.length)||t.ignoreRanges.length&&!g(s,t.ignoreRanges.map(o=>[o[0],o[1]-1]),{inclusiveRangeEnds:!0}))&&(i=s),i!==null&&(e[s].trim()?t.ignoreRanges.length&&g(s,t.ignoreRanges)?(r.push(e.slice(i,s-1)),i=null):e[s+1]===void 0&&r.push(e.slice(i,s+1)):(r.push(e.slice(i,s)),i=null));return r}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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "string-split-by-whitespace",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.3",
|
|
4
4
|
"description": "Split string into array by chunks of whitespace",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"alt",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"ranges-is-index-within": "^4.2.0"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"string-find-heads-tails": "^6.2.
|
|
76
|
+
"string-find-heads-tails": "^6.2.3"
|
|
77
77
|
},
|
|
78
78
|
"engines": {
|
|
79
79
|
"node": ">=18.20.8"
|