-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathshared.ts
115 lines (96 loc) · 2.67 KB
/
shared.ts
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// Needed for exports to work correctly
import {Moment} from 'moment';
/******************************************** IMPORTS *********************************************/
import * as array from './src/array';
export * from './src/array';
export {array};
import * as date from './src/date';
export * from './src/date';
export {date};
import * as Enum from './src/enum';
export * from './src/enum';
export {Enum};
import * as error from './src/error';
export * from './src/error';
export {error};
import * as func from './src/function';
export * from './src/function';
export {func};
import * as locale from './src/locale';
export * from './src/locale';
export {locale};
import * as number from './src/number';
export * from './src/number';
export {number};
import * as object from './src/object';
export * from './src/object';
export {object};
import * as url from './src/url';
export * from './src/url';
export {url};
import * as search from './src/search';
export * from './src/search';
export {search};
import * as string from './src/string';
export * from './src/string';
export {string};
import * as typesIso from './src/types-iso';
export * from './src/types-iso';
export {typesIso};
import * as dataTypes from './src/types-data-generic';
export * from './src/types-data-generic';
export {dataTypes};
import * as validation from './src/validation';
export * from './src/validation';
export {validation};
import * as stream from './src/stream';
export * from './src/stream';
export {stream};
// Import isNode (detect node vs browser)
import * as isNode from 'detect-node';
export {isNode};
// Build final types object by merging isomorphic types with data types
// Note that this excludes straight types (it only includes type utils)
export const types = {...typesIso, ...dataTypes};
/********************************************* EXPORT *********************************************/
/**
* Top-level mad-utils namespace, containing all child namespaces
* Includes all contents of shared module plus browser-specific namespaces
*/
export const mUtils = {
array,
date,
commonDataTypes: dataTypes,
dataTypes,
enum: Enum,
Enum,
err: error,
error,
find: search,
func: func,
function: func,
functionUtils: func,
genericDataTypes: dataTypes,
isNode,
locale,
math: number,
num: number,
number,
numeric: number,
stream,
object,
url,
search,
srch: search,
stacktrace: error,
str: string,
string,
type: types,
types,
typing: types,
validation,
};
// Easier to access the 'pseudo-namespaced' mUtils/madUtils module.
export {mUtils as __};
export {mUtils as m_};
export {mUtils as madUtils};