@devvit/shared-types 0.11.2 → 0.11.3-next-2024-10-31-9ef830d31.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/StringUtil.d.ts +5 -0
- package/StringUtil.d.ts.map +1 -1
- package/StringUtil.js +11 -0
- package/package.json +5 -5
package/StringUtil.d.ts
CHANGED
|
@@ -13,5 +13,10 @@ export declare namespace StringUtil {
|
|
|
13
13
|
* otherwise.
|
|
14
14
|
*/
|
|
15
15
|
function caughtToString(val: unknown, preferredErrorProperty?: 'stack' | 'message' | 'name'): string;
|
|
16
|
+
/**
|
|
17
|
+
* Converts an unknown type to a verbose stacktrace if an error or string form
|
|
18
|
+
* otherwise. Prefer caughtToString where possible for typing reasons.
|
|
19
|
+
*/
|
|
20
|
+
function caughtToStringUntyped(val: unknown, preferredErrorProperty?: string): string;
|
|
16
21
|
}
|
|
17
22
|
//# sourceMappingURL=StringUtil.d.ts.map
|
package/StringUtil.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringUtil.d.ts","sourceRoot":"","sources":["../src/StringUtil.ts"],"names":[],"mappings":"AAAA,yBAAiB,UAAU,CAAC;IAC1B;;;OAGG;IACH,SAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE5D;IAED,wDAAwD;IACxD,SAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAGlE;IAED,oEAAoE;IACpE,SAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAE/D;IAED;;;OAGG;IACH,SAAgB,cAAc,CAC5B,GAAG,EAAE,OAAO,EACZ,sBAAsB,GAAE,OAAO,GAAG,SAAS,GAAG,MAAgB,GAC7D,MAAM,CAIR;CACF"}
|
|
1
|
+
{"version":3,"file":"StringUtil.d.ts","sourceRoot":"","sources":["../src/StringUtil.ts"],"names":[],"mappings":"AAAA,yBAAiB,UAAU,CAAC;IAC1B;;;OAGG;IACH,SAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE5D;IAED,wDAAwD;IACxD,SAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAGlE;IAED,oEAAoE;IACpE,SAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAE/D;IAED;;;OAGG;IACH,SAAgB,cAAc,CAC5B,GAAG,EAAE,OAAO,EACZ,sBAAsB,GAAE,OAAO,GAAG,SAAS,GAAG,MAAgB,GAC7D,MAAM,CAIR;IAED;;;OAGG;IACH,SAAgB,qBAAqB,CACnC,GAAG,EAAE,OAAO,EACZ,sBAAsB,GAAE,MAAgB,GACvC,MAAM,CAKR;CACF"}
|
package/StringUtil.js
CHANGED
|
@@ -30,4 +30,15 @@ export var StringUtil;
|
|
|
30
30
|
: String(val);
|
|
31
31
|
}
|
|
32
32
|
StringUtil.caughtToString = caughtToString;
|
|
33
|
+
/**
|
|
34
|
+
* Converts an unknown type to a verbose stacktrace if an error or string form
|
|
35
|
+
* otherwise. Prefer caughtToString where possible for typing reasons.
|
|
36
|
+
*/
|
|
37
|
+
function caughtToStringUntyped(val, preferredErrorProperty = 'stack') {
|
|
38
|
+
return val instanceof Error
|
|
39
|
+
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
|
+
`${val[preferredErrorProperty] || val.stack || val.message || val.name}`
|
|
41
|
+
: String(val);
|
|
42
|
+
}
|
|
43
|
+
StringUtil.caughtToStringUntyped = caughtToStringUntyped;
|
|
33
44
|
})(StringUtil || (StringUtil = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devvit/shared-types",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.3-next-2024-10-31-9ef830d31.0",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
},
|
|
25
25
|
"types": "./index.d.ts",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@devvit/protos": "0.11.
|
|
27
|
+
"@devvit/protos": "0.11.3-next-2024-10-31-9ef830d31.0",
|
|
28
28
|
"jsonschema": "1.4.1",
|
|
29
29
|
"uuid": "9.0.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@devvit/repo-tools": "0.11.
|
|
33
|
-
"@devvit/tsconfig": "0.11.
|
|
32
|
+
"@devvit/repo-tools": "0.11.3-next-2024-10-31-9ef830d31.0",
|
|
33
|
+
"@devvit/tsconfig": "0.11.3-next-2024-10-31-9ef830d31.0",
|
|
34
34
|
"@types/redis-mock": "0.17.1",
|
|
35
35
|
"@types/uuid": "9.0.0",
|
|
36
36
|
"eslint": "9.11.1",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"directory": "dist"
|
|
45
45
|
},
|
|
46
46
|
"source": "./src/index.ts",
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "322d47235e5fa4276f9c4d51d280acb6504c63cb"
|
|
48
48
|
}
|