1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | Object.defineProperty(exports, "__esModule", { value: true });
|
11 | exports.ensureIsFunction = exports.isPrimtiveConstructor = exports.isEsm = void 0;
|
12 | const utils_1 = require("@poppinss/utils");
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | function isEsm(value) {
|
18 | return value && value.__esModule;
|
19 | }
|
20 | exports.isEsm = isEsm;
|
21 |
|
22 |
|
23 |
|
24 | function isPrimtiveConstructor(value) {
|
25 | return [String, Function, Object, Date, Number, Boolean].indexOf(value) > -1;
|
26 | }
|
27 | exports.isPrimtiveConstructor = isPrimtiveConstructor;
|
28 |
|
29 |
|
30 |
|
31 |
|
32 | function ensureIsFunction(callback, message) {
|
33 | if (typeof callback !== 'function') {
|
34 | throw new utils_1.Exception(message, 500, 'E_RUNTIME_EXCEPTION');
|
35 | }
|
36 | }
|
37 | exports.ensureIsFunction = ensureIsFunction;
|