@oh-my-pi/pi-utils 17.0.8 → 17.1.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.
- package/CHANGELOG.md +6 -0
- package/dist/types/dirs.d.ts +2 -2
- package/dist/types/type-guards.d.ts +2 -0
- package/package.json +2 -2
- package/src/dirs.ts +2 -2
- package/src/type-guards.ts +6 -0
package/CHANGELOG.md
CHANGED
package/dist/types/dirs.d.ts
CHANGED
|
@@ -155,8 +155,8 @@ export declare function getPythonGatewayDir(): string;
|
|
|
155
155
|
export declare function getPuppeteerDir(): string;
|
|
156
156
|
/** Get DOCS_RS cache directory () */
|
|
157
157
|
export declare function getDocsRsCacheDir(): string;
|
|
158
|
-
/**Get
|
|
159
|
-
export declare function
|
|
158
|
+
/** Get the auto-QA grievances SQLite database path (~/.omp/autoqa.db; XDG: $XDG_DATA_HOME/omp/autoqa.db). */
|
|
159
|
+
export declare function getAutoQaDbPath(): string;
|
|
160
160
|
/**
|
|
161
161
|
* Stable 7-character hex digest of an absolute filesystem path.
|
|
162
162
|
*
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
2
|
+
/** Reads an own string-valued property without invoking accessors. */
|
|
3
|
+
export declare function stringProperty(value: object, key: string): string | undefined;
|
|
2
4
|
export declare function asRecord(value: unknown): Record<string, unknown> | null;
|
|
3
5
|
export declare function toError(value: unknown): Error;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-utils",
|
|
4
|
-
"version": "17.0
|
|
4
|
+
"version": "17.1.0",
|
|
5
5
|
"description": "Shared utilities for pi packages",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"fmt": "biome format --write ."
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@oh-my-pi/pi-natives": "17.0
|
|
34
|
+
"@oh-my-pi/pi-natives": "17.1.0",
|
|
35
35
|
"handlebars": "^4.7.9",
|
|
36
36
|
"winston": "^3.19.0",
|
|
37
37
|
"winston-daily-rotate-file": "^5.0.0"
|
package/src/dirs.ts
CHANGED
|
@@ -632,8 +632,8 @@ export function getDocsRsCacheDir(): string {
|
|
|
632
632
|
return dirs.rootSubdir("webcache", "cache");
|
|
633
633
|
}
|
|
634
634
|
|
|
635
|
-
/**Get
|
|
636
|
-
export function
|
|
635
|
+
/** Get the auto-QA grievances SQLite database path (~/.omp/autoqa.db; XDG: $XDG_DATA_HOME/omp/autoqa.db). */
|
|
636
|
+
export function getAutoQaDbPath(): string {
|
|
637
637
|
return dirs.rootSubdir("autoqa.db", "data");
|
|
638
638
|
}
|
|
639
639
|
/**
|
package/src/type-guards.ts
CHANGED
|
@@ -2,6 +2,12 @@ export function isRecord(value: unknown): value is Record<string, unknown> {
|
|
|
2
2
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
+
/** Reads an own string-valued property without invoking accessors. */
|
|
6
|
+
export function stringProperty(value: object, key: string): string | undefined {
|
|
7
|
+
const field = Object.getOwnPropertyDescriptor(value, key)?.value;
|
|
8
|
+
return typeof field === "string" ? field : undefined;
|
|
9
|
+
}
|
|
10
|
+
|
|
5
11
|
export function asRecord(value: unknown): Record<string, unknown> | null {
|
|
6
12
|
return isRecord(value) ? value : null;
|
|
7
13
|
}
|