@yaasl/utils 0.11.0-alpha.2 → 0.11.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/dist/@types/getWindow.d.ts +1 -0
- package/dist/@types/index.d.ts +1 -1
- package/dist/cjs/getWindow.js +7 -0
- package/dist/cjs/index.js +1 -1
- package/dist/esm/getWindow.js +3 -0
- package/dist/esm/index.js +1 -1
- package/package.json +1 -6
- package/dist/@types/mockConsole.d.ts +0 -5
- package/dist/cjs/mockConsole.js +0 -11
- package/dist/esm/mockConsole.js +0 -7
- package/tsconfig.json +0 -3
- package/tsconfig.node.json +0 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getWindow: () => (Window & typeof globalThis) | undefined;
|
package/dist/@types/index.d.ts
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable no-restricted-globals */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.getWindow = void 0;
|
|
5
|
+
const isBrowserEnv = () => typeof window !== "undefined";
|
|
6
|
+
const getWindow = () => (isBrowserEnv() ? window : undefined);
|
|
7
|
+
exports.getWindow = getWindow;
|
package/dist/cjs/index.js
CHANGED
|
@@ -14,9 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./getWindow"), exports);
|
|
17
18
|
__exportStar(require("./isPromiseLike"), exports);
|
|
18
19
|
__exportStar(require("./log"), exports);
|
|
19
|
-
__exportStar(require("./mockConsole"), exports);
|
|
20
20
|
__exportStar(require("./sleep"), exports);
|
|
21
21
|
__exportStar(require("./Thenable"), exports);
|
|
22
22
|
__exportStar(require("./toVoid"), exports);
|
package/dist/esm/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yaasl/utils",
|
|
3
|
-
"version": "0.11.0
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Utilities for @yaasl packages",
|
|
5
5
|
"author": "PrettyCoffee",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,11 +34,6 @@
|
|
|
34
34
|
"lint:fix": "eslint ./src --fix",
|
|
35
35
|
"validate": "run-s lint test build"
|
|
36
36
|
},
|
|
37
|
-
"eslintConfig": {
|
|
38
|
-
"extends": [
|
|
39
|
-
"../../.eslintrc"
|
|
40
|
-
]
|
|
41
|
-
},
|
|
42
37
|
"lint-staged": {
|
|
43
38
|
"*.{ts,tsx}": [
|
|
44
39
|
"npm run lint:fix"
|
package/dist/cjs/mockConsole.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mockConsole = void 0;
|
|
4
|
-
const mockConsole = () => {
|
|
5
|
-
const oldConsole = global.console;
|
|
6
|
-
const error = vi.fn();
|
|
7
|
-
const warn = vi.fn();
|
|
8
|
-
global.console = Object.assign(Object.assign({}, global.console), { error, warn });
|
|
9
|
-
return { error, warn, resetConsole: () => (global.console = oldConsole) };
|
|
10
|
-
};
|
|
11
|
-
exports.mockConsole = mockConsole;
|
package/dist/esm/mockConsole.js
DELETED
package/tsconfig.json
DELETED