@cto.af/utils 1.0.0 → 1.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/lib/index.d.ts +11 -1
- package/lib/index.js +1 -1
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
|
@@ -14,5 +14,15 @@ declare function isErrno(e: unknown): e is NodeJS.ErrnoException;
|
|
|
14
14
|
* @throws {TypeError} On invalid code type.
|
|
15
15
|
*/
|
|
16
16
|
declare function errCode(e: unknown, code: string | number): boolean;
|
|
17
|
+
interface CiOptions {
|
|
18
|
+
CI?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Is the current environment CI-like.
|
|
22
|
+
*
|
|
23
|
+
* @param opts Override the environment determination, for testing.
|
|
24
|
+
* @returns True if in CI.
|
|
25
|
+
*/
|
|
26
|
+
declare function isCI(opts?: CiOptions): boolean;
|
|
17
27
|
|
|
18
|
-
export { errCode, isErrno };
|
|
28
|
+
export { type CiOptions, errCode, isCI, isErrno };
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(
|
|
1
|
+
function e(n){return n instanceof Error&&Object.prototype.hasOwnProperty.call(n,"code")}function o(n,r){if(!e(n))return!1;switch(typeof r){case"string":return n.code===r;case"number":return n.errno===r}throw new TypeError(`Invalid code: ${JSON.stringify(r)}`)}function t(n){if(n&&"CI"in n)return!!n.CI;let{env:r}=process;return!!(r.CI||r.CONTINUOUS_INTEGRATION||r.BUILD_NUMBER||r.RUN_ID)}export{o as errCode,t as isCI,e as isErrno};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cto.af/utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"decription": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"files": [
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"bugs": {
|
|
19
19
|
"url": "https://github.com/cto-af/utils/issues"
|
|
20
20
|
},
|
|
21
|
-
"packageManager": "pnpm@10.
|
|
21
|
+
"packageManager": "pnpm@10.11.0",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=20"
|
|
24
24
|
}
|