Skip to content

Commit

Permalink
Merge 1a52ead into 6b20019
Browse files Browse the repository at this point in the history
  • Loading branch information
milosbugarinovic committed Feb 24, 2021
2 parents 6b20019 + 1a52ead commit ca80cc0
Show file tree
Hide file tree
Showing 24 changed files with 168 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/async.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export declare const async: {
/**
* Wrap async express http request end return promise or call next on catch
* @param _target
* @param _key
* @param descriptor
*/
httpErrorHandler: (_target: any, _key: string, descriptor: TypedPropertyDescriptor<any>) => any;
};
//# sourceMappingURL=async.d.ts.map
1 change: 1 addition & 0 deletions lib/async.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions lib/async.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/async.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export * from './time-util';
export * from './regex-util';
export * from './async';
export * from './validation-util';
//# sourceMappingURL=index.d.ts.map
1 change: 1 addition & 0 deletions lib/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/index.test.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//# sourceMappingURL=index.test.d.ts.map
1 change: 1 addition & 0 deletions lib/index.test.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions lib/index.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/index.test.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions lib/regex-util.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export declare const regexUtil: {
uuid: () => string;
};
//# sourceMappingURL=regex-util.d.ts.map
1 change: 1 addition & 0 deletions lib/regex-util.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions lib/regex-util.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/regex-util.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions lib/time-util.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export declare type DurationUnit = 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'years';
export declare type AddByOptions = {
unit: DurationUnit;
value: number;
};
export declare const timeUtil: {
dateToUnix: (date?: Date) => number;
dateToUnixSec: (date?: Date) => number;
addToDate: (addBy: AddByOptions, date?: Date) => Date;
unixToDate: (unix: number) => Date;
};
//# sourceMappingURL=time-util.d.ts.map
1 change: 1 addition & 0 deletions lib/time-util.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions lib/time-util.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/time-util.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions lib/validation-util.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { ObjectSchema, Schema, ValidationOptions } from 'joi';
export declare type validationUtilOptions = {
logger: any;
};
export declare const validationUtil: {
/**
* Validate and clean object
* @param {Partial<T>} objectToValidate
* @param {Joi.Schema | Joi.ObjectSchema<T>} schema
* @param {validationUtilOptions | undefined} validationUtilOptions
* @returns {T} expected object after validation
*/
sanitize: <T>(objectToValidate: Partial<T>, schema: import("joi").AnySchema | import("joi").ArraySchema | import("joi").AlternativesSchema | import("joi").BinarySchema | import("joi").BooleanSchema | import("joi").DateSchema | import("joi").FunctionSchema | import("joi").NumberSchema | import("joi").StringSchema | import("joi").LinkSchema | import("joi").SymbolSchema | ObjectSchema<any> | ObjectSchema<T>, validationUtilOptions?: validationUtilOptions | undefined) => T;
/**
* Only validate properties specified in validation schema
* @param {Partial<T>} objectToValidate
* @param {Joi.Schema | ObjectSchema<T>} schema
* @param {validationUtilOptions | undefined} validationUtilOptions
* @returns {T} expected object after validation
*/
validate: <T_1>(objectToValidate: Partial<T_1>, schema: import("joi").AnySchema | import("joi").ArraySchema | import("joi").AlternativesSchema | import("joi").BinarySchema | import("joi").BooleanSchema | import("joi").DateSchema | import("joi").FunctionSchema | import("joi").NumberSchema | import("joi").StringSchema | import("joi").LinkSchema | import("joi").SymbolSchema | ObjectSchema<any> | ObjectSchema<T_1>, validationUtilOptions?: validationUtilOptions | undefined) => T_1;
_validate: <T_2>(objectToValidate: Partial<T_2>, schema: import("joi").AnySchema | import("joi").ArraySchema | import("joi").AlternativesSchema | import("joi").BinarySchema | import("joi").BooleanSchema | import("joi").DateSchema | import("joi").FunctionSchema | import("joi").NumberSchema | import("joi").StringSchema | import("joi").LinkSchema | import("joi").SymbolSchema | ObjectSchema<any> | ObjectSchema<T_2>, validationOptions?: ValidationOptions, options?: validationUtilOptions | undefined) => T_2;
};
//# sourceMappingURL=validation-util.d.ts.map
1 change: 1 addition & 0 deletions lib/validation-util.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions lib/validation-util.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/validation-util.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ca80cc0

Please sign in to comment.