string-match-left-right 9.1.3 → 9.2.1

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,25 @@
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
- ## 9.1.0 (2025-10-15)
6
+ ## 9.2.0 (2026-08-19)
7
+
8
+ ### Bug Fixes
9
+
10
+ - make validation diagnostics safe ([7b01074](https://github.com/codsen/codsen/commit/7b0107476f12734aeb8e82852ba980b187280110))
11
+ - resolve review findings REV-004 through REV-007 ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
12
+ - retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
13
+ - standardise matcher validation errs ([6f8f858](https://github.com/codsen/codsen/commit/6f8f858104ecd066189d287901f80c94b581d08b))
14
+ - stop case-insensitive matching crashing on a null index ([5682575](https://github.com/codsen/codsen/commit/56825755acdcb8c9f2be089bf13cb24ba032e950))
7
15
 
8
16
  ### Features
9
17
 
10
- - if value to be added is a number, keep it as is, don't stringify ([ce3e1a5](https://github.com/codsen/codsen/commit/ce3e1a525998ca3c0abf0142affef95b14cd1990))
18
+ - add codsen-glob and migrate glob consumers ([5595a2b](https://github.com/codsen/codsen/commit/5595a2b267eaa6cb60072d037aef00b7a28edd42))
19
+ - refresh the tooling and generate with the latest dependencies ([781f802](https://github.com/codsen/codsen/commit/781f802911066a82a4533b0e5a3fcbd742d0dd83))
20
+
21
+ ### Reverts
22
+
23
+ - Revert "Merge pull request #128 from codsen/release/npm-32198404552-1" ([5baeeaa](https://github.com/codsen/codsen/commit/5baeeaaa677b86f1eaa6396cadf3aea32b06416e)), closes [#128](https://github.com/codsen/codsen/issues/128)
24
+ - Revert "Merge pull request #127 from codsen/release/npm-32194020886-1" ([5f1e94d](https://github.com/codsen/codsen/commit/5f1e94deef910ce735266b16aeee08a76de7a862)), closes [#127](https://github.com/codsen/codsen/issues/127)
11
25
 
12
26
  ## 9.0.19 (2024-03-30)
13
27
 
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright © 2010-2025 Roy Revelt and other contributors
3
+ Copyright © 2010-2026 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
package/README.md CHANGED
@@ -32,31 +32,14 @@ npm i string-match-left-right
32
32
  ## Quick Take
33
33
 
34
34
  ```js
35
- import { strict as assert } from "assert";
35
+ import { strict as assert } from "node:assert";
36
36
 
37
- import {
38
- matchLeftIncl,
39
- matchRightIncl,
40
- matchLeft,
41
- matchRight,
42
- } from "string-match-left-right";
37
+ import { matchRight } from "string-match-left-right";
43
38
 
44
- // 3rd character is "d" because indexes start from zero.
45
- // We're checking the string to the left of it, "bcd", inclusive of current character ("d").
46
- // This means, "bcd" has to end with existing character and the other chars to the left
47
- // must match exactly:
48
- assert.equal(matchLeftIncl("abcdefghi", 3, ["bcd"]), "bcd");
49
-
50
- // neither "ab" nor "zz" are to the left of 3rd index, "d":
51
- assert.equal(matchLeft("abcdefghi", 3, ["ab", "zz"]), false);
52
-
53
- // "def" is to the right of 3rd index (including it), "d":
54
- assert.equal(matchRightIncl("abcdefghi", 3, ["def", "zzz"]), "def");
55
-
56
- // One of values, "ef" is exactly to the right of 3rd index, "d":
57
39
  assert.equal(matchRight("abcdefghi", 3, ["ef", "zz"]), "ef");
58
40
  ```
59
41
 
42
+
60
43
  ## Documentation
61
44
 
62
45
  Please [visit codsen.com](https://codsen.com/os/string-match-left-right/) 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-match-left-right/CHANGELOG.md).
@@ -69,6 +52,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
69
52
 
70
53
  MIT License
71
54
 
72
- Copyright © 2010-2025 Roy Revelt and other contributors
55
+ Copyright © 2010-2026 Roy Revelt and other contributors
73
56
 
74
57
  <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,13 +1,13 @@
1
1
  /**
2
2
  * @name string-match-left-right
3
3
  * @fileoverview Match substrings on the left or right of a given index, ignoring whitespace
4
- * @version 9.1.3
4
+ * @version 9.2.1
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/string-match-left-right/}
8
8
  */
9
9
 
10
- import{arrayiffy as N}from"arrayiffy-if-string";import{isPlainObject as R,isStr as d,hasOwnProp as k}from"codsen-utils";var O="9.1.3";var F=O,w={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},L=t=>t+1;function A(t,s,n,a,u=!1,o=L){let l=typeof n=="function"?n():n;if(+s<0&&u&&l==="EOL")return l;let r={...w,...a};if(s>=t.length&&!u)return!1;let c=u?1:n.length,E=0,h=!1,i=!1,m=!1,b=r.maxMismatches,e=s,$=!1,f=!1,g=!1;function D(){return E===1&&b<r.maxMismatches-1}for(;t[e];){let T=o(e);if(r.trimBeforeMatching&&t[e].trim()===""){if(!t[T]&&u&&n==="EOL")return!0;e=o(e);continue}if(r&&!r.i&&r?.trimCharsBeforeMatching?.includes(t[e])||r?.i&&r.trimCharsBeforeMatching&&r.trimCharsBeforeMatching.map(p=>p.toLowerCase()).includes(t[e].toLowerCase())){if(u&&n==="EOL"&&!t[T])return!0;e=o(e);continue}let y=T>e?n[n.length-c]:n[c-1];if(!r.i&&t[e]===y||r.i&&t[e].toLowerCase()===y.toLowerCase()){if($||($=!0),m||(m=!0),c===n.length){if(f=!0,b!==r.maxMismatches)return!1}else c===1&&(g=!0);if(c-=1,E++,D())return!1;if(!c)return E!==n.length||b===r.maxMismatches||!h?e:!1}else if(!h&&!E&&(h=!0),r.maxMismatches&&b&&e){b-=1;for(let p=0;p<=b;p++){let C=T>e?n[n.length-c+1+p]:n[c-2-p],M=t[o(e)];if(C&&(!r.i&&t[e]===C||r.i&&t[e].toLowerCase()===C.toLowerCase())&&(!r.firstMustMatch||c!==n.length)){if(E++,D())return!1;c-=2,$=!0;break}else if(M&&C&&(!r.i&&M===C||r.i&&M.toLowerCase()===C.toLowerCase())&&(!r.firstMustMatch||c!==n.length)){if(!E&&!r.hungry)return!1;c-=1,$=!0;break}else if(C===void 0&&b>=0&&$&&(!r.firstMustMatch||f)&&(!r.lastMustMatch||g))return e}$||(i=e)}else return e===0&&c===1&&!r.lastMustMatch&&m?0:!1;if(i!==!1&&i!==e&&(i=!1),c<1)return e;e=o(e)}if(c>0)return u&&l==="EOL"?!0:r&&r.maxMismatches>=c&&m?i||0:!1}function V(t,s,n,a,u){if(R(u)&&k(u,"trimBeforeMatching")&&u&&typeof u.trimBeforeMatching!="boolean")throw new Error(`string-match-left-right/${t}(): [THROW_ID_09] opts.trimBeforeMatching should be boolean!${Array.isArray(u.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""}`);let o={...w,...u};if(typeof o.trimCharsBeforeMatching=="string"&&(o.trimCharsBeforeMatching=N(o.trimCharsBeforeMatching)),o.trimCharsBeforeMatching=o.trimCharsBeforeMatching.map(h=>d(h)?h:String(h)),!d(s)||!s.length)return!1;if(!Number.isInteger(n)||n<0)throw new Error(`string-match-left-right/${t}(): [THROW_ID_03] the second argument should be a natural number. Currently it's of a type: ${typeof n}, equal to:
11
- ${JSON.stringify(n,null,4)}`);let l,r;if(d(a))l=[a];else if(Array.isArray(a))l=a;else if(!a)l=a;else if(typeof a=="function")l=[],l.push(a);else throw new Error(`string-match-left-right/${t}(): [THROW_ID_05] the third argument, whatToMatch, is neither string nor array of strings! It's ${typeof a}, equal to:
12
- ${JSON.stringify(a,null,4)}`);if(u&&!R(u))throw new Error(`string-match-left-right/${t}(): [THROW_ID_06] the fourth argument, options object, should be a plain object. Currently it's of a type "${typeof u}", and equal to:
13
- ${JSON.stringify(u,null,4)}`);let c=0,E="";if(o?.trimCharsBeforeMatching?.some((h,i)=>h.length>1?(c=i,E=h,!0):!1))throw new Error(`string-match-left-right/${t}(): [THROW_ID_07] the fourth argument, options object contains trimCharsBeforeMatching. It was meant to list the single characters but one of the entries at index ${c} is longer than 1 character, ${E.length} (equals to ${E}). Please split it into separate characters and put into array as separate elements.`);if(!l||!Array.isArray(l)||Array.isArray(l)&&!l.length||Array.isArray(l)&&l.length===1&&d(l[0])&&!l[0].trim()){if(typeof o.cb=="function"){let i,m=n;if((t==="matchLeftIncl"||t==="matchRight")&&(m+=1),t[5]==="L")for(let f=m;f--;){let g=s[f];if((!o.trimBeforeMatching||o.trimBeforeMatching&&g?.trim())&&(!o.trimCharsBeforeMatching?.length||g!==void 0&&!o.trimCharsBeforeMatching.includes(g))){i=f;break}}else if(t.startsWith("matchRight"))for(let f=m;f<s.length;f++){let g=s[f];if((!o.trimBeforeMatching||o.trimBeforeMatching&&g.trim())&&(!o.trimCharsBeforeMatching?.length||!o.trimCharsBeforeMatching.includes(g))){i=f;break}}if(i===void 0)return!1;let b=s[i],e=i+1,$="";return e&&e>0&&($=s.slice(0,e)),t[5]==="L"||i&&i>0&&($=s.slice(i)),o.cb(b,$,i)}let h="";throw u||(h=" More so, the whole options object, the fourth input argument, is missing!"),new Error(`string-match-left-right/${t}(): [THROW_ID_08] the third argument, "whatToMatch", was given as an empty string. This means, you intend to match purely by a callback. The callback was not set though, the opts key "cb" is not set!${h}`)}for(let h=0,i=l.length;h<i;h++){r=typeof l[h]=="function";let m=l[h],b,e,$="",f=n;t==="matchRight"?f+=1:t==="matchLeft"&&(f-=1);let g=A(s,f,m,o,r,D=>t[5]==="L"?D-1:D+1);if(g&&r&&typeof m=="function"&&m()==="EOL")return m()&&(!o.cb||o.cb(b,$,e))?m():!1;if(Number.isInteger(g)&&(e=t.startsWith("matchLeft")?g-1:g+1,t[5]==="L"?$=s.slice(0,g):$=s.slice(e)),e<0&&(e=void 0),s[e]&&(b=s[e]),Number.isInteger(g)&&(!o.cb||o.cb(b,$,e)))return m}return!1}function H(t,s,n,a){return V("matchLeftIncl",t,s,n,a)}function P(t,s,n,a){return V("matchLeft",t,s,n,a)}function j(t,s,n,a){return V("matchRightIncl",t,s,n,a)}function U(t,s,n,a){return V("matchRight",t,s,n,a)}export{L as defaultGetNextIdx,w as defaults,P as matchLeft,H as matchLeftIncl,U as matchRight,j as matchRightIncl,F as version};
10
+ import{arrayiffy as N}from"arrayiffy-if-string";import{formatDiagnosticValue as O,hasOwnProp as L,isPlainObject as R,isStr as T}from"codsen-utils";var w="9.2.1";var H=w,S={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},A=e=>e+1;function I(e,s,n,a,u=!1,r=A){let i=typeof n=="function"?n():n;if(+s<0&&u&&i==="EOL")return i;let o={...S,...a};if(s>=e.length&&!u)return!1;let c=u?1:n.length,E=0,h=!1,l=!1,g=!1,b=o.maxMismatches,t=s,$=!1,f=!1,m=!1;function D(){return E===1&&b<o.maxMismatches-1}for(;e[t];){let p=r(t);if(o.trimBeforeMatching&&e[t].trim()===""){if(!e[p]&&u&&n==="EOL")return!0;t=r(t);continue}if(o&&!o.i&&o?.trimCharsBeforeMatching?.includes(e[t])||o?.i&&o.trimCharsBeforeMatching&&o.trimCharsBeforeMatching.map(d=>d.toLowerCase()).includes(e[t].toLowerCase())){if(u&&n==="EOL"&&!e[p])return!0;t=r(t);continue}let M=p>t?n[n.length-c]:n[c-1];if(!o.i&&e[t]===M||o.i&&M!==void 0&&e[t].toLowerCase()===M.toLowerCase()){if($||($=!0),g||(g=!0),c===n.length){if(f=!0,b!==o.maxMismatches)return!1}else c===1&&(m=!0);if(c-=1,E++,D())return!1;if(!c)return E!==n.length||b===o.maxMismatches||!h?t:!1}else if(!h&&!E&&(h=!0),o.maxMismatches&&b&&t){b-=1;for(let d=0;d<=b;d++){let C=p>t?n[n.length-c+1+d]:n[c-2-d],y=e[r(t)];if(C&&(!o.i&&e[t]===C||o.i&&e[t].toLowerCase()===C.toLowerCase())&&(!o.firstMustMatch||c!==n.length)){if(E++,D())return!1;c-=2,$=!0;break}else if(y&&C&&(!o.i&&y===C||o.i&&y.toLowerCase()===C.toLowerCase())&&(!o.firstMustMatch||c!==n.length)){if(!E&&!o.hungry)return!1;c-=1,$=!0;break}else if(C===void 0&&b>=0&&$&&(!o.firstMustMatch||f)&&(!o.lastMustMatch||m))return t}$||(l=t)}else return t===0&&c===1&&!o.lastMustMatch&&g?0:!1;if(l!==!1&&l!==t&&(l=!1),c<1)return t;t=r(t)}if(c>0)return u&&i==="EOL"?!0:o&&o.maxMismatches>=c&&g?l||0:!1}function V(e,s,n,a,u){if(R(u)&&L(u,"trimBeforeMatching")&&u&&typeof u.trimBeforeMatching!="boolean")throw new Error(`string-match-left-right/${e}(): [THROW_ID_01] opts.trimBeforeMatching should be boolean!${Array.isArray(u.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""}`);let r={...S,...u};if(typeof r.trimCharsBeforeMatching=="string"&&(r.trimCharsBeforeMatching=N(r.trimCharsBeforeMatching)),r.trimCharsBeforeMatching=r.trimCharsBeforeMatching.map(h=>T(h)?h:String(h)),!T(s)||!s.length)return!1;if(!Number.isInteger(n)||n<0)throw new Error(`string-match-left-right/${e}(): [THROW_ID_02] the second argument should be a natural number. Currently it's of a type: ${typeof n}, equal to:
11
+ ${O(n,4)}`);let i,o;if(T(a))i=[a];else if(Array.isArray(a))i=a;else if(!a)i=a;else if(typeof a=="function")i=[],i.push(a);else throw new Error(`string-match-left-right/${e}(): [THROW_ID_03] the third argument, whatToMatch, is neither string nor array of strings! It's ${typeof a}, equal to:
12
+ ${O(a,4)}`);if(u&&!R(u))throw new Error(`string-match-left-right/${e}(): [THROW_ID_04] the fourth argument, options object, should be a plain object. Currently it's of a type "${typeof u}", and equal to:
13
+ ${O(u,4)}`);let c=0,E="";if(r?.trimCharsBeforeMatching?.some((h,l)=>h.length>1?(c=l,E=h,!0):!1))throw new Error(`string-match-left-right/${e}(): [THROW_ID_05] the fourth argument, options object contains trimCharsBeforeMatching. It was meant to list the single characters but one of the entries at index ${c} is longer than 1 character, ${E.length} (equals to ${E}). Please split it into separate characters and put into array as separate elements.`);if(!i||!Array.isArray(i)||Array.isArray(i)&&!i.length||Array.isArray(i)&&i.length===1&&T(i[0])&&!i[0].trim()){if(typeof r.cb=="function"){let l,g=n;if((e==="matchLeftIncl"||e==="matchRight")&&(g+=1),e[5]==="L")for(let f=g;f--;){let m=s[f];if((!r.trimBeforeMatching||r.trimBeforeMatching&&m?.trim())&&(!r.trimCharsBeforeMatching?.length||m!==void 0&&!r.trimCharsBeforeMatching.includes(m))){l=f;break}}else if(e.startsWith("matchRight"))for(let f=g;f<s.length;f++){let m=s[f];if((!r.trimBeforeMatching||r.trimBeforeMatching&&m.trim())&&(!r.trimCharsBeforeMatching?.length||!r.trimCharsBeforeMatching.includes(m))){l=f;break}}if(l===void 0)return!1;let b=s[l],t=l+1,$="";return t&&t>0&&($=s.slice(0,t)),e[5]==="L"||l&&l>0&&($=s.slice(l)),r.cb(b,$,l)}let h="";throw u||(h=" More so, the whole options object, the fourth input argument, is missing!"),new Error(`string-match-left-right/${e}(): [THROW_ID_06] the third argument, "whatToMatch", was given as an empty string. This means, you intend to match purely by a callback. The callback was not set though, the opts key "cb" is not set!${h}`)}for(let h=0,l=i.length;h<l;h++){o=typeof i[h]=="function";let g=i[h],b,t,$="",f=n;e==="matchRight"?f+=1:e==="matchLeft"&&(f-=1);let m=I(s,f,g,r,o,D=>e[5]==="L"?D-1:D+1);if(m&&o&&typeof g=="function"&&g()==="EOL")return g()&&(!r.cb||r.cb(b,$,t))?g():!1;if(Number.isInteger(m)&&(t=e.startsWith("matchLeft")?m-1:m+1,e[5]==="L"?$=s.slice(0,m):$=s.slice(t)),t<0&&(t=void 0),s[t]&&(b=s[t]),Number.isInteger(m)&&(!r.cb||r.cb(b,$,t)))return g}return!1}function j(e,s,n,a){return V("matchLeftIncl",e,s,n,a)}function P(e,s,n,a){return V("matchLeft",e,s,n,a)}function v(e,s,n,a){return V("matchRightIncl",e,s,n,a)}function U(e,s,n,a){return V("matchRight",e,s,n,a)}export{A as defaultGetNextIdx,S as defaults,P as matchLeft,j as matchLeftIncl,U as matchRight,v as matchRightIncl,H as version};
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * @name string-match-left-right
3
3
  * @fileoverview Match substrings on the left or right of a given index, ignoring whitespace
4
- * @version 9.1.3
4
+ * @version 9.2.1
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/string-match-left-right/}
8
8
  */
9
9
 
10
- "use strict";var stringMatchLeftRight=(()=>{var W=Object.create;var w=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames,B=Object.getOwnPropertySymbols,Q=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable;var L=(e,t,n)=>t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,O=(e,t)=>{for(var n in t||(t={}))x.call(t,n)&&L(e,n,t[n]);if(B)for(var n of B(t))Y.call(t,n)&&L(e,n,t[n]);return e};var K=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),G=(e,t)=>{for(var n in t)w(e,n,{get:t[n],enumerable:!0})},I=(e,t,n,h)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of q(t))!x.call(e,c)&&c!==n&&w(e,c,{get:()=>t[c],enumerable:!(h=_(t,c))||h.enumerable});return e};var Z=(e,t,n)=>(n=e!=null?W(Q(e)):{},I(t||!e||!e.__esModule?w(n,"default",{value:e,enumerable:!0}):n,e)),z=e=>I(w({},"__esModule",{value:!0}),e);var F=K((he,J)=>{"use strict";J.exports=X;function V(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function X(e){if(e=e||{},e.circles)return ee(e);let t=new Map;if(t.set(Date,o=>new Date(o)),t.set(Map,(o,s)=>new Map(h(Array.from(o),s))),t.set(Set,(o,s)=>new Set(h(Array.from(o),s))),e.constructorHandlers)for(let o of e.constructorHandlers)t.set(o[0],o[1]);let n=null;return e.proto?u:c;function h(o,s){let r=Object.keys(o),i=new Array(r.length);for(let f=0;f<r.length;f++){let l=r[f],g=o[l];typeof g!="object"||g===null?i[l]=g:g.constructor!==Object&&(n=t.get(g.constructor))?i[l]=n(g,s):ArrayBuffer.isView(g)?i[l]=V(g):i[l]=s(g)}return i}function c(o){if(typeof o!="object"||o===null)return o;if(Array.isArray(o))return h(o,c);if(o.constructor!==Object&&(n=t.get(o.constructor)))return n(o,c);let s={};for(let r in o){if(Object.hasOwnProperty.call(o,r)===!1)continue;let i=o[r];typeof i!="object"||i===null?s[r]=i:i.constructor!==Object&&(n=t.get(i.constructor))?s[r]=n(i,c):ArrayBuffer.isView(i)?s[r]=V(i):s[r]=c(i)}return s}function u(o){if(typeof o!="object"||o===null)return o;if(Array.isArray(o))return h(o,u);if(o.constructor!==Object&&(n=t.get(o.constructor)))return n(o,u);let s={};for(let r in o){let i=o[r];typeof i!="object"||i===null?s[r]=i:i.constructor!==Object&&(n=t.get(i.constructor))?s[r]=n(i,u):ArrayBuffer.isView(i)?s[r]=V(i):s[r]=u(i)}return s}}function ee(e){let t=[],n=[],h=new Map;if(h.set(Date,r=>new Date(r)),h.set(Map,(r,i)=>new Map(u(Array.from(r),i))),h.set(Set,(r,i)=>new Set(u(Array.from(r),i))),e.constructorHandlers)for(let r of e.constructorHandlers)h.set(r[0],r[1]);let c=null;return e.proto?s:o;function u(r,i){let f=Object.keys(r),l=new Array(f.length);for(let g=0;g<f.length;g++){let $=f[g],a=r[$];if(typeof a!="object"||a===null)l[$]=a;else if(a.constructor!==Object&&(c=h.get(a.constructor)))l[$]=c(a,i);else if(ArrayBuffer.isView(a))l[$]=V(a);else{let m=t.indexOf(a);m!==-1?l[$]=n[m]:l[$]=i(a)}}return l}function o(r){if(typeof r!="object"||r===null)return r;if(Array.isArray(r))return u(r,o);if(r.constructor!==Object&&(c=h.get(r.constructor)))return c(r,o);let i={};t.push(r),n.push(i);for(let f in r){if(Object.hasOwnProperty.call(r,f)===!1)continue;let l=r[f];if(typeof l!="object"||l===null)i[f]=l;else if(l.constructor!==Object&&(c=h.get(l.constructor)))i[f]=c(l,o);else if(ArrayBuffer.isView(l))i[f]=V(l);else{let g=t.indexOf(l);g!==-1?i[f]=n[g]:i[f]=o(l)}}return t.pop(),n.pop(),i}function s(r){if(typeof r!="object"||r===null)return r;if(Array.isArray(r))return u(r,s);if(r.constructor!==Object&&(c=h.get(r.constructor)))return c(r,s);let i={};t.push(r),n.push(i);for(let f in r){let l=r[f];if(typeof l!="object"||l===null)i[f]=l;else if(l.constructor!==Object&&(c=h.get(l.constructor)))i[f]=c(l,s);else if(ArrayBuffer.isView(l))i[f]=V(l);else{let g=t.indexOf(l);g!==-1?i[f]=n[g]:i[f]=s(l)}}return t.pop(),n.pop(),i}}});var le={};G(le,{defaultGetNextIdx:()=>U,defaults:()=>k,matchLeft:()=>se,matchLeftIncl:()=>oe,matchRight:()=>ae,matchRightIncl:()=>ie,version:()=>re});function j(e){return typeof e!="string"?e:e.length?[e]:[]}var v=Z(F(),1);var fe=(0,v.default)();function A(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function M(e){return typeof e=="string"}function H(e,t){return A(e)&&M(t)&&t in e}var P="9.1.3";var re=P,k={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},U=e=>e+1;function ne(e,t,n,h,c=!1,u=U){var b;let o=typeof n=="function"?n():n;if(+t<0&&c&&o==="EOL")return o;let s=O(O({},k),h);if(t>=e.length&&!c)return!1;let r=c?1:n.length,i=0,f=!1,l=!1,g=!1,$=s.maxMismatches,a=t,m=!1,d=!1,p=!1;function E(){return i===1&&$<s.maxMismatches-1}for(;e[a];){let y=u(a);if(s.trimBeforeMatching&&e[a].trim()===""){if(!e[y]&&c&&n==="EOL")return!0;a=u(a);continue}if(s&&!s.i&&((b=s==null?void 0:s.trimCharsBeforeMatching)!=null&&b.includes(e[a]))||s!=null&&s.i&&s.trimCharsBeforeMatching&&s.trimCharsBeforeMatching.map(T=>T.toLowerCase()).includes(e[a].toLowerCase())){if(c&&n==="EOL"&&!e[y])return!0;a=u(a);continue}let N=y>a?n[n.length-r]:n[r-1];if(!s.i&&e[a]===N||s.i&&e[a].toLowerCase()===N.toLowerCase()){if(m||(m=!0),g||(g=!0),r===n.length){if(d=!0,$!==s.maxMismatches)return!1}else r===1&&(p=!0);if(r-=1,i++,E())return!1;if(!r)return i!==n.length||$===s.maxMismatches||!f?a:!1}else if(!f&&!i&&(f=!0),s.maxMismatches&&$&&a){$-=1;for(let T=0;T<=$;T++){let D=y>a?n[n.length-r+1+T]:n[r-2-T],R=e[u(a)];if(D&&(!s.i&&e[a]===D||s.i&&e[a].toLowerCase()===D.toLowerCase())&&(!s.firstMustMatch||r!==n.length)){if(i++,E())return!1;r-=2,m=!0;break}else if(R&&D&&(!s.i&&R===D||s.i&&R.toLowerCase()===D.toLowerCase())&&(!s.firstMustMatch||r!==n.length)){if(!i&&!s.hungry)return!1;r-=1,m=!0;break}else if(D===void 0&&$>=0&&m&&(!s.firstMustMatch||d)&&(!s.lastMustMatch||p))return a}m||(l=a)}else return a===0&&r===1&&!s.lastMustMatch&&g?0:!1;if(l!==!1&&l!==a&&(l=!1),r<1)return a;a=u(a)}if(r>0)return c&&o==="EOL"?!0:s&&s.maxMismatches>=r&&g?l||0:!1}function S(e,t,n,h,c){var f,l,g;if(A(c)&&H(c,"trimBeforeMatching")&&c&&typeof c.trimBeforeMatching!="boolean")throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_09] opts.trimBeforeMatching should be boolean!").concat(Array.isArray(c.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""));let u=O(O({},k),c);if(typeof u.trimCharsBeforeMatching=="string"&&(u.trimCharsBeforeMatching=j(u.trimCharsBeforeMatching)),u.trimCharsBeforeMatching=u.trimCharsBeforeMatching.map($=>M($)?$:String($)),!M(t)||!t.length)return!1;if(!Number.isInteger(n)||n<0)throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_03] the second argument should be a natural number. Currently it's of a type: ").concat(typeof n,", equal to:\n").concat(JSON.stringify(n,null,4)));let o,s;if(M(h))o=[h];else if(Array.isArray(h))o=h;else if(!h)o=h;else if(typeof h=="function")o=[],o.push(h);else throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_05] the third argument, whatToMatch, is neither string nor array of strings! It's ").concat(typeof h,", equal to:\n").concat(JSON.stringify(h,null,4)));if(c&&!A(c))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_06] the fourth argument, options object, should be a plain object. Currently it's of a type \"").concat(typeof c,'", and equal to:\n').concat(JSON.stringify(c,null,4)));let r=0,i="";if((f=u==null?void 0:u.trimCharsBeforeMatching)!=null&&f.some(($,a)=>$.length>1?(r=a,i=$,!0):!1))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_07] the fourth argument, options object contains trimCharsBeforeMatching. It was meant to list the single characters but one of the entries at index ").concat(r," is longer than 1 character, ").concat(i.length," (equals to ").concat(i,"). Please split it into separate characters and put into array as separate elements."));if(!o||!Array.isArray(o)||Array.isArray(o)&&!o.length||Array.isArray(o)&&o.length===1&&M(o[0])&&!o[0].trim()){if(typeof u.cb=="function"){let a,m=n;if((e==="matchLeftIncl"||e==="matchRight")&&(m+=1),e[5]==="L")for(let C=m;C--;){let b=t[C];if((!u.trimBeforeMatching||u.trimBeforeMatching&&(b!=null&&b.trim()))&&(!((l=u.trimCharsBeforeMatching)!=null&&l.length)||b!==void 0&&!u.trimCharsBeforeMatching.includes(b))){a=C;break}}else if(e.startsWith("matchRight"))for(let C=m;C<t.length;C++){let b=t[C];if((!u.trimBeforeMatching||u.trimBeforeMatching&&b.trim())&&(!((g=u.trimCharsBeforeMatching)!=null&&g.length)||!u.trimCharsBeforeMatching.includes(b))){a=C;break}}if(a===void 0)return!1;let d=t[a],p=a+1,E="";return p&&p>0&&(E=t.slice(0,p)),e[5]==="L"||a&&a>0&&(E=t.slice(a)),u.cb(d,E,a)}let $="";throw c||($=" More so, the whole options object, the fourth input argument, is missing!"),new Error("string-match-left-right/".concat(e,'(): [THROW_ID_08] the third argument, "whatToMatch", was given as an empty string. This means, you intend to match purely by a callback. The callback was not set though, the opts key "cb" is not set!').concat($))}for(let $=0,a=o.length;$<a;$++){s=typeof o[$]=="function";let m=o[$],d,p,E="",C=n;e==="matchRight"?C+=1:e==="matchLeft"&&(C-=1);let b=ne(t,C,m,u,s,y=>e[5]==="L"?y-1:y+1);if(b&&s&&typeof m=="function"&&m()==="EOL")return m()&&(!u.cb||u.cb(d,E,p))?m():!1;if(Number.isInteger(b)&&(p=e.startsWith("matchLeft")?b-1:b+1,e[5]==="L"?E=t.slice(0,b):E=t.slice(p)),p<0&&(p=void 0),t[p]&&(d=t[p]),Number.isInteger(b)&&(!u.cb||u.cb(d,E,p)))return m}return!1}function oe(e,t,n,h){return S("matchLeftIncl",e,t,n,h)}function se(e,t,n,h){return S("matchLeft",e,t,n,h)}function ie(e,t,n,h){return S("matchRightIncl",e,t,n,h)}function ae(e,t,n,h){return S("matchRight",e,t,n,h)}return z(le);})();
10
+ "use strict";var stringMatchLeftRight=(()=>{var w=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames,L=Object.getOwnPropertySymbols;var B=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var N=(e,r,t)=>r in e?w(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,V=(e,r)=>{for(var t in r||(r={}))B.call(r,t)&&N(e,t,r[t]);if(L)for(var t of L(r))_.call(r,t)&&N(e,t,r[t]);return e};var q=(e,r)=>{for(var t in r)w(e,t,{get:r[t],enumerable:!0})},Q=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of H(r))!B.call(e,a)&&a!==t&&w(e,a,{get:()=>r[a],enumerable:!(o=J(r,a))||o.enumerable});return e};var Y=e=>Q(w({},"__esModule",{value:!0}),e);var ie={};q(ie,{defaultGetNextIdx:()=>U,defaults:()=>x,matchLeft:()=>re,matchLeftIncl:()=>ne,matchRight:()=>se,matchRightIncl:()=>oe,version:()=>ee});function I(e){return typeof e!="string"?e:e.length?[e]:[]}function G(){let e=[],r=0,t=!1;return{append(o){return t?!1:r+o.length>1999?(e.push("\u2026"),r+=1,t=!0,!1):(e.push(o),r+=o.length,!0)},result(){return e.join("")},stopped(){return t}}}function K(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function A(e,r){if(e.append('"')){for(let t=0;t<r.length&&!e.stopped();t+=1){let o=r.charCodeAt(t);o===34?e.append('\\"'):o===92?e.append("\\\\"):o===8?e.append("\\b"):o===9?e.append("\\t"):o===10?e.append("\\n"):o===12?e.append("\\f"):o===13?e.append("\\r"):o<32||o===8232||o===8233||o>=55296&&o<=57343?e.append(K(o)):e.append(r[t])}e.append('"')}}function z(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function W(e,r){e.append("Symbol(");let t=String(r);t.length>8&&A(e,t.slice(7,-1)),e.append(")")}function j(e,r){typeof r=="symbol"?W(e,r):A(e,String(r))}function O(e,r=0){let t=G(),o=r===4?4:0,a=new WeakSet,l=0;function h(n){o&&t.append(" ".repeat(n*o))}function s(n,i){n&&t.append(","),o&&(t.append("\n"),h(i+1))}function m(n,i,$){o&&i&&(t.append("\n"),h($)),t.append(n)}function b(n,i){Object.prototype.hasOwnProperty.call(n,"value")?c(n.value,i):t.append(z(n))}function C(n,i){let $;try{$=Reflect.getOwnPropertyDescriptor(n,"length")}catch(g){t.append("[Uninspectable]");return}let u=$==null?void 0:$.value;if(!Number.isSafeInteger(u)||u<0){t.append("[Uninspectable]");return}t.append("[");let p=!1;for(let g=0;g<u&&!t.stopped();g+=1){if(s(p,i),p=!0,l>=50){t.append("[MaxEntries]");break}l+=1;let f;try{f=Reflect.getOwnPropertyDescriptor(n,String(g))}catch(E){t.append("[Uninspectable]");continue}f!=null&&f.enumerable?b(f,i+1):t.append("[Empty]")}m("]",p,i)}function d(n,i){let $;try{$=Reflect.ownKeys(n)}catch(p){t.append("[Uninspectable]");return}t.append("{");let u=!1;for(let p of $){if(t.stopped())break;if(l>=50){s(u,i),u=!0,A(t,"\u2026"),t.append(o?": ":":"),t.append("[MaxEntries]");break}l+=1;let g;try{g=Reflect.getOwnPropertyDescriptor(n,p)}catch(f){s(u,i),u=!0,j(t,p),t.append(o?": ":":"),t.append("[Uninspectable]");continue}g!=null&&g.enumerable&&(s(u,i),u=!0,j(t,p),t.append(o?": ":":"),b(g,i+1))}m("}",u,i)}function y(n,i){if(a.has(n)){t.append("[Circular]");return}if(i>=5){t.append("[MaxDepth]");return}let $;try{$=Array.isArray(n)}catch(u){t.append("[Uninspectable]");return}a.add(n);try{$?C(n,i):d(n,i)}finally{a.delete(n)}}function c(n,i){n===null?t.append("null"):typeof n=="string"?A(t,n):typeof n=="number"?t.append(Object.is(n,-0)?"-0":String(n)):typeof n=="boolean"?t.append(n?"true":"false"):typeof n>"u"?t.append("undefined"):typeof n=="bigint"?t.append("".concat(n,"n")):typeof n=="symbol"?W(t,n):typeof n=="function"?t.append("[Function]"):y(n,i)}try{return c(e,0),t.result()}catch(n){return"[Uninspectable]"}}var ce=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]),Z=Object.prototype.hasOwnProperty;function S(e){if(e==null||typeof e!="object")return!1;let r=Object.getPrototypeOf(e);return r!==null&&r!==Object.prototype&&Object.getPrototypeOf(r)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function T(e){return typeof e=="string"}function F(e,r){return S(e)&&T(r)&&Z.call(e,r)}var P="9.2.1";var ee=P,x={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},U=e=>e+1;function te(e,r,t,o,a=!1,l=U){var f;let h=typeof t=="function"?t():t;if(+r<0&&a&&h==="EOL")return h;let s=V(V({},x),o);if(r>=e.length&&!a)return!1;let m=a?1:t.length,b=0,C=!1,d=!1,y=!1,c=s.maxMismatches,n=r,i=!1,$=!1,u=!1;function p(){return b===1&&c<s.maxMismatches-1}for(;e[n];){let E=l(n);if(s.trimBeforeMatching&&e[n].trim()===""){if(!e[E]&&a&&t==="EOL")return!0;n=l(n);continue}if(s&&!s.i&&((f=s==null?void 0:s.trimCharsBeforeMatching)!=null&&f.includes(e[n]))||s!=null&&s.i&&s.trimCharsBeforeMatching&&s.trimCharsBeforeMatching.map(M=>M.toLowerCase()).includes(e[n].toLowerCase())){if(a&&t==="EOL"&&!e[E])return!0;n=l(n);continue}let R=E>n?t[t.length-m]:t[m-1];if(!s.i&&e[n]===R||s.i&&R!==void 0&&e[n].toLowerCase()===R.toLowerCase()){if(i||(i=!0),y||(y=!0),m===t.length){if($=!0,c!==s.maxMismatches)return!1}else m===1&&(u=!0);if(m-=1,b++,p())return!1;if(!m)return b!==t.length||c===s.maxMismatches||!C?n:!1}else if(!C&&!b&&(C=!0),s.maxMismatches&&c&&n){c-=1;for(let M=0;M<=c;M++){let D=E>n?t[t.length-m+1+M]:t[m-2-M],v=e[l(n)];if(D&&(!s.i&&e[n]===D||s.i&&e[n].toLowerCase()===D.toLowerCase())&&(!s.firstMustMatch||m!==t.length)){if(b++,p())return!1;m-=2,i=!0;break}else if(v&&D&&(!s.i&&v===D||s.i&&v.toLowerCase()===D.toLowerCase())&&(!s.firstMustMatch||m!==t.length)){if(!b&&!s.hungry)return!1;m-=1,i=!0;break}else if(D===void 0&&c>=0&&i&&(!s.firstMustMatch||$)&&(!s.lastMustMatch||u))return n}i||(d=n)}else return n===0&&m===1&&!s.lastMustMatch&&y?0:!1;if(d!==!1&&d!==n&&(d=!1),m<1)return n;n=l(n)}if(m>0)return a&&h==="EOL"?!0:s&&s.maxMismatches>=m&&y?d||0:!1}function k(e,r,t,o,a){var C,d,y;if(S(a)&&F(a,"trimBeforeMatching")&&a&&typeof a.trimBeforeMatching!="boolean")throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_01] opts.trimBeforeMatching should be boolean!").concat(Array.isArray(a.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""));let l=V(V({},x),a);if(typeof l.trimCharsBeforeMatching=="string"&&(l.trimCharsBeforeMatching=I(l.trimCharsBeforeMatching)),l.trimCharsBeforeMatching=l.trimCharsBeforeMatching.map(c=>T(c)?c:String(c)),!T(r)||!r.length)return!1;if(!Number.isInteger(t)||t<0)throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_02] the second argument should be a natural number. Currently it's of a type: ").concat(typeof t,", equal to:\n").concat(O(t,4)));let h,s;if(T(o))h=[o];else if(Array.isArray(o))h=o;else if(!o)h=o;else if(typeof o=="function")h=[],h.push(o);else throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_03] the third argument, whatToMatch, is neither string nor array of strings! It's ").concat(typeof o,", equal to:\n").concat(O(o,4)));if(a&&!S(a))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_04] the fourth argument, options object, should be a plain object. Currently it's of a type \"").concat(typeof a,'", and equal to:\n').concat(O(a,4)));let m=0,b="";if((C=l==null?void 0:l.trimCharsBeforeMatching)!=null&&C.some((c,n)=>c.length>1?(m=n,b=c,!0):!1))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_05] the fourth argument, options object contains trimCharsBeforeMatching. It was meant to list the single characters but one of the entries at index ").concat(m," is longer than 1 character, ").concat(b.length," (equals to ").concat(b,"). Please split it into separate characters and put into array as separate elements."));if(!h||!Array.isArray(h)||Array.isArray(h)&&!h.length||Array.isArray(h)&&h.length===1&&T(h[0])&&!h[0].trim()){if(typeof l.cb=="function"){let n,i=t;if((e==="matchLeftIncl"||e==="matchRight")&&(i+=1),e[5]==="L")for(let g=i;g--;){let f=r[g];if((!l.trimBeforeMatching||l.trimBeforeMatching&&(f!=null&&f.trim()))&&(!((d=l.trimCharsBeforeMatching)!=null&&d.length)||f!==void 0&&!l.trimCharsBeforeMatching.includes(f))){n=g;break}}else if(e.startsWith("matchRight"))for(let g=i;g<r.length;g++){let f=r[g];if((!l.trimBeforeMatching||l.trimBeforeMatching&&f.trim())&&(!((y=l.trimCharsBeforeMatching)!=null&&y.length)||!l.trimCharsBeforeMatching.includes(f))){n=g;break}}if(n===void 0)return!1;let $=r[n],u=n+1,p="";return u&&u>0&&(p=r.slice(0,u)),e[5]==="L"||n&&n>0&&(p=r.slice(n)),l.cb($,p,n)}let c="";throw a||(c=" More so, the whole options object, the fourth input argument, is missing!"),new Error("string-match-left-right/".concat(e,'(): [THROW_ID_06] the third argument, "whatToMatch", was given as an empty string. This means, you intend to match purely by a callback. The callback was not set though, the opts key "cb" is not set!').concat(c))}for(let c=0,n=h.length;c<n;c++){s=typeof h[c]=="function";let i=h[c],$,u,p="",g=t;e==="matchRight"?g+=1:e==="matchLeft"&&(g-=1);let f=te(r,g,i,l,s,E=>e[5]==="L"?E-1:E+1);if(f&&s&&typeof i=="function"&&i()==="EOL")return i()&&(!l.cb||l.cb($,p,u))?i():!1;if(Number.isInteger(f)&&(u=e.startsWith("matchLeft")?f-1:f+1,e[5]==="L"?p=r.slice(0,f):p=r.slice(u)),u<0&&(u=void 0),r[u]&&($=r[u]),Number.isInteger(f)&&(!l.cb||l.cb($,p,u)))return i}return!1}function ne(e,r,t,o){return k("matchLeftIncl",e,r,t,o)}function re(e,r,t,o){return k("matchLeft",e,r,t,o)}function oe(e,r,t,o){return k("matchRightIncl",e,r,t,o)}function se(e,r,t,o){return k("matchRight",e,r,t,o)}return Y(ie);})();
11
11
  /**
12
12
  * @name arrayiffy-if-string
13
13
  * @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
14
- * @version 5.1.3
14
+ * @version 5.2.1
15
15
  * @author Roy Revelt
16
16
  * @license MIT
17
17
  * {@link https://codsen.com/os/arrayiffy-if-string/}
@@ -19,7 +19,7 @@
19
19
  /**
20
20
  * @name codsen-utils
21
21
  * @fileoverview Various utility functions
22
- * @version 1.7.3
22
+ * @version 1.8.0
23
23
  * @author Roy Revelt
24
24
  * @license MIT
25
25
  * {@link https://codsen.com/os/codsen-utils/}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "string-match-left-right",
3
- "version": "9.1.3",
3
+ "version": "9.2.1",
4
4
  "description": "Match substrings on the left or right of a given index, ignoring whitespace",
5
5
  "keywords": [
6
6
  "left",
@@ -32,45 +32,43 @@
32
32
  },
33
33
  "types": "types/index.d.ts",
34
34
  "scripts": {
35
- "build": "node '../../ops/scripts/esbuild.js' && npm run dts",
36
- "cjs-off": "exit 0",
37
- "cjs-on": "exit 0",
38
- "dev": "DEV=true node '../../ops/scripts/esbuild.js' && npm run dts",
35
+ "build": "node ../../ops/scripts/esbuild.js && npm run dts",
36
+ "coverage": "c8 uvu test",
37
+ "dev": "node ../../ops/scripts/esbuild.js --dev && npm run dts",
39
38
  "devtest": "c8 npm run unit && npm run examples && npm run lint",
40
- "dts": "rollup -c && npm run prettier -- 'types/index.d.ts' --write --log-level 'silent'",
39
+ "dts": "rollup -c && biome format --write --config-path=../../biome.json --vcs-enabled=false --use-editorconfig=false types/index.d.ts",
41
40
  "examples": "node '../../ops/scripts/run-examples.js'",
42
- "lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
43
- "letspublish": "npm publish --provenance || :",
44
- "lint": "eslint . --fix --concurrency=auto --cache",
41
+ "lect": "node '../../ops/lect/lect.js'",
42
+ "lect:check": "node '../../ops/lect/lect.js' --check",
43
+ "lint": "biome lint --error-on-warnings . && npm run typecheck",
44
+ "lint:fix": "biome lint --write --error-on-warnings . && npm run typecheck",
45
45
  "perf": "node perf/check.js",
46
46
  "prep": "echo 'ready'",
47
- "prettier": "prettier",
48
- "prettier:format": "npm run prettier -- --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern --log-level 'silent'",
49
- "pretest": "npm run lect && npm run build",
47
+ "prettier": "biome format",
48
+ "prettier:format": "biome format --write .",
49
+ "pretest": "npm run lect:check && npm run build",
50
50
  "test": "npm run devtest",
51
+ "typecheck": "tsc --noEmit --pretty false --project tsconfig.json",
51
52
  "unit": "uvu test"
52
53
  },
53
- "engines": {
54
- "node": ">=14.18.0"
55
- },
56
54
  "c8": {
55
+ "all": true,
57
56
  "check-coverage": true,
58
- "exclude": [
59
- "**/test/**/*.*"
60
- ],
57
+ "exclude": ["**/test/**/*.*"],
58
+ "include": ["dist/*.esm.js"],
61
59
  "lines": 100
62
60
  },
63
61
  "lect": {
64
62
  "licence": {
65
- "extras": [
66
- ""
67
- ]
63
+ "extras": [""]
68
64
  }
69
65
  },
70
66
  "dependencies": {
71
- "arrayiffy-if-string": "^5.1.3",
72
- "codsen-utils": "^1.7.3",
73
- "string-character-is-astral-surrogate": "^3.1.3"
67
+ "arrayiffy-if-string": "^5.2.1",
68
+ "codsen-utils": "^1.8.0"
69
+ },
70
+ "engines": {
71
+ "node": ">=18.20.8"
74
72
  },
75
73
  "publishConfig": {
76
74
  "registry": "https://registry.npmjs.org/"