express-sweet 2.0.1 → 2.0.2

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/package.json CHANGED
@@ -1,9 +1,16 @@
1
1
  {
2
2
  "name": "express-sweet",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Express Extension.",
5
- "main": "dist/build.common.js",
6
- "module": "dist/build.esm.js",
5
+ "type": "module",
6
+ "main": "dist/build.cjs",
7
+ "module": "dist/build.mjs",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/build.mjs",
11
+ "require": "./dist/build.cjs"
12
+ }
13
+ },
7
14
  "types": "types/index.d.ts",
8
15
  "files": [
9
16
  "dist/",
@@ -22,9 +29,6 @@
22
29
  "prewatch": "rm -rf dist types",
23
30
  "watch": "node --max-old-space-size=8192 node_modules/rollup/dist/bin/rollup -c rollup.config.js --watch"
24
31
  },
25
- "_moduleAliases": {
26
- "~": "dist"
27
- },
28
32
  "repository": {
29
33
  "type": "git",
30
34
  "url": "git+https://github.com/takuya-motoshima/express-sweet.git"
@@ -65,20 +69,17 @@
65
69
  "body-parser": "^1.19.0",
66
70
  "connect-redis": "^7.1.0",
67
71
  "cookie-parser": "~1.4.4",
68
- "cors": "^2.8.5",
69
- "debug": "~2.6.9",
70
72
  "dotenv": "^8.2.0",
71
- "express": "^4.18.3",
72
- "express-hbs": "^2.3.3",
73
+ "express": "^4.19.2",
74
+ "express-hbs": "^2.5.0",
73
75
  "express-session": "^1.18.0",
74
76
  "glob": "^10.3.12",
75
77
  "handlebars-extd": "^1.0.7",
76
78
  "hbs": "~4.0.4",
77
79
  "http-errors": "~1.6.3",
78
80
  "mariadb": "^3.2.3",
79
- "module-alias": "^2.2.2",
80
81
  "moment": "^2.30.1",
81
- "morgan": "~1.9.1",
82
+ "morgan": "^1.10.0",
82
83
  "multer": "^1.4.5-lts.1",
83
84
  "passport": "^0.4.1",
84
85
  "passport-local": "^1.0.0",
@@ -86,23 +87,23 @@
86
87
  "sequelize": "^6.37.1"
87
88
  },
88
89
  "devDependencies": {
89
- "@rollup/plugin-alias": "^5.0.0",
90
- "@rollup/plugin-commonjs": "^25.0.4",
91
- "@rollup/plugin-node-resolve": "^15.2.1",
92
- "@rollup/plugin-terser": "^0.4.3",
90
+ "@rollup/plugin-alias": "^5.1.0",
91
+ "@rollup/plugin-commonjs": "^26.0.1",
92
+ "@rollup/plugin-node-resolve": "^15.2.3",
93
+ "@rollup/plugin-terser": "^0.4.4",
93
94
  "@types/cookie-parser": "^1.4.2",
94
- "@types/debug": "^4.1.5",
95
95
  "@types/express": "^4.17.21",
96
96
  "@types/express-session": "^1.18.0",
97
97
  "@types/glob": "^8.1.0",
98
98
  "@types/http-errors": "^1.8.0",
99
+ "@types/morgan": "^1.9.9",
99
100
  "@types/multer": "^1.4.11",
100
- "@types/node": "^14.18.32",
101
+ "@types/node": "^22.5.1",
101
102
  "@types/passport": "^1.0.6",
102
103
  "@types/passport-local": "^1.0.33",
103
- "rollup": "^2.79.1",
104
+ "rollup": "^4.21.2",
104
105
  "rollup-plugin-json": "^4.0.0",
105
- "rollup-plugin-typescript2": "^0.35.0",
106
- "typescript": "^5.2.2"
106
+ "rollup-plugin-typescript2": "^0.36.0",
107
+ "typescript": "^5.5.4"
107
108
  }
108
109
  }
@@ -26,28 +26,28 @@ declare const _default: {
26
26
  readonly modelManager: import("sequelize/types/model-manager").ModelManager;
27
27
  readonly connectionManager: import("sequelize/types/dialects/abstract/connection-manager").ConnectionManager;
28
28
  readonly models: {
29
- [key: string]: sequelize.ModelCtor<sequelize.Model<any, any>>;
29
+ [key: string]: sequelize.ModelCtor<sequelize.Model>;
30
30
  };
31
- beforeValidate(name: string, fn: (instance: sequelize.Model<any, any>, options: import("sequelize/types/instance-validator").ValidationOptions) => void): void;
32
- beforeValidate(fn: (instance: sequelize.Model<any, any>, options: import("sequelize/types/instance-validator").ValidationOptions) => void): void;
33
- afterValidate(name: string, fn: (instance: sequelize.Model<any, any>, options: import("sequelize/types/instance-validator").ValidationOptions) => void): void;
34
- afterValidate(fn: (instance: sequelize.Model<any, any>, options: import("sequelize/types/instance-validator").ValidationOptions) => void): void;
35
- beforeCreate(name: string, fn: (attributes: sequelize.Model<any, any>, options: sequelize.CreateOptions<any>) => void): void;
36
- beforeCreate(fn: (attributes: sequelize.Model<any, any>, options: sequelize.CreateOptions<any>) => void): void;
37
- afterCreate(name: string, fn: (attributes: sequelize.Model<any, any>, options: sequelize.CreateOptions<any>) => void): void;
38
- afterCreate(fn: (attributes: sequelize.Model<any, any>, options: sequelize.CreateOptions<any>) => void): void;
39
- beforeDestroy(name: string, fn: (instance: sequelize.Model<any, any>, options: sequelize.InstanceDestroyOptions) => void): void;
40
- beforeDestroy(fn: (instance: sequelize.Model<any, any>, options: sequelize.InstanceDestroyOptions) => void): void;
41
- afterDestroy(name: string, fn: (instance: sequelize.Model<any, any>, options: sequelize.InstanceDestroyOptions) => void): void;
42
- afterDestroy(fn: (instance: sequelize.Model<any, any>, options: sequelize.InstanceDestroyOptions) => void): void;
43
- beforeUpdate(name: string, fn: (instance: sequelize.Model<any, any>, options: sequelize.UpdateOptions<any>) => void): void;
44
- beforeUpdate(fn: (instance: sequelize.Model<any, any>, options: sequelize.UpdateOptions<any>) => void): void;
45
- afterUpdate(name: string, fn: (instance: sequelize.Model<any, any>, options: sequelize.UpdateOptions<any>) => void): void;
46
- afterUpdate(fn: (instance: sequelize.Model<any, any>, options: sequelize.UpdateOptions<any>) => void): void;
47
- beforeBulkCreate(name: string, fn: (instances: sequelize.Model<any, any>[], options: sequelize.BulkCreateOptions<any>) => void): void;
48
- beforeBulkCreate(fn: (instances: sequelize.Model<any, any>[], options: sequelize.BulkCreateOptions<any>) => void): void;
49
- afterBulkCreate(name: string, fn: (instances: sequelize.Model<any, any>[], options: sequelize.BulkCreateOptions<any>) => void): void;
50
- afterBulkCreate(fn: (instances: sequelize.Model<any, any>[], options: sequelize.BulkCreateOptions<any>) => void): void;
31
+ beforeValidate(name: string, fn: (instance: sequelize.Model, options: import("sequelize/types/instance-validator").ValidationOptions) => void): void;
32
+ beforeValidate(fn: (instance: sequelize.Model, options: import("sequelize/types/instance-validator").ValidationOptions) => void): void;
33
+ afterValidate(name: string, fn: (instance: sequelize.Model, options: import("sequelize/types/instance-validator").ValidationOptions) => void): void;
34
+ afterValidate(fn: (instance: sequelize.Model, options: import("sequelize/types/instance-validator").ValidationOptions) => void): void;
35
+ beforeCreate(name: string, fn: (attributes: sequelize.Model, options: sequelize.CreateOptions<any>) => void): void;
36
+ beforeCreate(fn: (attributes: sequelize.Model, options: sequelize.CreateOptions<any>) => void): void;
37
+ afterCreate(name: string, fn: (attributes: sequelize.Model, options: sequelize.CreateOptions<any>) => void): void;
38
+ afterCreate(fn: (attributes: sequelize.Model, options: sequelize.CreateOptions<any>) => void): void;
39
+ beforeDestroy(name: string, fn: (instance: sequelize.Model, options: sequelize.InstanceDestroyOptions) => void): void;
40
+ beforeDestroy(fn: (instance: sequelize.Model, options: sequelize.InstanceDestroyOptions) => void): void;
41
+ afterDestroy(name: string, fn: (instance: sequelize.Model, options: sequelize.InstanceDestroyOptions) => void): void;
42
+ afterDestroy(fn: (instance: sequelize.Model, options: sequelize.InstanceDestroyOptions) => void): void;
43
+ beforeUpdate(name: string, fn: (instance: sequelize.Model, options: sequelize.UpdateOptions<any>) => void): void;
44
+ beforeUpdate(fn: (instance: sequelize.Model, options: sequelize.UpdateOptions<any>) => void): void;
45
+ afterUpdate(name: string, fn: (instance: sequelize.Model, options: sequelize.UpdateOptions<any>) => void): void;
46
+ afterUpdate(fn: (instance: sequelize.Model, options: sequelize.UpdateOptions<any>) => void): void;
47
+ beforeBulkCreate(name: string, fn: (instances: sequelize.Model[], options: sequelize.BulkCreateOptions<any>) => void): void;
48
+ beforeBulkCreate(fn: (instances: sequelize.Model[], options: sequelize.BulkCreateOptions<any>) => void): void;
49
+ afterBulkCreate(name: string, fn: (instances: sequelize.Model[], options: sequelize.BulkCreateOptions<any>) => void): void;
50
+ afterBulkCreate(fn: (instances: sequelize.Model[], options: sequelize.BulkCreateOptions<any>) => void): void;
51
51
  beforeBulkDestroy(name: string, fn: (options: sequelize.BulkCreateOptions<any>) => void): void;
52
52
  beforeBulkDestroy(fn: (options: sequelize.BulkCreateOptions<any>) => void): void;
53
53
  afterBulkDestroy(name: string, fn: (options: sequelize.DestroyOptions<any>) => void): void;
@@ -62,10 +62,10 @@ declare const _default: {
62
62
  beforeFindAfterExpandIncludeAll(fn: (options: sequelize.FindOptions<any>) => void): void;
63
63
  beforeFindAfterOptions(name: string, fn: (options: sequelize.FindOptions<any>) => void): void;
64
64
  beforeFindAfterOptions(fn: (options: sequelize.FindOptions<any>) => void): void;
65
- afterFind(name: string, fn: (instancesOrInstance: sequelize.Model<any, any> | sequelize.Model<any, any>[] | null, options: sequelize.FindOptions<any>) => void): void;
66
- afterFind(fn: (instancesOrInstance: sequelize.Model<any, any> | sequelize.Model<any, any>[] | null, options: sequelize.FindOptions<any>) => void): void;
67
- beforeDefine(name: string, fn: (attributes: sequelize.ModelAttributes<sequelize.Model<any, any>, any>, options: sequelize.ModelOptions<sequelize.Model<any, any>>) => void): void;
68
- beforeDefine(fn: (attributes: sequelize.ModelAttributes<sequelize.Model<any, any>, any>, options: sequelize.ModelOptions<sequelize.Model<any, any>>) => void): void;
65
+ afterFind(name: string, fn: (instancesOrInstance: sequelize.Model[] | sequelize.Model | null, options: sequelize.FindOptions<any>) => void): void;
66
+ afterFind(fn: (instancesOrInstance: sequelize.Model[] | sequelize.Model | null, options: sequelize.FindOptions<any>) => void): void;
67
+ beforeDefine(name: string, fn: (attributes: sequelize.ModelAttributes<sequelize.Model, any>, options: sequelize.ModelOptions) => void): void;
68
+ beforeDefine(fn: (attributes: sequelize.ModelAttributes<sequelize.Model, any>, options: sequelize.ModelOptions) => void): void;
69
69
  afterDefine(name: string, fn: (model: sequelize.ModelType) => void): void;
70
70
  afterDefine(fn: (model: sequelize.ModelType) => void): void;
71
71
  beforeInit(name: string, fn: (config: sequelize.Config, options: sequelize.Options) => void): void;
@@ -83,8 +83,8 @@ declare const _default: {
83
83
  getDialect(): string;
84
84
  getDatabaseName(): string;
85
85
  getQueryInterface(): sequelize.QueryInterface;
86
- define<M extends sequelize.Model<any, any>, TAttributes = sequelize.Attributes<M>>(modelName: string, attributes: sequelize.ModelAttributes<M, TAttributes>, options?: sequelize.ModelOptions<M> | undefined): sequelize.ModelCtor<M>;
87
- model(modelName: string): sequelize.ModelCtor<sequelize.Model<any, any>>;
86
+ define<M extends sequelize.Model, TAttributes = sequelize.Attributes<M>>(modelName: string, attributes: sequelize.ModelAttributes<M, TAttributes>, options?: sequelize.ModelOptions<M>): sequelize.ModelCtor<M>;
87
+ model(modelName: string): sequelize.ModelCtor<sequelize.Model>;
88
88
  isDefined(modelName: string): boolean;
89
89
  query(sql: string | {
90
90
  query: string;
@@ -118,26 +118,26 @@ declare const _default: {
118
118
  query: string;
119
119
  values: unknown[];
120
120
  }, options: sequelize.QueryOptionsWithType<sequelize.QueryTypes.DESCRIBE>): Promise<sequelize.ColumnsDescription>;
121
- query<M_1 extends sequelize.Model<any, any>>(sql: string | {
121
+ query<M extends sequelize.Model>(sql: string | {
122
122
  query: string;
123
123
  values: unknown[];
124
- }, options: sequelize.QueryOptionsWithModel<M_1> & {
124
+ }, options: sequelize.QueryOptionsWithModel<M> & {
125
125
  plain: true;
126
- }): Promise<M_1 | null>;
127
- query<M_2 extends sequelize.Model<any, any>>(sql: string | {
126
+ }): Promise<M | null>;
127
+ query<M extends sequelize.Model>(sql: string | {
128
128
  query: string;
129
129
  values: unknown[];
130
- }, options: sequelize.QueryOptionsWithModel<M_2>): Promise<M_2[]>;
130
+ }, options: sequelize.QueryOptionsWithModel<M>): Promise<M[]>;
131
131
  query<T extends object>(sql: string | {
132
132
  query: string;
133
133
  values: unknown[];
134
134
  }, options: sequelize.QueryOptionsWithType<sequelize.QueryTypes.SELECT> & {
135
135
  plain: true;
136
136
  }): Promise<T | null>;
137
- query<T_1 extends object>(sql: string | {
137
+ query<T extends object>(sql: string | {
138
138
  query: string;
139
139
  values: unknown[];
140
- }, options: sequelize.QueryOptionsWithType<sequelize.QueryTypes.SELECT>): Promise<T_1[]>;
140
+ }, options: sequelize.QueryOptionsWithType<sequelize.QueryTypes.SELECT>): Promise<T[]>;
141
141
  query(sql: string | {
142
142
  query: string;
143
143
  values: unknown[];
@@ -149,7 +149,7 @@ declare const _default: {
149
149
  query(sql: string | {
150
150
  query: string;
151
151
  values: unknown[];
152
- }, options?: sequelize.QueryOptions | sequelize.QueryOptionsWithType<sequelize.QueryTypes.RAW> | undefined): Promise<[unknown[], unknown]>;
152
+ }, options?: sequelize.QueryOptions | sequelize.QueryOptionsWithType<sequelize.QueryTypes.RAW>): Promise<[unknown[], unknown]>;
153
153
  random(): sequelize.Utils.Fn;
154
154
  set(variables: object, options: sequelize.QueryOptionsTransactionRequired): Promise<unknown>;
155
155
  escape(value: string | number | Date): string;
@@ -157,23 +157,23 @@ declare const _default: {
157
157
  showAllSchemas(options: sequelize.Logging): Promise<object[]>;
158
158
  dropSchema(schema: string, options: sequelize.Logging): Promise<unknown[]>;
159
159
  dropAllSchemas(options: sequelize.Logging): Promise<unknown[]>;
160
- sync(options?: sequelize.SyncOptions | undefined): Promise<any>;
161
- truncate(options?: sequelize.DestroyOptions<any> | undefined): Promise<unknown[]>;
162
- drop(options?: sequelize.DropOptions | undefined): Promise<unknown[]>;
163
- authenticate(options?: sequelize.QueryOptions | undefined): Promise<void>;
164
- validate(options?: sequelize.QueryOptions | undefined): Promise<void>;
165
- transaction<T_2>(options: sequelize.TransactionOptions, autoCallback: (t: sequelize.Transaction) => PromiseLike<T_2>): Promise<T_2>;
166
- transaction<T_3>(autoCallback: (t: sequelize.Transaction) => PromiseLike<T_3>): Promise<T_3>;
167
- transaction(options?: sequelize.TransactionOptions | undefined): Promise<sequelize.Transaction>;
160
+ sync(options?: sequelize.SyncOptions): Promise<any>;
161
+ truncate(options?: sequelize.DestroyOptions<any>): Promise<unknown[]>;
162
+ drop(options?: sequelize.DropOptions): Promise<unknown[]>;
163
+ authenticate(options?: sequelize.QueryOptions): Promise<void>;
164
+ validate(options?: sequelize.QueryOptions): Promise<void>;
165
+ transaction<T>(options: sequelize.TransactionOptions, autoCallback: (t: sequelize.Transaction) => PromiseLike<T>): Promise<T>;
166
+ transaction<T>(autoCallback: (t: sequelize.Transaction) => PromiseLike<T>): Promise<T>;
167
+ transaction(options?: sequelize.TransactionOptions): Promise<sequelize.Transaction>;
168
168
  close(): Promise<void>;
169
169
  databaseVersion(): Promise<string>;
170
170
  _model: sequelize.Model<any, any>;
171
171
  _attributes: any;
172
172
  _creationAttributes: any;
173
- addHook<K extends keyof import("sequelize/types/hooks").SequelizeHooks<M_3, TModelAttributes, TCreationAttributes>>(hookType: K, name: string, fn: import("sequelize/types/hooks").SequelizeHooks<sequelize.Model<any, any>, any, any>[K]): any;
174
- addHook<K_1 extends keyof import("sequelize/types/hooks").SequelizeHooks<M_3, TModelAttributes, TCreationAttributes>>(hookType: K_1, fn: import("sequelize/types/hooks").SequelizeHooks<sequelize.Model<any, any>, any, any>[K_1]): any;
175
- removeHook<K_2 extends keyof import("sequelize/types/hooks").SequelizeHooks<M_3, TModelAttributes, TCreationAttributes>>(hookType: K_2, name: string): any;
176
- hasHook<K_3 extends keyof import("sequelize/types/hooks").SequelizeHooks<M_3, TModelAttributes, TCreationAttributes>>(hookType: K_3): boolean;
177
- hasHooks<K_4 extends keyof import("sequelize/types/hooks").SequelizeHooks<M_3, TModelAttributes, TCreationAttributes>>(hookType: K_4): boolean;
173
+ addHook<K extends keyof import("sequelize/types/hooks").SequelizeHooks<sequelize.Model<any, any>, any, any>>(hookType: K, name: string, fn: import("sequelize/types/hooks").SequelizeHooks<sequelize.Model<any, any>, any, any>[K]): any;
174
+ addHook<K extends keyof import("sequelize/types/hooks").SequelizeHooks<sequelize.Model<any, any>, any, any>>(hookType: K, fn: import("sequelize/types/hooks").SequelizeHooks<sequelize.Model<any, any>, any, any>[K]): any;
175
+ removeHook<K extends keyof import("sequelize/types/hooks").SequelizeHooks<sequelize.Model<any, any>, any, any>>(hookType: K, name: string): any;
176
+ hasHook<K extends keyof import("sequelize/types/hooks").SequelizeHooks<sequelize.Model<any, any>, any, any>>(hookType: K): boolean;
177
+ hasHooks<K extends keyof import("sequelize/types/hooks").SequelizeHooks<sequelize.Model<any, any>, any, any>>(hookType: K): boolean;
178
178
  };
179
179
  export default _default;
@@ -3,4 +3,5 @@
3
3
  * All models must be pre-loaded before associating models.So it loads and caches all defined models in advance.
4
4
  * This must be done before any method that may load other models is called.
5
5
  */
6
- export default function (): void;
6
+ declare const _default: () => void;
7
+ export default _default;
@@ -11,7 +11,7 @@
11
11
  * @param {any} value2 Second value to be compared with first.
12
12
  * @return {boolean} Returns true if the value and type are the same, false if they are different.
13
13
  */
14
- export declare function eq(value1: any, value2: any): boolean;
14
+ export declare const eq: (value1: any, value2: any) => boolean;
15
15
  /**
16
16
  * Determine whether or not two values are equal (==) i.e weak checking.
17
17
  * @example
@@ -25,7 +25,7 @@ export declare function eq(value1: any, value2: any): boolean;
25
25
  * @param {any} value2 Second value to be compared with first.
26
26
  * @return {boolean} Returns true if the values are the same, false if they are different.
27
27
  */
28
- export declare function eqw(value1: any, value2: any): boolean;
28
+ export declare const eqw: (value1: any, value2: any) => boolean;
29
29
  /**
30
30
  * Determine whether or not two values are not equal (!==).
31
31
  * @example
@@ -39,7 +39,7 @@ export declare function eqw(value1: any, value2: any): boolean;
39
39
  * @param {any} value2 Second value to be compared with first.
40
40
  * @return {boolean} Returns true if the value and type are different, false if they are the same.
41
41
  */
42
- export declare function neq(value1: any, value2: any): boolean;
42
+ export declare const neq: (value1: any, value2: any) => boolean;
43
43
  /**
44
44
  * Determine whether or not two values are not equal (!=) weak checking.
45
45
  * @example
@@ -53,7 +53,7 @@ export declare function neq(value1: any, value2: any): boolean;
53
53
  * @param {any} value2 Second value to be compared with first.
54
54
  * @return {boolean} Returns true if the values are different, false if they are the same.
55
55
  */
56
- export declare function neqw(value1: any, value2: any): boolean;
56
+ export declare const neqw: (value1: any, value2: any) => boolean;
57
57
  /**
58
58
  * Check for less than condition (a < b).
59
59
  * @example
@@ -67,7 +67,7 @@ export declare function neqw(value1: any, value2: any): boolean;
67
67
  * @param {any} value2 Second value to be compared with first.
68
68
  * @return {boolean} Returns true if the first value is less than the second value, false otherwise.
69
69
  */
70
- export declare function lt(value1: any, value2: any): boolean;
70
+ export declare const lt: (value1: any, value2: any) => boolean;
71
71
  /**
72
72
  * Check for less than or equals condition (a <= b).
73
73
  * @example
@@ -81,7 +81,7 @@ export declare function lt(value1: any, value2: any): boolean;
81
81
  * @param {any} value2 Second value to be compared with first.
82
82
  * @return {boolean} Returns true if the first value is less than or equal to the second value, false otherwise.
83
83
  */
84
- export declare function lte(value1: any, value2: any): boolean;
84
+ export declare const lte: (value1: any, value2: any) => boolean;
85
85
  /**
86
86
  * Check for greater than condition (a > b).
87
87
  * @example
@@ -95,7 +95,7 @@ export declare function lte(value1: any, value2: any): boolean;
95
95
  * @param {any} value2 Second value to be compared with first.
96
96
  * @return {boolean} Returns true if the first value exceeds the second value, false otherwise.
97
97
  */
98
- export declare function gt(value1: any, value2: any): boolean;
98
+ export declare const gt: (value1: any, value2: any) => boolean;
99
99
  /**
100
100
  * Check for greater than or equals condition (a >= b).
101
101
  * @example
@@ -109,7 +109,7 @@ export declare function gt(value1: any, value2: any): boolean;
109
109
  * @param {any} value2 Second value to be compared with first.
110
110
  * @return {boolean} Returns true if the first value is greater than or equal to the second value, false otherwise.
111
111
  */
112
- export declare function gte(value1: any, value2: any): boolean;
112
+ export declare const gte: (value1: any, value2: any) => boolean;
113
113
  /**
114
114
  * Logical NOT of any expression.
115
115
  * @example
@@ -125,7 +125,7 @@ export declare function gte(value1: any, value2: any): boolean;
125
125
  * @param {any} expression Any expression.
126
126
  * @return {boolean} Returns the logical negation of the value.
127
127
  */
128
- export declare function not(expression: any): boolean;
128
+ export declare const not: (expression: any) => boolean;
129
129
  /**
130
130
  * Helper to imitate the ternary '?:' conditional operator.
131
131
  * @example
@@ -152,7 +152,7 @@ export declare function not(expression: any): boolean;
152
152
  * @param {any} value2 Second value to be displayed as result. Defaults to an empty string.
153
153
  * @return {any} Returns the result of the ternary operator.
154
154
  */
155
- export declare function ifx(condition: boolean, value1: any, value2: any): any;
155
+ export declare const ifx: (condition: boolean, value1: any, value2: any) => any;
156
156
  /**
157
157
  * Check if it is empty.
158
158
  * If the value is an array, returns true if there are no elements.
@@ -176,7 +176,7 @@ export declare function ifx(condition: boolean, value1: any, value2: any): any;
176
176
  * @param {any} value Character strings, arrays, objects, etc. to be checked.
177
177
  * @return {boolean} Returns true if the value is empty, false otherwise.
178
178
  */
179
- export declare function empty(value: any): boolean;
179
+ export declare const empty: (value: any) => boolean;
180
180
  /**
181
181
  * Check that it is not empty.
182
182
  * If the value is an array, returns true if there is an element.
@@ -200,7 +200,7 @@ export declare function empty(value: any): boolean;
200
200
  * @param {any} value Character strings, arrays, objects, etc. to be checked.
201
201
  * @return {boolean} Returns true if the value is not empty, false otherwise.
202
202
  */
203
- export declare function notEmpty(value: any): boolean;
203
+ export declare const notEmpty: (value: any) => boolean;
204
204
  /**
205
205
  * Determine the length of an array.
206
206
  *
@@ -210,7 +210,7 @@ export declare function notEmpty(value: any): boolean;
210
210
  * @param {any[]} items Array whose elements to be counted.
211
211
  * @return {number|false} Returns the length of the array if the value is an array, false if the value is not an array.
212
212
  */
213
- export declare function count(items: any[]): number | false;
213
+ export declare const count: (items: any[]) => number | false;
214
214
  /**
215
215
  * Returns the boolean AND of two or more parameters passed i.e it is true iff all the parameters are true.
216
216
  * @example
@@ -228,7 +228,7 @@ export declare function count(items: any[]): number | false;
228
228
  * @param {...any} params Any number of boolean parameters.
229
229
  * @return {boolean} Returns the result of the logical product.
230
230
  */
231
- export declare function and(...params: any[]): boolean;
231
+ export declare const and: (...params: any[]) => boolean;
232
232
  /**
233
233
  * Returns the boolean OR of two or more parameters passed i.e it is true if any of the parameters is true.
234
234
  * @example
@@ -246,7 +246,7 @@ export declare function and(...params: any[]): boolean;
246
246
  * @param {...any} params Any number of boolean parameters.
247
247
  * @return {boolean} Returns the result of the OR.
248
248
  */
249
- export declare function or(...params: any[]): boolean;
249
+ export declare const or: (...params: any[]) => boolean;
250
250
  /**
251
251
  * Returns the first non-falsy value from the parameter list.
252
252
  * Works quite similar to the SQL's "COALESCE()" function, but unlike this checks for the first non-false parameter.
@@ -259,7 +259,7 @@ export declare function or(...params: any[]): boolean;
259
259
  * @param {...any} params Any number of parameters.
260
260
  * @return {any} Returns the first non-false element of the parameter.
261
261
  */
262
- export declare function coalesce(...params: any[]): any;
262
+ export declare const coalesce: (...params: any[]) => any;
263
263
  /**
264
264
  * Returns boolean if the array contains the element strictly or non-strictly.
265
265
  * @example
@@ -285,7 +285,7 @@ export declare function coalesce(...params: any[]): any;
285
285
  * @param {boolean} strict FALSE for non-strict checking. TRUE by default.
286
286
  * @return {boolean} Returns true if the array contains the specified value, false otherwise.
287
287
  */
288
- export declare function includes(items: any[], value: any, strict?: boolean): boolean;
288
+ export declare const includes: (items: any[], value: any, strict?: boolean) => boolean;
289
289
  /**
290
290
  * Returns true if the given str matches the given regex.
291
291
  * @example
@@ -313,4 +313,4 @@ export declare function includes(items: any[], value: any, strict?: boolean): bo
313
313
  * @param {string} flags? Regular expression flags, such as global and case-insensitive searches. The default is none (undefined).
314
314
  * @return {boolean} true if there is a match between the regular expression and the string str. Otherwise, false.
315
315
  */
316
- export declare function regexMatch(val: string, pattern: string, flags?: string): boolean;
316
+ export declare const regexMatch: (val: string, pattern: string, flags?: string) => boolean;
@@ -14,4 +14,4 @@
14
14
  * @param {string|string[]} locale Language or language-country locale string (or array of strings) available in https://github.com/moment/moment/tree/develop/locale .
15
15
  * @return {string} Returns formatted date.
16
16
  */
17
- export declare function formatDate(format: string, date: string, locale: string | string[]): string;
17
+ export declare const formatDate: (format: string, date: string, locale: string | string[]) => string;
@@ -7,4 +7,4 @@
7
7
  * @param {string} baseUrl Application Origin URL. The default is none (undefined).
8
8
  * @return {string} Returns the Assets file path with the update date and time parameters.
9
9
  */
10
- export declare function cacheBusting(filePath: string, baseUrl?: string): string;
10
+ export declare const cacheBusting: (filePath: string, baseUrl?: string) => string;
@@ -7,7 +7,7 @@
7
7
  * @param {number|string} val2 The second number.
8
8
  * @return {number}
9
9
  */
10
- export declare function add(val1: number | string, val2: number | string): number;
10
+ export declare const add: (val1: number | string, val2: number | string) => number;
11
11
  /**
12
12
  * Calculates the difference of the given values.
13
13
  * @example
@@ -17,7 +17,7 @@ export declare function add(val1: number | string, val2: number | string): numbe
17
17
  * @param {number|string} val2 The second number.
18
18
  * @return {number}
19
19
  */
20
- export declare function sub(val1: number | string, val2: number | string): number;
20
+ export declare const sub: (val1: number | string, val2: number | string) => number;
21
21
  /**
22
22
  * Calculate the multiplication of the given values.
23
23
  * @example
@@ -27,7 +27,7 @@ export declare function sub(val1: number | string, val2: number | string): numbe
27
27
  * @param {number|string} val2 The second number.
28
28
  * @return {number}
29
29
  */
30
- export declare function multiply(val1: number | string, val2: number | string): number;
30
+ export declare const multiply: (val1: number | string, val2: number | string) => number;
31
31
  /**
32
32
  * Compute the division of the given values.
33
33
  * @example
@@ -37,7 +37,7 @@ export declare function multiply(val1: number | string, val2: number | string):
37
37
  * @param {number|string} val2 The second number.
38
38
  * @return {number}
39
39
  */
40
- export declare function divide(val1: number | string, val2: number | string): number;
40
+ export declare const divide: (val1: number | string, val2: number | string) => number;
41
41
  /**
42
42
  * Round up the value.
43
43
  * @example
@@ -46,7 +46,7 @@ export declare function divide(val1: number | string, val2: number | string): nu
46
46
  * @param {number|string} val Number to be rounded to nearest greater integer.
47
47
  * @return {number}
48
48
  */
49
- export declare function ceil(val: number | string): number;
49
+ export declare const ceil: (val: number | string) => number;
50
50
  /**
51
51
  * Rounds down a number.
52
52
  * @example
@@ -55,7 +55,7 @@ export declare function ceil(val: number | string): number;
55
55
  * @param {number|string} val Number to be rounded to nearest lower integer.
56
56
  * @return {number}
57
57
  */
58
- export declare function floor(val: number | string): number;
58
+ export declare const floor: (val: number | string) => number;
59
59
  /**
60
60
  * Returns an absolute value.
61
61
  * @example
@@ -64,4 +64,4 @@ export declare function floor(val: number | string): number;
64
64
  * @param {number} val Number to perform absolute value operation on.
65
65
  * @return {number}
66
66
  */
67
- export declare function abs(val: number | string): number;
67
+ export declare const abs: (val: number | string) => number;
@@ -13,4 +13,4 @@
13
13
  * In implementations without Intl.NumberFormat support, this parameter is ignored and the host's locale is usually used.
14
14
  * @return {string} A string with a language-sensitive representation of the given number.
15
15
  */
16
- export declare function number2locale(val: number | string, locales?: string): string;
16
+ export declare const number2locale: (val: number | string, locales?: string) => string;
@@ -6,7 +6,7 @@
6
6
  * @param {number} indent The number of space characters to use as whitespace.
7
7
  * @return {string} A JSON string representing the given value, or undefined.
8
8
  */
9
- export declare function jsonStringify(value: any, indent?: number | string): string | undefined;
9
+ export declare const jsonStringify: (value: any, indent?: number | string) => string | undefined;
10
10
  /**
11
11
  * Parses the given string using JSON.parse.
12
12
  * @example
@@ -14,4 +14,4 @@ export declare function jsonStringify(value: any, indent?: number | string): str
14
14
  * @param {any} value Object to stringify.
15
15
  * @return {any} JavaScript value or object described by a string.
16
16
  */
17
- export declare function jsonParse(value: any): any;
17
+ export declare const jsonParse: (value: any) => any;
@@ -7,7 +7,7 @@
7
7
  * @param {string} replace The string to replace.
8
8
  * @return {string} Character string after replacement.
9
9
  */
10
- export declare function replace(value: string, find: string, replace: string): string;
10
+ export declare const replace: (value: string, find: string, replace: string) => string;
11
11
  /**
12
12
  * Split `string` by the given `character`.
13
13
  * @example
@@ -22,7 +22,7 @@ export declare function replace(value: string, find: string, replace: string): s
22
22
  * @param {string} separator A character that delimits the substrings in this string. Default is a comma.
23
23
  * @return {string[]} An Array of strings, split at each point where the separator occurs in the given string. The default is a comma.
24
24
  */
25
- export declare function split(value: string, separator: string): string[];
25
+ export declare const split: (value: string, separator: string) => string[];
26
26
  /**
27
27
  * Convert bytes to just the right units(KB, MB, GB, TB, PB, EB, ZB, YB).
28
28
  * @example
@@ -41,4 +41,4 @@ export declare function split(value: string, separator: string): string[];
41
41
  * @param {number} decimals Number of decimal places to display. Default is 0.
42
42
  * @return {string} Returns a value with units.
43
43
  */
44
- export declare function formatBytes(bytes: number, decimals?: number): string;
44
+ export declare const formatBytes: (bytes: number, decimals?: number) => string;
package/types/index.d.ts CHANGED
@@ -3,5 +3,4 @@ export * as database from '~/database';
3
3
  export * as services from '~/services';
4
4
  export * as utils from '~/utils';
5
5
  export * as middlewares from '~/middlewares';
6
- export * as exceptions from '~/exceptions';
7
6
  export * as interfaces from '~/interfaces';
@@ -1,4 +1,3 @@
1
- /// <reference types="cookie-parser" />
2
1
  import express from 'express';
3
2
  /**
4
3
  * User authentication configuration interface.
@@ -1,4 +1,3 @@
1
- /// <reference types="cookie-parser" />
2
1
  import express from 'express';
3
2
  /**
4
3
  * Express Sweet basic configuration interface.
@@ -1,4 +1,3 @@
1
- /// <reference types="cookie-parser" />
2
1
  import express from 'express';
3
2
  /**
4
3
  * View's configuration interface.
package/types/mount.d.ts CHANGED
@@ -3,4 +3,5 @@ import express from 'express';
3
3
  * Mount extensions on your application.
4
4
  * @param {express.Express} app Express application instance
5
5
  */
6
- export default function (app: express.Express): void;
6
+ declare const _default: (app: express.Express) => void;
7
+ export default _default;
@@ -1,4 +1,3 @@
1
- /// <reference types="cookie-parser" />
2
1
  import express from 'express';
3
2
  /**
4
3
  * User authentication service.
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Extend a Global object.
3
+ */
4
+ declare global {
5
+ /**
6
+ * Application root directory.
7
+ * @type {string}
8
+ */
9
+ var APP_DIR: string;
10
+ /**
11
+ * Flag to prevent multiple loading of env.
12
+ * True if env has already been loaded.
13
+ * @type {boolean}
14
+ */
15
+ var loadedEnv: boolean;
16
+ }
17
+ export {};