alemonjs 2.1.17 → 2.1.19

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.
Files changed (57) hide show
  1. package/lib/app/SinglyLinkedList.d.ts +1 -0
  2. package/lib/app/SinglyLinkedList.js +12 -6
  3. package/lib/app/define-platform.d.ts +1 -0
  4. package/lib/app/define-platform.js +3 -2
  5. package/lib/app/define-response.d.ts +0 -3
  6. package/lib/app/define-response.js +1 -5
  7. package/lib/app/define-router.d.ts +5 -0
  8. package/lib/app/define-router.js +21 -0
  9. package/lib/app/event-processor-callHandler.js +5 -15
  10. package/lib/app/event-processor-cycleFiles.d.ts +1 -0
  11. package/lib/app/event-processor-cycleFiles.js +19 -2
  12. package/lib/app/event-processor-cycleRoute.js +32 -7
  13. package/lib/app/event-processor-event.js +4 -4
  14. package/lib/app/event-processor-middleware.js +4 -4
  15. package/lib/app/event-processor.js +15 -6
  16. package/lib/app/hook-use-api.d.ts +14 -6
  17. package/lib/app/hook-use-api.js +80 -82
  18. package/lib/app/index.d.ts +1 -0
  19. package/lib/app/index.js +4 -3
  20. package/lib/app/load_modules/loadChild.js +6 -6
  21. package/lib/app/message-format.d.ts +30 -1
  22. package/lib/app/message-format.js +82 -1
  23. package/lib/app/store.d.ts +3 -3
  24. package/lib/app/store.js +23 -11
  25. package/lib/cbp/connects/base.d.ts +15 -0
  26. package/lib/cbp/connects/base.js +77 -0
  27. package/lib/cbp/connects/client.js +13 -65
  28. package/lib/cbp/connects/platform.js +11 -63
  29. package/lib/cbp/server/main.js +5 -25
  30. package/lib/client.js +0 -1
  31. package/lib/core/config.js +17 -8
  32. package/lib/core/variable.d.ts +2 -1
  33. package/lib/core/variable.js +3 -2
  34. package/lib/index.js +4 -3
  35. package/lib/types/event/index.d.ts +7 -0
  36. package/package.json +1 -1
  37. package/lib/app/define-chidren.d.ts +0 -2
  38. package/lib/app/define-chidren.js +0 -19
  39. package/lib/app/define-pl.ts +0 -0
  40. package/lib/cbp/core/connection-manager.d.ts +0 -18
  41. package/lib/cbp/core/connection-manager.js +0 -67
  42. package/lib/cbp/core/constants.d.ts +0 -19
  43. package/lib/cbp/core/constants.js +0 -23
  44. package/lib/cbp/core/load-balancer.d.ts +0 -37
  45. package/lib/cbp/core/load-balancer.js +0 -118
  46. package/lib/cbp/processor/request-handler.d.ts +0 -17
  47. package/lib/cbp/processor/request-handler.js +0 -65
  48. package/lib/polyfills/fs-promises.d.ts +0 -41
  49. package/lib/polyfills/fs-promises.js +0 -138
  50. package/lib/polyfills/fs.d.ts +0 -103
  51. package/lib/polyfills/fs.js +0 -229
  52. package/lib/polyfills/util-types.d.ts +0 -33
  53. package/lib/polyfills/util-types.js +0 -36
  54. package/lib/types/event/channal/index.d.ts +0 -10
  55. package/lib/types/event/channal/index.js +0 -1
  56. /package/lib/cbp/processor/{heandle.d.ts → handle.d.ts} +0 -0
  57. /package/lib/cbp/processor/{heandle.js → handle.js} +0 -0
@@ -1,138 +0,0 @@
1
- const readFile = async (path, encoding) => {
2
- console.warn(`[AlemonJS Browser] fs/promises.readFile('${path}') is not available in browser, returning empty buffer`);
3
- return Buffer.from('');
4
- };
5
- const writeFile = async (path, data) => {
6
- console.warn(`[AlemonJS Browser] fs/promises.writeFile('${path}') is not available in browser, operation skipped`);
7
- return Promise.resolve();
8
- };
9
- const readdir = async (path) => {
10
- console.warn(`[AlemonJS Browser] fs/promises.readdir('${path}') is not available in browser, returning empty array`);
11
- return Promise.resolve([]);
12
- };
13
- const mkdir = async (path, options) => {
14
- console.warn(`[AlemonJS Browser] fs/promises.mkdir('${path}') is not available in browser, operation skipped`);
15
- return Promise.resolve();
16
- };
17
- const stat = async (path) => {
18
- console.warn(`[AlemonJS Browser] fs/promises.stat('${path}') is not available in browser, returning mock stats`);
19
- return Promise.resolve({
20
- isDirectory: () => false,
21
- isFile: () => false,
22
- isBlockDevice: () => false,
23
- isCharacterDevice: () => false,
24
- isSymbolicLink: () => false,
25
- isFIFO: () => false,
26
- isSocket: () => false,
27
- dev: 0,
28
- ino: 0,
29
- mode: 0,
30
- nlink: 0,
31
- uid: 0,
32
- gid: 0,
33
- rdev: 0,
34
- size: 0,
35
- blksize: 0,
36
- blocks: 0,
37
- atimeMs: 0,
38
- mtimeMs: 0,
39
- ctimeMs: 0,
40
- birthtimeMs: 0,
41
- atime: new Date(),
42
- mtime: new Date(),
43
- ctime: new Date(),
44
- birthtime: new Date()
45
- });
46
- };
47
- const unlink = async (path) => {
48
- console.warn(`[AlemonJS Browser] fs/promises.unlink('${path}') is not available in browser, operation skipped`);
49
- return Promise.resolve();
50
- };
51
- const rmdir = async (path, options) => {
52
- console.warn(`[AlemonJS Browser] fs/promises.rmdir('${path}') is not available in browser, operation skipped`);
53
- return Promise.resolve();
54
- };
55
- const rename = async (oldPath, newPath) => {
56
- console.warn(`[AlemonJS Browser] fs/promises.rename('${oldPath}', '${newPath}') is not available in browser, operation skipped`);
57
- return Promise.resolve();
58
- };
59
- const copyFile = async (src, dest, flags) => {
60
- console.warn(`[AlemonJS Browser] fs/promises.copyFile('${src}', '${dest}') is not available in browser, operation skipped`);
61
- return Promise.resolve();
62
- };
63
- const appendFile = async (path, data, options) => {
64
- console.warn(`[AlemonJS Browser] fs/promises.appendFile('${path}') is not available in browser, operation skipped`);
65
- return Promise.resolve();
66
- };
67
- const access = async (path, mode) => {
68
- console.warn(`[AlemonJS Browser] fs/promises.access('${path}') is not available in browser, operation skipped`);
69
- return Promise.resolve();
70
- };
71
- const readlink = async (path) => {
72
- console.warn(`[AlemonJS Browser] fs/promises.readlink('${path}') is not available in browser, returning empty string`);
73
- return Promise.resolve('');
74
- };
75
- const symlink = async (target, path, type) => {
76
- console.warn(`[AlemonJS Browser] fs/promises.symlink('${target}', '${path}') is not available in browser, operation skipped`);
77
- return Promise.resolve();
78
- };
79
- const lstat = async (path) => {
80
- console.warn(`[AlemonJS Browser] fs/promises.lstat('${path}') is not available in browser, returning mock stats`);
81
- return stat(path);
82
- };
83
- const chmod = async (path, mode) => {
84
- console.warn(`[AlemonJS Browser] fs/promises.chmod('${path}') is not available in browser, operation skipped`);
85
- return Promise.resolve();
86
- };
87
- const chown = async (path, uid, gid) => {
88
- console.warn(`[AlemonJS Browser] fs/promises.chown('${path}') is not available in browser, operation skipped`);
89
- return Promise.resolve();
90
- };
91
- const realpath = async (path) => {
92
- console.warn(`[AlemonJS Browser] fs/promises.realpath('${path}') is not available in browser, returning empty string`);
93
- return Promise.resolve('');
94
- };
95
- const mkdtemp = async (prefix) => {
96
- console.warn(`[AlemonJS Browser] fs/promises.mkdtemp('${prefix}') is not available in browser, returning mock path`);
97
- return Promise.resolve(`/tmp/${prefix}${Math.random().toString(36).substr(2, 9)}`);
98
- };
99
- const opendir = async (path) => {
100
- console.warn(`[AlemonJS Browser] fs/promises.opendir('${path}') is not available in browser, returning mock dir`);
101
- const mockDir = {
102
- [Symbol.asyncIterator]: () => {
103
- return {
104
- next: () => Promise.resolve({ done: true, value: null })
105
- };
106
- },
107
- close: async () => {
108
- console.warn('[AlemonJS Browser] Mock dir close() called');
109
- },
110
- path: path,
111
- read: async () => null,
112
- readSync: () => null
113
- };
114
- return Promise.resolve(mockDir);
115
- };
116
- var fsPromises = {
117
- readFile,
118
- writeFile,
119
- readdir,
120
- mkdir,
121
- stat,
122
- unlink,
123
- rmdir,
124
- rename,
125
- copyFile,
126
- appendFile,
127
- access,
128
- readlink,
129
- symlink,
130
- lstat,
131
- chmod,
132
- chown,
133
- realpath,
134
- mkdtemp,
135
- opendir
136
- };
137
-
138
- export { access, appendFile, chmod, chown, copyFile, fsPromises as default, lstat, mkdir, mkdtemp, opendir, readFile, readdir, readlink, realpath, rename, rmdir, stat, symlink, unlink, writeFile };
@@ -1,103 +0,0 @@
1
- export declare const existsSync: (path: string) => boolean;
2
- export declare const readFileSync: (path: string, encoding?: string) => string;
3
- export declare const writeFileSync: (path: string, data: string) => void;
4
- export declare const mkdirSync: (path: string, options?: any) => void;
5
- export declare const watch: (path: string, options?: any) => any;
6
- export declare const readdirSync: (path: string) => string[];
7
- export declare const statSync: (path: string) => any;
8
- export declare const unlinkSync: (path: string) => void;
9
- export declare const rmdirSync: (path: string, options?: any) => void;
10
- export declare const renameSync: (oldPath: string, newPath: string) => void;
11
- export declare const copyFileSync: (src: string, dest: string, flags?: number) => void;
12
- export declare const appendFileSync: (path: string, data: string, options?: any) => void;
13
- export declare const writeFile: (path: string, data: string, callback?: (err: any) => void) => void;
14
- export declare const readFile: (path: string, encoding: string, callback?: (err: any, data: string) => void) => void;
15
- export declare const mkdir: (path: string, options: any, callback?: (err: any) => void) => void;
16
- export declare const unlink: (path: string, callback?: (err: any) => void) => void;
17
- export declare const rmdir: (path: string, callback?: (err: any) => void) => void;
18
- export declare const rename: (oldPath: string, newPath: string, callback?: (err: any) => void) => void;
19
- export declare const promises: {
20
- writeFile: (path: string, data: string) => Promise<void>;
21
- readFile: (path: string, encoding?: string) => Promise<string>;
22
- mkdir: (path: string, options?: any) => Promise<void>;
23
- readdir: (path: string) => Promise<string[]>;
24
- stat: (path: string) => Promise<any>;
25
- unlink: (path: string) => Promise<void>;
26
- rmdir: (path: string) => Promise<void>;
27
- };
28
- export declare const createReadStream: (path: string, options?: any) => any;
29
- export declare const createWriteStream: (path: string, options?: any) => any;
30
- export declare const constants: {
31
- F_OK: number;
32
- R_OK: number;
33
- W_OK: number;
34
- X_OK: number;
35
- O_RDONLY: number;
36
- O_WRONLY: number;
37
- O_RDWR: number;
38
- O_CREAT: number;
39
- O_EXCL: number;
40
- O_NOCTTY: number;
41
- O_TRUNC: number;
42
- O_APPEND: number;
43
- O_DIRECTORY: number;
44
- O_NOATIME: number;
45
- O_NOFOLLOW: number;
46
- O_SYNC: number;
47
- O_DSYNC: number;
48
- O_DIRECT: number;
49
- O_NONBLOCK: number;
50
- };
51
- declare const _default: {
52
- existsSync: (path: string) => boolean;
53
- readFileSync: (path: string, encoding?: string) => string;
54
- writeFileSync: (path: string, data: string) => void;
55
- mkdirSync: (path: string, options?: any) => void;
56
- watch: (path: string, options?: any) => any;
57
- readdirSync: (path: string) => string[];
58
- statSync: (path: string) => any;
59
- unlinkSync: (path: string) => void;
60
- rmdirSync: (path: string, options?: any) => void;
61
- renameSync: (oldPath: string, newPath: string) => void;
62
- copyFileSync: (src: string, dest: string, flags?: number) => void;
63
- appendFileSync: (path: string, data: string, options?: any) => void;
64
- writeFile: (path: string, data: string, callback?: (err: any) => void) => void;
65
- readFile: (path: string, encoding: string, callback?: (err: any, data: string) => void) => void;
66
- mkdir: (path: string, options: any, callback?: (err: any) => void) => void;
67
- unlink: (path: string, callback?: (err: any) => void) => void;
68
- rmdir: (path: string, callback?: (err: any) => void) => void;
69
- rename: (oldPath: string, newPath: string, callback?: (err: any) => void) => void;
70
- promises: {
71
- writeFile: (path: string, data: string) => Promise<void>;
72
- readFile: (path: string, encoding?: string) => Promise<string>;
73
- mkdir: (path: string, options?: any) => Promise<void>;
74
- readdir: (path: string) => Promise<string[]>;
75
- stat: (path: string) => Promise<any>;
76
- unlink: (path: string) => Promise<void>;
77
- rmdir: (path: string) => Promise<void>;
78
- };
79
- createReadStream: (path: string, options?: any) => any;
80
- createWriteStream: (path: string, options?: any) => any;
81
- constants: {
82
- F_OK: number;
83
- R_OK: number;
84
- W_OK: number;
85
- X_OK: number;
86
- O_RDONLY: number;
87
- O_WRONLY: number;
88
- O_RDWR: number;
89
- O_CREAT: number;
90
- O_EXCL: number;
91
- O_NOCTTY: number;
92
- O_TRUNC: number;
93
- O_APPEND: number;
94
- O_DIRECTORY: number;
95
- O_NOATIME: number;
96
- O_NOFOLLOW: number;
97
- O_SYNC: number;
98
- O_DSYNC: number;
99
- O_DIRECT: number;
100
- O_NONBLOCK: number;
101
- };
102
- };
103
- export default _default;
@@ -1,229 +0,0 @@
1
- const existsSync = (path) => {
2
- console.warn(`[AlemonJS Browser] fs.existsSync('${path}') is not available in browser, returning false`);
3
- return false;
4
- };
5
- const readFileSync = (path, encoding) => {
6
- console.warn(`[AlemonJS Browser] fs.readFileSync('${path}') is not available in browser, returning empty string`);
7
- return '';
8
- };
9
- const writeFileSync = (path, data) => {
10
- console.warn(`[AlemonJS Browser] fs.writeFileSync('${path}') is not available in browser, operation skipped`);
11
- };
12
- const mkdirSync = (path, options) => {
13
- console.warn(`[AlemonJS Browser] fs.mkdirSync('${path}') is not available in browser, operation skipped`);
14
- };
15
- const watch = (path, options) => {
16
- console.warn(`[AlemonJS Browser] fs.watch('${path}') is not available in browser, returning mock watcher`);
17
- return {
18
- close: () => {
19
- console.warn('[AlemonJS Browser] Mock fs.watch close() called');
20
- },
21
- on: (event, callback) => {
22
- console.warn(`[AlemonJS Browser] Mock fs.watch on('${event}') called`);
23
- },
24
- ref: () => {
25
- console.warn('[AlemonJS Browser] Mock fs.watch ref() called');
26
- return undefined;
27
- },
28
- unref: () => {
29
- console.warn('[AlemonJS Browser] Mock fs.watch unref() called');
30
- return undefined;
31
- }
32
- };
33
- };
34
- const readdirSync = (path) => {
35
- console.warn(`[AlemonJS Browser] fs.readdirSync('${path}') is not available in browser, returning empty array`);
36
- return [];
37
- };
38
- const statSync = (path) => {
39
- console.warn(`[AlemonJS Browser] fs.statSync('${path}') is not available in browser, returning mock stats`);
40
- return {
41
- isDirectory: () => false,
42
- isFile: () => false,
43
- isBlockDevice: () => false,
44
- isCharacterDevice: () => false,
45
- isSymbolicLink: () => false,
46
- isFIFO: () => false,
47
- isSocket: () => false,
48
- dev: 0,
49
- ino: 0,
50
- mode: 0,
51
- nlink: 0,
52
- uid: 0,
53
- gid: 0,
54
- rdev: 0,
55
- size: 0,
56
- blksize: 0,
57
- blocks: 0,
58
- atimeMs: 0,
59
- mtimeMs: 0,
60
- ctimeMs: 0,
61
- birthtimeMs: 0,
62
- atime: new Date(),
63
- mtime: new Date(),
64
- ctime: new Date(),
65
- birthtime: new Date()
66
- };
67
- };
68
- const unlinkSync = (path) => {
69
- console.warn(`[AlemonJS Browser] fs.unlinkSync('${path}') is not available in browser, operation skipped`);
70
- };
71
- const rmdirSync = (path, options) => {
72
- console.warn(`[AlemonJS Browser] fs.rmdirSync('${path}') is not available in browser, operation skipped`);
73
- };
74
- const renameSync = (oldPath, newPath) => {
75
- console.warn(`[AlemonJS Browser] fs.renameSync('${oldPath}', '${newPath}') is not available in browser, operation skipped`);
76
- };
77
- const copyFileSync = (src, dest, flags) => {
78
- console.warn(`[AlemonJS Browser] fs.copyFileSync('${src}', '${dest}') is not available in browser, operation skipped`);
79
- };
80
- const appendFileSync = (path, data, options) => {
81
- console.warn(`[AlemonJS Browser] fs.appendFileSync('${path}') is not available in browser, operation skipped`);
82
- };
83
- const writeFile = (path, data, callback) => {
84
- console.warn(`[AlemonJS Browser] fs.writeFile('${path}') is not available in browser, operation skipped`);
85
- if (callback) {
86
- setTimeout(() => callback(null), 0);
87
- }
88
- };
89
- const readFile = (path, encoding, callback) => {
90
- console.warn(`[AlemonJS Browser] fs.readFile('${path}') is not available in browser, returning empty data`);
91
- if (callback) {
92
- setTimeout(() => callback(null, ''), 0);
93
- }
94
- };
95
- const mkdir = (path, options, callback) => {
96
- console.warn(`[AlemonJS Browser] fs.mkdir('${path}') is not available in browser, operation skipped`);
97
- if (callback) {
98
- setTimeout(() => callback(null), 0);
99
- }
100
- };
101
- const unlink = (path, callback) => {
102
- console.warn(`[AlemonJS Browser] fs.unlink('${path}') is not available in browser, operation skipped`);
103
- if (callback) {
104
- setTimeout(() => callback(null), 0);
105
- }
106
- };
107
- const rmdir = (path, callback) => {
108
- console.warn(`[AlemonJS Browser] fs.rmdir('${path}') is not available in browser, operation skipped`);
109
- if (callback) {
110
- setTimeout(() => callback(null), 0);
111
- }
112
- };
113
- const rename = (oldPath, newPath, callback) => {
114
- console.warn(`[AlemonJS Browser] fs.rename('${oldPath}', '${newPath}') is not available in browser, operation skipped`);
115
- if (callback) {
116
- setTimeout(() => callback(null), 0);
117
- }
118
- };
119
- const promises = {
120
- writeFile: async (path, data) => {
121
- console.warn(`[AlemonJS Browser] fs.promises.writeFile('${path}') is not available in browser, operation skipped`);
122
- return Promise.resolve();
123
- },
124
- readFile: async (path, encoding) => {
125
- console.warn(`[AlemonJS Browser] fs.promises.readFile('${path}') is not available in browser, returning empty string`);
126
- return Promise.resolve('');
127
- },
128
- mkdir: async (path, options) => {
129
- console.warn(`[AlemonJS Browser] fs.promises.mkdir('${path}') is not available in browser, operation skipped`);
130
- return Promise.resolve();
131
- },
132
- readdir: async (path) => {
133
- console.warn(`[AlemonJS Browser] fs.promises.readdir('${path}') is not available in browser, returning empty array`);
134
- return Promise.resolve([]);
135
- },
136
- stat: async (path) => {
137
- console.warn(`[AlemonJS Browser] fs.promises.stat('${path}') is not available in browser, returning mock stats`);
138
- return Promise.resolve(statSync(path));
139
- },
140
- unlink: async (path) => {
141
- console.warn(`[AlemonJS Browser] fs.promises.unlink('${path}') is not available in browser, operation skipped`);
142
- return Promise.resolve();
143
- },
144
- rmdir: async (path) => {
145
- console.warn(`[AlemonJS Browser] fs.promises.rmdir('${path}') is not available in browser, operation skipped`);
146
- return Promise.resolve();
147
- }
148
- };
149
- const createReadStream = (path, options) => {
150
- console.warn(`[AlemonJS Browser] fs.createReadStream('${path}') is not available in browser, returning mock stream`);
151
- const mockStream = {
152
- on: (event, listener) => {
153
- if (event === 'error') {
154
- setTimeout(() => listener(new Error(`Cannot create read stream for ${path} in browser`)), 0);
155
- }
156
- return mockStream;
157
- },
158
- pipe: () => mockStream,
159
- destroy: () => { },
160
- pause: () => mockStream,
161
- resume: () => mockStream
162
- };
163
- return mockStream;
164
- };
165
- const createWriteStream = (path, options) => {
166
- console.warn(`[AlemonJS Browser] fs.createWriteStream('${path}') is not available in browser, returning mock stream`);
167
- const mockStream = {
168
- write: (data) => {
169
- console.warn(`[AlemonJS Browser] Mock write stream write() called for ${path}`);
170
- return true;
171
- },
172
- end: () => {
173
- console.warn(`[AlemonJS Browser] Mock write stream end() called for ${path}`);
174
- },
175
- on: (event, listener) => {
176
- return mockStream;
177
- },
178
- destroy: () => { },
179
- pipe: () => mockStream
180
- };
181
- return mockStream;
182
- };
183
- const constants = {
184
- F_OK: 0,
185
- R_OK: 4,
186
- W_OK: 2,
187
- X_OK: 1,
188
- O_RDONLY: 0,
189
- O_WRONLY: 1,
190
- O_RDWR: 2,
191
- O_CREAT: 64,
192
- O_EXCL: 128,
193
- O_NOCTTY: 256,
194
- O_TRUNC: 512,
195
- O_APPEND: 1024,
196
- O_DIRECTORY: 65536,
197
- O_NOATIME: 262144,
198
- O_NOFOLLOW: 131072,
199
- O_SYNC: 1052672,
200
- O_DSYNC: 4096,
201
- O_DIRECT: 16384,
202
- O_NONBLOCK: 2048
203
- };
204
- var fs = {
205
- existsSync,
206
- readFileSync,
207
- writeFileSync,
208
- mkdirSync,
209
- watch,
210
- readdirSync,
211
- statSync,
212
- unlinkSync,
213
- rmdirSync,
214
- renameSync,
215
- copyFileSync,
216
- appendFileSync,
217
- writeFile,
218
- readFile,
219
- mkdir,
220
- unlink,
221
- rmdir,
222
- rename,
223
- promises,
224
- createReadStream,
225
- createWriteStream,
226
- constants
227
- };
228
-
229
- export { appendFileSync, constants, copyFileSync, createReadStream, createWriteStream, fs as default, existsSync, mkdir, mkdirSync, promises, readFile, readFileSync, readdirSync, rename, renameSync, rmdir, rmdirSync, statSync, unlink, unlinkSync, watch, writeFile, writeFileSync };
@@ -1,33 +0,0 @@
1
- export declare const isString: (value: any) => value is string;
2
- export declare const isNumber: (value: any) => value is number;
3
- export declare const isBoolean: (value: any) => value is boolean;
4
- export declare const isFunction: (value: any) => value is Function;
5
- export declare const isObject: (value: any) => value is object;
6
- export declare const isArray: (value: any) => value is any[];
7
- export declare const isBuffer: (value: any) => boolean;
8
- export declare const isDate: (value: any) => value is Date;
9
- export declare const isRegExp: (value: any) => value is RegExp;
10
- export declare const isError: (value: any) => value is Error;
11
- export declare const isNull: (value: any) => value is null;
12
- export declare const isUndefined: (value: any) => value is undefined;
13
- export declare const isSymbol: (value: any) => value is symbol;
14
- export declare const isPrimitive: (value: any) => boolean;
15
- export declare const isAsyncFunction: (func: unknown) => boolean;
16
- declare const _default: {
17
- isString: (value: any) => value is string;
18
- isNumber: (value: any) => value is number;
19
- isBoolean: (value: any) => value is boolean;
20
- isFunction: (value: any) => value is Function;
21
- isObject: (value: any) => value is object;
22
- isArray: (value: any) => value is any[];
23
- isBuffer: (value: any) => boolean;
24
- isDate: (value: any) => value is Date;
25
- isRegExp: (value: any) => value is RegExp;
26
- isError: (value: any) => value is Error;
27
- isNull: (value: any) => value is null;
28
- isUndefined: (value: any) => value is undefined;
29
- isSymbol: (value: any) => value is symbol;
30
- isPrimitive: (value: any) => boolean;
31
- isAsyncFunction: (func: unknown) => boolean;
32
- };
33
- export default _default;
@@ -1,36 +0,0 @@
1
- const isString = (value) => typeof value === 'string';
2
- const isNumber = (value) => typeof value === 'number';
3
- const isBoolean = (value) => typeof value === 'boolean';
4
- const isFunction = (value) => typeof value === 'function';
5
- const isObject = (value) => value !== null && typeof value === 'object';
6
- const isArray = (value) => Array.isArray(value);
7
- const isBuffer = (value) => value instanceof Uint8Array;
8
- const isDate = (value) => value instanceof Date;
9
- const isRegExp = (value) => value instanceof RegExp;
10
- const isError = (value) => value instanceof Error;
11
- const isNull = (value) => value === null;
12
- const isUndefined = (value) => value === undefined;
13
- const isSymbol = (value) => typeof value === 'symbol';
14
- const isPrimitive = (value) => value === null || (typeof value !== 'object' && typeof value !== 'function');
15
- const isAsyncFunction = (func) => {
16
- return Object.prototype.toString.call(func) === '[object AsyncFunction]';
17
- };
18
- var utilTypes = {
19
- isString,
20
- isNumber,
21
- isBoolean,
22
- isFunction,
23
- isObject,
24
- isArray,
25
- isBuffer,
26
- isDate,
27
- isRegExp,
28
- isError,
29
- isNull,
30
- isUndefined,
31
- isSymbol,
32
- isPrimitive,
33
- isAsyncFunction
34
- };
35
-
36
- export { utilTypes as default, isArray, isAsyncFunction, isBoolean, isBuffer, isDate, isError, isFunction, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isUndefined };
@@ -1,10 +0,0 @@
1
- import { Guild, Channel } from '../base/guild';
2
- import { platform } from '../base/platform';
3
- import { Message } from '../base/message';
4
- import { Expansion } from '../base/expansion';
5
- export type PublicEventChannalCreate = platform & Guild & Channel & Message & {
6
- name: 'channel.create';
7
- } & Expansion;
8
- export type PublicEventChannalDelete = platform & Guild & Channel & Message & {
9
- name: 'channal.delete';
10
- } & Expansion;
@@ -1 +0,0 @@
1
-
File without changes
File without changes