string-split-by-whitespace 3.2.5 → 3.2.7

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/README.md CHANGED
@@ -1,28 +1,25 @@
1
- # string-split-by-whitespace
1
+ <h1 align="center">string-split-by-whitespace</h1>
2
2
 
3
- > Split string into array by chunks of whitespace
3
+ <p align="center">Split string into array by chunks of whitespace</p>
4
4
 
5
- <div class="package-badges">
6
- <a href="https://www.npmjs.com/package/string-split-by-whitespace" rel="nofollow noreferrer noopener">
7
- <img src="https://img.shields.io/badge/-npm-blue?style=flat-square" alt="page on npm">
8
- </a>
5
+ <p align="center">
9
6
  <a href="https://codsen.com/os/string-split-by-whitespace" rel="nofollow noreferrer noopener">
10
7
  <img src="https://img.shields.io/badge/-codsen-blue?style=flat-square" alt="page on codsen.com">
11
8
  </a>
9
+ <a href="https://www.npmjs.com/package/string-split-by-whitespace" rel="nofollow noreferrer noopener">
10
+ <img src="https://img.shields.io/badge/-npm-blue?style=flat-square" alt="page on npm">
11
+ </a>
12
12
  <a href="https://github.com/codsen/codsen/tree/main/packages/string-split-by-whitespace" rel="nofollow noreferrer noopener">
13
13
  <img src="https://img.shields.io/badge/-github-blue?style=flat-square" alt="page on github">
14
14
  </a>
15
15
  <a href="https://npmcharts.com/compare/string-split-by-whitespace?interval=30" rel="nofollow noreferrer noopener" target="_blank">
16
16
  <img src="https://img.shields.io/npm/dm/string-split-by-whitespace.svg?style=flat-square" alt="Downloads per month">
17
17
  </a>
18
- <a href="https://prettier.io" rel="nofollow noreferrer noopener" target="_blank">
19
- <img src="https://img.shields.io/badge/code_style-prettier-brightgreen.svg?style=flat-square" alt="Code style: prettier">
20
- </a>
21
- <img src="https://img.shields.io/badge/licence-MIT-brightgreen.svg?style=flat-square" alt="MIT License">
22
- <a href="https://liberamanifesto.com" rel="nofollow noreferrer noopener" target="_blank">
23
- <img src="https://img.shields.io/badge/libera-manifesto-lightgrey.svg?style=flat-square" alt="libera manifesto">
18
+ <a href="https://codsen.com/os/string-split-by-whitespace/changelog" rel="nofollow noreferrer noopener">
19
+ <img src="https://img.shields.io/badge/changelog-here-brightgreen?style=flat-square" alt="changelog">
24
20
  </a>
25
- </div>
21
+ <img src="https://img.shields.io/badge/licence-MIT-brightgreen.svg?style=flat-square" alt="MIT Licence">
22
+ </p>
26
23
 
27
24
  ## Install
28
25
 
@@ -70,8 +67,8 @@ To report bugs or request features or assistance, [raise an issue](https://githu
70
67
 
71
68
  ## Licence
72
69
 
73
- MIT License
70
+ MIT License.
74
71
 
75
- Copyright (c) 2010-2022 Roy Revelt and other contributors
72
+ Copyright © 2010-2022 Roy Revelt and other contributors.
76
73
 
77
- <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">
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 3.2.5
4
+ * @version 3.2.7
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/string-split-by-whitespace/}
8
8
  */
9
9
 
10
- import{isIndexWithin as a}from"ranges-is-index-within";var o="3.2.5";var f=o,u={ignoreRanges:[]};function R(t,p){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 n={...u,...p};if(n.ignoreRanges.length&&!n.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 s=null,r=[];for(let e=0,l=t.length;e<l;e++)s===null&&t[e].trim()&&(!n||!n.ignoreRanges||!n.ignoreRanges.length||n.ignoreRanges.length&&!a(e,n.ignoreRanges.map(i=>[i[0],i[1]-1]),{inclusiveRangeEnds:!0}))&&(s=e),s!==null&&(t[e].trim()?n.ignoreRanges.length&&a(e,n.ignoreRanges)?(r.push(t.slice(s,e-1)),s=null):t[e+1]===void 0&&r.push(t.slice(s,e+1)):(r.push(t.slice(s,e)),s=null));return r}export{u as defaults,R as splitByW,f as version};
10
+ import{isIndexWithin as a}from"ranges-is-index-within";var o="3.2.7";var f=o,u={ignoreRanges:[]};function R(t,p){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 n={...u,...p};if(n.ignoreRanges.length&&!n.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 s=null,r=[];for(let e=0,l=t.length;e<l;e++)s===null&&t[e].trim()&&(!n||!n.ignoreRanges||!n.ignoreRanges.length||n.ignoreRanges.length&&!a(e,n.ignoreRanges.map(i=>[i[0],i[1]-1]),{inclusiveRangeEnds:!0}))&&(s=e),s!==null&&(t[e].trim()?n.ignoreRanges.length&&a(e,n.ignoreRanges)?(r.push(t.slice(s,e-1)),s=null):t[e+1]===void 0&&r.push(t.slice(s,e+1)):(r.push(t.slice(s,e)),s=null));return r}export{u as defaults,R as splitByW,f 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 3.2.5
4
+ * @version 3.2.7
5
5
  * @author Roy Revelt, Codsen Ltd
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 m=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols;var c=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var d=(e,t,n)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,a=(e,t)=>{for(var n in t||(t={}))c.call(t,n)&&d(e,n,t[n]);if(u)for(var n of u(t))R.call(t,n)&&d(e,n,t[n]);return e};var b=(e,t)=>{for(var n in t)o(e,n,{get:t[n],enumerable:!0})},v=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of f(t))!c.call(e,r)&&r!==n&&o(e,r,{get:()=>t[r],enumerable:!(s=m(t,r))||s.enumerable});return e};var w=e=>v(o({},"__esModule",{value:!0}),e);var j={};b(j,{defaults:()=>h,splitByW:()=>E,version:()=>O});var x={inclusiveRangeEnds:!1,returnMatchedRangeInsteadOfTrue:!1};function l(e,t,n){let s=a(a({},x),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 ${e} (type ${typeof e})`);return Array.isArray(t)?s.returnMatchedRangeInsteadOfTrue?t.find(r=>s.inclusiveRangeEnds?e>=r[0]&&e<=r[1]:e>r[0]&&e<r[1])||!1:t.some(r=>s.inclusiveRangeEnds?e>=r[0]&&e<=r[1]:e>r[0]&&e<r[1]):!1}var g="3.2.5";var O=g,h={ignoreRanges:[]};function E(e,t){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=a(a({},h),t);if(n.ignoreRanges.length&&!n.ignoreRanges.every(i=>Array.isArray(i)))throw new Error("string-split-by-whitespace: [THROW_ID_03] The resolvedOpts.ignoreRanges contains elements which are not arrays!");let s=null,r=[];for(let i=0,y=e.length;i<y;i++)s===null&&e[i].trim()&&(!n||!n.ignoreRanges||!n.ignoreRanges.length||n.ignoreRanges.length&&!l(i,n.ignoreRanges.map(p=>[p[0],p[1]-1]),{inclusiveRangeEnds:!0}))&&(s=i),s!==null&&(e[i].trim()?n.ignoreRanges.length&&l(i,n.ignoreRanges)?(r.push(e.slice(s,i-1)),s=null):e[i+1]===void 0&&r.push(e.slice(s,i+1)):(r.push(e.slice(s,i)),s=null));return r}return w(j);})();
10
+ "use strict";var stringSplitByWhitespace=(()=>{var o=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols;var d=Object.prototype.hasOwnProperty,R=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,a=(e,t)=>{for(var n in t||(t={}))d.call(t,n)&&c(e,n,t[n]);if(u)for(var n of u(t))R.call(t,n)&&c(e,n,t[n]);return e};var b=(e,t)=>{for(var n in t)o(e,n,{get:t[n],enumerable:!0})},x=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of f(t))!d.call(e,s)&&s!==n&&o(e,s,{get:()=>t[s],enumerable:!(r=m(t,s))||r.enumerable});return e};var v=e=>x(o({},"__esModule",{value:!0}),e);var E={};b(E,{defaults:()=>h,splitByW:()=>O,version:()=>I});var w={inclusiveRangeEnds:!1,returnMatchedRangeInsteadOfTrue:!1};function l(e,t,n){let r=a(a({},w),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 ${e} (type ${typeof e})`);return Array.isArray(t)?r.returnMatchedRangeInsteadOfTrue?t.find(s=>r.inclusiveRangeEnds?e>=s[0]&&e<=s[1]:e>s[0]&&e<s[1])||!1:t.some(s=>r.inclusiveRangeEnds?e>=s[0]&&e<=s[1]:e>s[0]&&e<s[1]):!1}var g="3.2.7";var I=g,h={ignoreRanges:[]};function O(e,t){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=a(a({},h),t);if(n.ignoreRanges.length&&!n.ignoreRanges.every(i=>Array.isArray(i)))throw new Error("string-split-by-whitespace: [THROW_ID_03] The resolvedOpts.ignoreRanges contains elements which are not arrays!");let r=null,s=[];for(let i=0,y=e.length;i<y;i++)r===null&&e[i].trim()&&(!n||!n.ignoreRanges||!n.ignoreRanges.length||n.ignoreRanges.length&&!l(i,n.ignoreRanges.map(p=>[p[0],p[1]-1]),{inclusiveRangeEnds:!0}))&&(r=i),r!==null&&(e[i].trim()?n.ignoreRanges.length&&l(i,n.ignoreRanges)?(s.push(e.slice(r,i-1)),r=null):e[i+1]===void 0&&s.push(e.slice(r,i+1)):(s.push(e.slice(r,i)),r=null));return s}return v(E);})();
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 3.2.4
14
+ * @version 3.2.6
15
15
  * @author Roy Revelt, Codsen Ltd
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": "3.2.5",
3
+ "version": "3.2.7",
4
4
  "description": "Split string into array by chunks of whitespace",
5
5
  "keywords": [
6
6
  "alt",
@@ -39,6 +39,8 @@
39
39
  "types": "types/index.d.ts",
40
40
  "scripts": {
41
41
  "build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
42
+ "cjs-off": "exit 0",
43
+ "cjs-on": "exit 0",
42
44
  "dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
43
45
  "devtest": "c8 yarn run unit && yarn run examples && yarn run lint",
44
46
  "dts": "rollup -c && yarn run prettier 'types/index.d.ts' --write",
@@ -72,9 +74,9 @@
72
74
  }
73
75
  },
74
76
  "dependencies": {
75
- "ranges-is-index-within": "^3.2.4"
77
+ "ranges-is-index-within": "^3.2.6"
76
78
  },
77
79
  "devDependencies": {
78
- "string-find-heads-tails": "^5.1.5"
80
+ "string-find-heads-tails": "^5.1.7"
79
81
  }
80
82
  }