@sapphire-sh/utils 1.5.0 → 1.6.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 +2 -1
- package/lib/index.js +14 -14
- package/package.json +1 -1
- package/lib/scripts/index.d.ts +0 -1
- package/lib/scripts/index.js +0 -17
- package/lib/scripts/sleep.d.ts +0 -1
- package/lib/scripts/sleep.js +0 -7
package/lib/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const isNonNullable: <T extends object>(value?: T | null | undefined) => value is NonNullable<T>;
|
|
2
|
+
export declare const sleep: (ms: number) => Promise<void>;
|
package/lib/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (
|
|
6
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sleep = exports.isNonNullable = void 0;
|
|
4
|
+
const isNonNullable = (value) => {
|
|
5
|
+
if (value === null) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
if (value === undefined) {
|
|
9
|
+
return false;
|
|
7
10
|
}
|
|
8
|
-
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
return true;
|
|
15
12
|
};
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
exports.isNonNullable = isNonNullable;
|
|
14
|
+
const sleep = (ms) => {
|
|
15
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
16
|
+
};
|
|
17
|
+
exports.sleep = sleep;
|
package/package.json
CHANGED
package/lib/scripts/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './sleep';
|
package/lib/scripts/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./sleep"), exports);
|
package/lib/scripts/sleep.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const sleep: (ms: number) => Promise<void>;
|