cafe-utility 6.8.1 → 6.9.0

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.
Files changed (3) hide show
  1. package/index.d.ts +1 -1
  2. package/index.js +3 -1
  3. package/package.json +3 -3
package/index.d.ts CHANGED
@@ -130,7 +130,7 @@ declare function isDigit(character: string): boolean;
130
130
  declare function isLetterOrDigit(character: string): boolean;
131
131
  declare function isValidObjectPathCharacter(character: string): boolean;
132
132
  declare function insertString(string: string, index: number, length: number, before: string, after: string): string;
133
- declare function linesMatchOrdered(lines: string[], expectedLines: string[]): boolean;
133
+ declare function linesMatchOrdered(lines: string[], expectedLines: (string | RegExp)[]): boolean;
134
134
  declare function csvEscape(string: string): string;
135
135
  declare function indexOfEarliest(string: string, searchStrings: string[], start?: number): number;
136
136
  declare function findWeightedPair(string: string, start?: number, opening?: string, closing?: string): number;
package/index.js CHANGED
@@ -888,7 +888,9 @@ function linesMatchOrdered(lines, expectedLines) {
888
888
  const expectedLine = expectedLines[i]
889
889
  let found = false
890
890
  while (!found && lineIndex < lines.length) {
891
- if (lines[lineIndex].includes(expectedLine)) {
891
+ if (expectedLine instanceof RegExp) {
892
+ found = expectedLine.test(lines[lineIndex])
893
+ } else if (lines[lineIndex].includes(expectedLine)) {
892
894
  found = true
893
895
  }
894
896
  lineIndex++
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "cafe-utility",
3
- "version": "6.8.1",
3
+ "version": "6.9.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "exports": {
7
7
  ".": {
8
8
  "require": "./index.js",
9
- "default": "./module.mjs",
10
- "types": "./index.d.ts"
9
+ "types": "./index.d.ts",
10
+ "default": "./module.mjs"
11
11
  },
12
12
  "./package.json": "./package.json"
13
13
  },