@nest-yalc-2/utils 2.0.0 → 2.1.0
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 +1 -1
- package/src/index.d.ts +19 -1
- package/src/index.js +19 -1
- package/src/index.js.map +1 -1
- package/src/index.ts +21 -1
- package/src/object-mapper.interceptor.d.ts +1 -1
- package/src/object-mapper.interceptor.js +3 -3
- package/src/object-mapper.interceptor.js.map +1 -1
- package/src/object-mapper.interceptor.ts +1 -1
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
export * from '@node-yalc/utils';
|
|
1
|
+
export * from '@node-yalc/utils/class.helper';
|
|
2
|
+
export * from '@node-yalc/utils/custom-validator';
|
|
3
|
+
export * from '@node-yalc/utils/data-structure.helper';
|
|
4
|
+
export * from '@node-yalc/utils/date.helper';
|
|
5
|
+
export * from '@node-yalc/utils/encryption.helper';
|
|
6
|
+
export * from '@node-yalc/utils/enum.helper';
|
|
7
|
+
export * from '@node-yalc/utils/env.helper';
|
|
8
|
+
export * from '@node-yalc/utils/error.helper';
|
|
9
|
+
export * from '@node-yalc/utils/interval.helper';
|
|
2
10
|
export * from './nestjs/nest.decorator.js';
|
|
11
|
+
export * from '@node-yalc/utils/object.helper';
|
|
12
|
+
export * from '@node-yalc/utils/object-mapper.helper';
|
|
3
13
|
export * from './object-mapper.interceptor.js';
|
|
14
|
+
export * from '@node-yalc/utils/returnValue';
|
|
15
|
+
export * from '@node-yalc/utils/validator-helper';
|
|
16
|
+
export * from '@node-yalc/utils/zlib.helper';
|
|
17
|
+
export * from '@node-yalc/utils/command.helper';
|
|
18
|
+
export * from '@node-yalc/utils/files.helper';
|
|
19
|
+
export * from '@node-yalc/utils/rxjs.helper';
|
|
20
|
+
export * from '@node-yalc/utils/math.helper';
|
|
21
|
+
export * from '@node-yalc/utils/config-manager.helper';
|
package/src/index.js
CHANGED
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("@node-yalc/utils"), exports);
|
|
4
|
+
tslib_1.__exportStar(require("@node-yalc/utils/class.helper"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("@node-yalc/utils/custom-validator"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("@node-yalc/utils/data-structure.helper"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("@node-yalc/utils/date.helper"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("@node-yalc/utils/encryption.helper"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("@node-yalc/utils/enum.helper"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("@node-yalc/utils/env.helper"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("@node-yalc/utils/error.helper"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("@node-yalc/utils/interval.helper"), exports);
|
|
5
13
|
tslib_1.__exportStar(require("./nestjs/nest.decorator.js"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("@node-yalc/utils/object.helper"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("@node-yalc/utils/object-mapper.helper"), exports);
|
|
6
16
|
tslib_1.__exportStar(require("./object-mapper.interceptor.js"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("@node-yalc/utils/returnValue"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("@node-yalc/utils/validator-helper"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("@node-yalc/utils/zlib.helper"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("@node-yalc/utils/command.helper"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("@node-yalc/utils/files.helper"), exports);
|
|
22
|
+
tslib_1.__exportStar(require("@node-yalc/utils/rxjs.helper"), exports);
|
|
23
|
+
tslib_1.__exportStar(require("@node-yalc/utils/math.helper"), exports);
|
|
24
|
+
tslib_1.__exportStar(require("@node-yalc/utils/config-manager.helper"), exports);
|
|
7
25
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,wEAA8C;AAC9C,4EAAkD;AAClD,iFAAuD;AACvD,uEAA6C;AAC7C,6EAAmD;AACnD,uEAA6C;AAC7C,sEAA4C;AAC5C,wEAA8C;AAE9C,2EAAiD;AACjD,qEAA2C;AAC3C,yEAA+C;AAC/C,gFAAsD;AACtD,yEAA+C;AAE/C,uEAA6C;AAC7C,4EAAkD;AAClD,uEAA6C;AAC7C,0EAAgD;AAChD,wEAA8C;AAC9C,uEAA6C;AAC7C,uEAA6C;AAC7C,iFAAuD"}
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
-
export * from '@node-yalc/utils';
|
|
1
|
+
export * from '@node-yalc/utils/class.helper';
|
|
2
|
+
export * from '@node-yalc/utils/custom-validator';
|
|
3
|
+
export * from '@node-yalc/utils/data-structure.helper';
|
|
4
|
+
export * from '@node-yalc/utils/date.helper';
|
|
5
|
+
export * from '@node-yalc/utils/encryption.helper';
|
|
6
|
+
export * from '@node-yalc/utils/enum.helper';
|
|
7
|
+
export * from '@node-yalc/utils/env.helper';
|
|
8
|
+
export * from '@node-yalc/utils/error.helper';
|
|
9
|
+
// export * from '@node-yalc/utils/faker-helper';
|
|
10
|
+
export * from '@node-yalc/utils/interval.helper';
|
|
2
11
|
export * from './nestjs/nest.decorator.js';
|
|
12
|
+
export * from '@node-yalc/utils/object.helper';
|
|
13
|
+
export * from '@node-yalc/utils/object-mapper.helper';
|
|
3
14
|
export * from './object-mapper.interceptor.js';
|
|
15
|
+
// export * from '@node-yalc/utils/promise.helper';
|
|
16
|
+
export * from '@node-yalc/utils/returnValue';
|
|
17
|
+
export * from '@node-yalc/utils/validator-helper';
|
|
18
|
+
export * from '@node-yalc/utils/zlib.helper';
|
|
19
|
+
export * from '@node-yalc/utils/command.helper';
|
|
20
|
+
export * from '@node-yalc/utils/files.helper';
|
|
21
|
+
export * from '@node-yalc/utils/rxjs.helper';
|
|
22
|
+
export * from '@node-yalc/utils/math.helper';
|
|
23
|
+
export * from '@node-yalc/utils/config-manager.helper';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CallHandler, ExecutionContext } from '@nestjs/common';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { ObjectMapperType } from '@node-yalc/utils/object-mapper.helper
|
|
3
|
+
import { ObjectMapperType } from '@node-yalc/utils/object-mapper.helper';
|
|
4
4
|
export declare function objectMapperInterceptor<TInputObject extends Record<string, any>, TOutputObject extends Record<string, any>>(mapper: ObjectMapperType<TInputObject, TOutputObject>, options?: {
|
|
5
5
|
copyNonMappedProperties?: boolean;
|
|
6
6
|
transformData?: {
|
|
@@ -4,7 +4,7 @@ exports.objectMapperInterceptor = objectMapperInterceptor;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const common_1 = require("@nestjs/common");
|
|
6
6
|
const rxjs_1 = require("rxjs");
|
|
7
|
-
const
|
|
7
|
+
const object_mapper_helper_1 = require("@node-yalc/utils/object-mapper.helper");
|
|
8
8
|
function objectMapperInterceptor(mapper, options = {}) {
|
|
9
9
|
let ObjectMapperInterceptor = class ObjectMapperInterceptor {
|
|
10
10
|
intercept(_context, next) {
|
|
@@ -13,10 +13,10 @@ function objectMapperInterceptor(mapper, options = {}) {
|
|
|
13
13
|
? options.transformData(data)
|
|
14
14
|
: data;
|
|
15
15
|
if (Array.isArray(_data)) {
|
|
16
|
-
const result = _data.map((item) => (0,
|
|
16
|
+
const result = _data.map((item) => (0, object_mapper_helper_1.objectMapper)(item, mapper));
|
|
17
17
|
return options.callback?.(data, result) ?? result;
|
|
18
18
|
}
|
|
19
|
-
const result = (0,
|
|
19
|
+
const result = (0, object_mapper_helper_1.objectMapper)(_data, mapper, {
|
|
20
20
|
copyNonMappedProperties: options.copyNonMappedProperties,
|
|
21
21
|
});
|
|
22
22
|
return options.callback?.(data, result) ?? result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object-mapper.interceptor.js","sourceRoot":"","sources":["object-mapper.interceptor.ts"],"names":[],"mappings":";;AASA,0DAyCC;;AAlDD,2CAKwB;AACxB,+BAAuC;AACvC,
|
|
1
|
+
{"version":3,"file":"object-mapper.interceptor.js","sourceRoot":"","sources":["object-mapper.interceptor.ts"],"names":[],"mappings":";;AASA,0DAyCC;;AAlDD,2CAKwB;AACxB,+BAAuC;AACvC,gFAAuF;AAEvF,SAAgB,uBAAuB,CAIrC,MAAqD,EACrD,UASI,EAAE;IAGN,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;QAC3B,SAAS,CAAC,QAA0B,EAAE,IAAiB;YACrD,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CACvB,IAAA,UAAG,EAAC,CAAC,IAAI,EAAE,EAAE;gBACX,MAAM,KAAK,GAAG,OAAO,CAAC,aAAa;oBACjC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC;oBAC7B,CAAC,CAAC,IAAI,CAAC;gBAET,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;oBACzB,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,mCAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;oBAC/D,OAAO,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC;gBACpD,CAAC;gBAED,MAAM,MAAM,GAAG,IAAA,mCAAY,EAAC,KAAK,EAAE,MAAM,EAAE;oBACzC,uBAAuB,EAAE,OAAO,CAAC,uBAAuB;iBACzD,CAAC,CAAC;gBAEH,OAAO,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC;YACpD,CAAC,CAAC,CACH,CAAC;QACJ,CAAC;KACF,CAAA;IArBK,uBAAuB;QAD5B,IAAA,mBAAU,GAAE;OACP,uBAAuB,CAqB5B;IAED,OAAO,uBAAuB,CAAC;AACjC,CAAC"}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
NestInterceptor,
|
|
6
6
|
} from '@nestjs/common';
|
|
7
7
|
import { Observable, map } from 'rxjs';
|
|
8
|
-
import { objectMapper, ObjectMapperType } from '@node-yalc/utils/object-mapper.helper
|
|
8
|
+
import { objectMapper, ObjectMapperType } from '@node-yalc/utils/object-mapper.helper';
|
|
9
9
|
|
|
10
10
|
export function objectMapperInterceptor<
|
|
11
11
|
TInputObject extends Record<string, any>,
|