WXL
3 天以前 4d9da000fbe74d344e0e4580b138e79d4ad98ede
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isEmpty = exports.assertEmpty = void 0;
class EmptyError extends Error {
    constructor(message) {
        super(message);
    }
}
function assertEmpty(data, name) {
    const _name = name || "target";
    if (typeof data === "undefined") {
        throw new EmptyError(`${_name} is undefined`);
    }
    if (data === null) {
        throw new EmptyError(`${_name} is null`);
    }
}
exports.assertEmpty = assertEmpty;
function isEmpty(data) {
    if (typeof data === "undefined" || data === null) {
        return true;
    }
    return false;
}
exports.isEmpty = isEmpty;
//# sourceMappingURL=asserts.js.map