mapper-factory 1.0.40 → 1.0.42
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/dist/class.decorator.d.ts +2 -2
- package/dist/class.decorator.js +4 -4
- package/dist/example.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare function
|
|
2
|
-
export interface
|
|
1
|
+
export declare function MapClass(): (constructor: any) => void;
|
|
2
|
+
export interface MapInterface<T> {
|
|
3
3
|
from: (object?: any) => T;
|
|
4
4
|
toMap: () => any;
|
|
5
5
|
toModel: (object: any) => T;
|
package/dist/class.decorator.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const functions_1 = require("
|
|
5
|
-
function
|
|
3
|
+
exports.MapClass = void 0;
|
|
4
|
+
const functions_1 = require("./functions");
|
|
5
|
+
function MapClass() {
|
|
6
6
|
return function (constructor) {
|
|
7
7
|
constructor.prototype.from = functions_1.constructorMap;
|
|
8
8
|
constructor.prototype.toMap = functions_1.toMap;
|
|
@@ -14,4 +14,4 @@ function MapperFactory() {
|
|
|
14
14
|
constructor.prototype.copy = functions_1.copy;
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
exports.
|
|
17
|
+
exports.MapClass = MapClass;
|
package/dist/example.js
CHANGED
|
@@ -167,7 +167,7 @@ __decorate([
|
|
|
167
167
|
__metadata("design:type", String)
|
|
168
168
|
], Test.prototype, "a", void 0);
|
|
169
169
|
Test = __decorate([
|
|
170
|
-
(0, class_decorator_1.
|
|
170
|
+
(0, class_decorator_1.MapClass)()
|
|
171
171
|
], Test);
|
|
172
172
|
const test = new Test().from();
|
|
173
173
|
console.log("TEST 1: ", test);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { MapClass, MapInterface } from "./class.decorator";
|
|
1
2
|
import { MapField } from "./field.decorator";
|
|
2
3
|
import { MapperFactory } from "./mapper";
|
|
3
4
|
import { objToModel, toMap, toModel } from "./mapper-functions";
|
|
4
5
|
import { ClassType } from "./types";
|
|
5
|
-
export { ClassType, MapField, MapperFactory, objToModel, toMap, toModel };
|
|
6
|
+
export { ClassType, MapClass, MapField, MapInterface, MapperFactory, objToModel, toMap, toModel };
|
|
6
7
|
/**
|
|
7
8
|
* npx tsc
|
|
8
9
|
* npx ts-node src/example.ts
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toModel = exports.toMap = exports.objToModel = exports.MapperFactory = exports.MapField = void 0;
|
|
3
|
+
exports.toModel = exports.toMap = exports.objToModel = exports.MapperFactory = exports.MapField = exports.MapClass = void 0;
|
|
4
|
+
const class_decorator_1 = require("./class.decorator");
|
|
5
|
+
Object.defineProperty(exports, "MapClass", { enumerable: true, get: function () { return class_decorator_1.MapClass; } });
|
|
4
6
|
const field_decorator_1 = require("./field.decorator");
|
|
5
7
|
Object.defineProperty(exports, "MapField", { enumerable: true, get: function () { return field_decorator_1.MapField; } });
|
|
6
8
|
const mapper_1 = require("./mapper");
|