string-match-left-right 8.0.10 → 8.0.11

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2010-2021 Roy Revelt and other contributors
3
+ Copyright (c) 2010-2022 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
@@ -26,14 +26,12 @@
26
26
 
27
27
  ## Install
28
28
 
29
- This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required:
29
+ The latest version is **ESM only**: Node 12+ is needed to use it and it must be `import`ed instead of `require`d. If your project is not on ESM yet and you want to use `require`, use an older version of this program, `7.1.0`.
30
30
 
31
31
  ```bash
32
32
  npm i string-match-left-right
33
33
  ```
34
34
 
35
- If you need a legacy version which works with `require`, use version 7.1.0
36
-
37
35
  ## Quick Take
38
36
 
39
37
  ```js
@@ -74,8 +72,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
74
72
 
75
73
  MIT License
76
74
 
77
- Copyright (c) 2010-2021 Roy Revelt and other contributors
78
-
75
+ Copyright (c) 2010-2022 Roy Revelt and other contributors
79
76
 
80
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">
81
-
@@ -1,7 +1,7 @@
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 8.0.10
4
+ * @version 8.0.11
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/string-match-left-right/}
@@ -1,7 +1,7 @@
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 8.0.10
4
+ * @version 8.0.11
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/string-match-left-right/}
@@ -14,7 +14,7 @@ ${JSON.stringify(l,null,4)}`);let u=0,E="";if((r==null?void 0:r.trimCharsBeforeM
14
14
  /**
15
15
  * @name arrayiffy-if-string
16
16
  * @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
17
- * @version 4.0.10
17
+ * @version 4.0.11
18
18
  * @author Roy Revelt, Codsen Ltd
19
19
  * @license MIT
20
20
  * {@link https://codsen.com/os/arrayiffy-if-string/}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "string-match-left-right",
3
- "version": "8.0.10",
3
+ "version": "8.0.11",
4
4
  "description": "Match substrings on the left or right of a given index, ignoring whitespace",
5
5
  "keywords": [
6
6
  "left",
@@ -33,13 +33,15 @@
33
33
  "scripts": {
34
34
  "build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
35
35
  "dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
36
- "dts": "rollup -c",
36
+ "dts": "rollup -c && yarn run prettier 'types/index.d.ts' --write",
37
37
  "examples": "node '../../ops/scripts/run-examples.js'",
38
38
  "lect": "node '../../ops/lect/lect.js'",
39
39
  "letspublish": "yarn publish || :",
40
40
  "lint": "eslint . --fix",
41
41
  "perf": "node perf/check.js",
42
42
  "prepare": "echo 'ready'",
43
+ "prettier": "prettier",
44
+ "prettier:format": "prettier --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern",
43
45
  "pretest": "yarn run lect && yarn run build",
44
46
  "test": "c8 yarn run unit && yarn run examples && yarn run lint",
45
47
  "unit": "uvu test"
@@ -62,9 +64,9 @@
62
64
  }
63
65
  },
64
66
  "dependencies": {
65
- "arrayiffy-if-string": "^4.0.10",
67
+ "arrayiffy-if-string": "^4.0.11",
66
68
  "lodash.isplainobject": "^4.0.6",
67
- "string-character-is-astral-surrogate": "^2.0.10"
69
+ "string-character-is-astral-surrogate": "^2.0.11"
68
70
  },
69
71
  "devDependencies": {
70
72
  "@types/lodash.isplainobject": "^4.0.6"
package/types/index.d.ts CHANGED
@@ -1,16 +1,43 @@
1
1
  interface Opts {
2
- cb: undefined | null | ((wholeCharacterOutside?: string | undefined, theRemainderOfTheString?: string, firstCharOutsideIndex?: number) => string | boolean);
3
- i: boolean;
4
- trimBeforeMatching: boolean;
5
- trimCharsBeforeMatching: string | string[];
6
- maxMismatches: number;
7
- firstMustMatch: boolean;
8
- lastMustMatch: boolean;
9
- hungry: boolean;
2
+ cb:
3
+ | undefined
4
+ | null
5
+ | ((
6
+ wholeCharacterOutside?: string | undefined,
7
+ theRemainderOfTheString?: string,
8
+ firstCharOutsideIndex?: number
9
+ ) => string | boolean);
10
+ i: boolean;
11
+ trimBeforeMatching: boolean;
12
+ trimCharsBeforeMatching: string | string[];
13
+ maxMismatches: number;
14
+ firstMustMatch: boolean;
15
+ lastMustMatch: boolean;
16
+ hungry: boolean;
10
17
  }
11
- declare function matchLeftIncl(str: string, position: number, whatToMatch: (() => string) | string | string[], opts?: Partial<Opts>): boolean | string;
12
- declare function matchLeft(str: string, position: number, whatToMatch: (() => string) | string | string[], opts?: Partial<Opts>): boolean | string;
13
- declare function matchRightIncl(str: string, position: number, whatToMatch: (() => string) | string | string[], opts?: Partial<Opts>): boolean | string;
14
- declare function matchRight(str: string, position: number, whatToMatch: (() => string) | string | string[], opts?: Partial<Opts>): boolean | string;
18
+ declare function matchLeftIncl(
19
+ str: string,
20
+ position: number,
21
+ whatToMatch: (() => string) | string | string[],
22
+ opts?: Partial<Opts>
23
+ ): boolean | string;
24
+ declare function matchLeft(
25
+ str: string,
26
+ position: number,
27
+ whatToMatch: (() => string) | string | string[],
28
+ opts?: Partial<Opts>
29
+ ): boolean | string;
30
+ declare function matchRightIncl(
31
+ str: string,
32
+ position: number,
33
+ whatToMatch: (() => string) | string | string[],
34
+ opts?: Partial<Opts>
35
+ ): boolean | string;
36
+ declare function matchRight(
37
+ str: string,
38
+ position: number,
39
+ whatToMatch: (() => string) | string | string[],
40
+ opts?: Partial<Opts>
41
+ ): boolean | string;
15
42
 
16
43
  export { matchLeft, matchLeftIncl, matchRight, matchRightIncl };