@allurereport/reader 3.0.0-beta.17 → 3.0.0-beta.19

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.
@@ -19,6 +19,7 @@ necessary (the path to Xcode's Developer directory might be different on your ma
19
19
 
20
20
  The original error that led to this message is shown below.
21
21
  `;
22
+ const MDLS_CONTENT_TYPE_PATTERN = /\s*"(?<uti>[^"]+)"/;
22
23
  const bundleInfoFilePaths = new Set([
23
24
  "Info.plist",
24
25
  "Contents/Info.plist",
@@ -34,18 +35,23 @@ export const isXcResultBundle = async (directory) => {
34
35
  };
35
36
  export const checkUniformTypeIdentifier = async (itemPath, uti) => {
36
37
  const mdlsArgs = ["-raw", "-attr", "kMDItemContentTypeTree", itemPath];
37
- const stringToSearch = `"${uti}"`;
38
+ let contentTypeTreeAvailable = false;
38
39
  try {
39
- for await (const line of invokeStdoutCliTool("mdls", mdlsArgs)) {
40
- if (line.indexOf(stringToSearch) !== -1) {
41
- return true;
40
+ for await (const line of invokeStdoutCliTool("mdls", mdlsArgs, { encoding: "utf-8" })) {
41
+ const match = MDLS_CONTENT_TYPE_PATTERN.exec(line);
42
+ if (match) {
43
+ contentTypeTreeAvailable = true;
44
+ const [, matchedUti] = match;
45
+ if (matchedUti === uti) {
46
+ return true;
47
+ }
42
48
  }
43
49
  }
44
50
  }
45
51
  catch {
46
52
  return undefined;
47
53
  }
48
- return false;
54
+ return contentTypeTreeAvailable ? false : undefined;
49
55
  };
50
56
  export const isMostProbablyXcResultBundle = async (directory) => isDefined(await findBundleInfoFile(directory)) || followsXcResultNaming(directory);
51
57
  export const followsXcResultNaming = (directory) => directory.endsWith(".xcresult");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allurereport/reader",
3
- "version": "3.0.0-beta.17",
3
+ "version": "3.0.0-beta.19",
4
4
  "description": "Collection of utilities which helps to process different kind of test results as Allure Results",
5
5
  "keywords": [
6
6
  "allure",
@@ -26,9 +26,9 @@
26
26
  "test": "vitest run"
27
27
  },
28
28
  "dependencies": {
29
- "@allurereport/core-api": "3.0.0-beta.17",
30
- "@allurereport/plugin-api": "3.0.0-beta.17",
31
- "@allurereport/reader-api": "3.0.0-beta.17",
29
+ "@allurereport/core-api": "3.0.0-beta.19",
30
+ "@allurereport/plugin-api": "3.0.0-beta.19",
31
+ "@allurereport/reader-api": "3.0.0-beta.19",
32
32
  "fast-xml-parser": "^4.5.0"
33
33
  },
34
34
  "devDependencies": {
@@ -39,8 +39,8 @@
39
39
  "@typescript-eslint/eslint-plugin": "^8.0.0",
40
40
  "@typescript-eslint/parser": "^8.0.0",
41
41
  "@vitest/runner": "^2.1.9",
42
- "allure-js-commons": "^3.3.0",
43
- "allure-vitest": "^3.3.0",
42
+ "allure-js-commons": "^3.3.3",
43
+ "allure-vitest": "^3.3.3",
44
44
  "archiver": "^7.0.1",
45
45
  "eslint": "^8.57.0",
46
46
  "eslint-config-prettier": "^9.1.0",