@wisemen/quantity 0.5.0 → 0.6.1
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/LICENSE.md +59 -0
- package/dist/quantities/current/current.column.d.ts +3 -2
- package/dist/quantities/current/current.column.js.map +1 -1
- package/dist/quantities/current/current.dto.d.ts +2 -1
- package/dist/quantities/current/current.dto.js +4 -1
- package/dist/quantities/current/current.dto.js.map +1 -1
- package/dist/quantities/current/index.d.ts +1 -0
- package/dist/quantities/current/index.js +1 -0
- package/dist/quantities/current/index.js.map +1 -1
- package/dist/quantities/current/is-current.validator.d.ts +4 -0
- package/dist/quantities/current/is-current.validator.js +7 -0
- package/dist/quantities/current/is-current.validator.js.map +1 -0
- package/dist/quantities/distance/distance.column.d.ts +3 -2
- package/dist/quantities/distance/distance.column.js.map +1 -1
- package/dist/quantities/distance/distance.d.ts +0 -6
- package/dist/quantities/distance/distance.dto.d.ts +2 -1
- package/dist/quantities/distance/distance.dto.js +4 -1
- package/dist/quantities/distance/distance.dto.js.map +1 -1
- package/dist/quantities/distance/distance.js +0 -15
- package/dist/quantities/distance/distance.js.map +1 -1
- package/dist/quantities/distance/index.d.ts +1 -0
- package/dist/quantities/distance/index.js +1 -0
- package/dist/quantities/distance/index.js.map +1 -1
- package/dist/quantities/distance/is-distance.validator.d.ts +4 -0
- package/dist/quantities/distance/is-distance.validator.js +7 -0
- package/dist/quantities/distance/is-distance.validator.js.map +1 -0
- package/dist/quantities/distance/tests/distance.unit.test.js +0 -9
- package/dist/quantities/distance/tests/distance.unit.test.js.map +1 -1
- package/dist/quantities/duration/duration.column.d.ts +3 -2
- package/dist/quantities/duration/duration.column.js.map +1 -1
- package/dist/quantities/duration/duration.d.ts +0 -1
- package/dist/quantities/duration/duration.dto.d.ts +2 -1
- package/dist/quantities/duration/duration.dto.js +4 -1
- package/dist/quantities/duration/duration.dto.js.map +1 -1
- package/dist/quantities/duration/duration.js +0 -3
- package/dist/quantities/duration/duration.js.map +1 -1
- package/dist/quantities/duration/index.d.ts +1 -0
- package/dist/quantities/duration/index.js +1 -0
- package/dist/quantities/duration/index.js.map +1 -1
- package/dist/quantities/duration/is-duration.validator.d.ts +4 -0
- package/dist/quantities/duration/is-duration.validator.js +7 -0
- package/dist/quantities/duration/is-duration.validator.js.map +1 -0
- package/dist/quantities/energy/energy.column.d.ts +3 -2
- package/dist/quantities/energy/energy.column.js.map +1 -1
- package/dist/quantities/energy/energy.dto.d.ts +2 -1
- package/dist/quantities/energy/energy.dto.js +4 -1
- package/dist/quantities/energy/energy.dto.js.map +1 -1
- package/dist/quantities/energy/index.d.ts +1 -0
- package/dist/quantities/energy/index.js +1 -0
- package/dist/quantities/energy/index.js.map +1 -1
- package/dist/quantities/energy/is-energy.validator.d.ts +4 -0
- package/dist/quantities/energy/is-energy.validator.js +7 -0
- package/dist/quantities/energy/is-energy.validator.js.map +1 -0
- package/dist/quantities/mass/index.d.ts +1 -0
- package/dist/quantities/mass/index.js +1 -0
- package/dist/quantities/mass/index.js.map +1 -1
- package/dist/quantities/mass/is-mass.validator.d.ts +4 -0
- package/dist/quantities/mass/is-mass.validator.js +7 -0
- package/dist/quantities/mass/is-mass.validator.js.map +1 -0
- package/dist/quantities/mass/mass.column.d.ts +3 -2
- package/dist/quantities/mass/mass.column.js.map +1 -1
- package/dist/quantities/mass/mass.dto.d.ts +2 -1
- package/dist/quantities/mass/mass.dto.js +4 -1
- package/dist/quantities/mass/mass.dto.js.map +1 -1
- package/dist/quantities/power/index.d.ts +1 -0
- package/dist/quantities/power/index.js +1 -0
- package/dist/quantities/power/index.js.map +1 -1
- package/dist/quantities/power/is-power.validator.d.ts +4 -0
- package/dist/quantities/power/is-power.validator.js +7 -0
- package/dist/quantities/power/is-power.validator.js.map +1 -0
- package/dist/quantities/power/power.column.d.ts +3 -2
- package/dist/quantities/power/power.column.js.map +1 -1
- package/dist/quantities/power/power.dto.d.ts +2 -1
- package/dist/quantities/power/power.dto.js +4 -1
- package/dist/quantities/power/power.dto.js.map +1 -1
- package/dist/quantities/speed/index.d.ts +1 -0
- package/dist/quantities/speed/index.js +1 -0
- package/dist/quantities/speed/index.js.map +1 -1
- package/dist/quantities/speed/is-speed.validator.d.ts +4 -0
- package/dist/quantities/speed/is-speed.validator.js +7 -0
- package/dist/quantities/speed/is-speed.validator.js.map +1 -0
- package/dist/quantities/speed/speed.column.d.ts +3 -2
- package/dist/quantities/speed/speed.column.js.map +1 -1
- package/dist/quantities/speed/speed.dto.d.ts +2 -1
- package/dist/quantities/speed/speed.dto.js +4 -1
- package/dist/quantities/speed/speed.dto.js.map +1 -1
- package/dist/quantities/temperature/index.d.ts +1 -0
- package/dist/quantities/temperature/index.js +1 -0
- package/dist/quantities/temperature/index.js.map +1 -1
- package/dist/quantities/temperature/is-temperature.validator.d.ts +4 -0
- package/dist/quantities/temperature/is-temperature.validator.js +7 -0
- package/dist/quantities/temperature/is-temperature.validator.js.map +1 -0
- package/dist/quantities/temperature/temperature.dto.d.ts +2 -1
- package/dist/quantities/temperature/temperature.dto.js +4 -1
- package/dist/quantities/temperature/temperature.dto.js.map +1 -1
- package/dist/quantities/voltage/is-voltage.validator.d.ts +4 -0
- package/dist/quantities/voltage/is-voltage.validator.js +7 -0
- package/dist/quantities/voltage/is-voltage.validator.js.map +1 -0
- package/dist/quantities/voltage/voltage.column.d.ts +3 -2
- package/dist/quantities/voltage/voltage.column.js.map +1 -1
- package/dist/quantities/voltage/voltage.dto.d.ts +2 -1
- package/dist/quantities/voltage/voltage.dto.js +4 -1
- package/dist/quantities/voltage/voltage.dto.js.map +1 -1
- package/dist/quantities/voltage/voltage.js +3 -3
- package/dist/quantities/voltage/voltage.js.map +1 -1
- package/dist/quantity.column.d.ts +5 -1
- package/dist/quantity.column.js +5 -6
- package/dist/quantity.column.js.map +1 -1
- package/dist/quantity.dto.d.ts +4 -0
- package/dist/quantity.dto.js +3 -0
- package/dist/quantity.dto.js.map +1 -0
- package/dist/validators/is-quantity.decorator.d.ts +9 -0
- package/dist/validators/is-quantity.decorator.js +22 -0
- package/dist/validators/is-quantity.decorator.js.map +1 -0
- package/dist/validators/max-quantity.validator.d.ts +8 -0
- package/dist/validators/max-quantity.validator.js +18 -0
- package/dist/validators/max-quantity.validator.js.map +1 -0
- package/dist/validators/min-quantity.validator.d.ts +8 -0
- package/dist/validators/min-quantity.validator.js +18 -0
- package/dist/validators/min-quantity.validator.js.map +1 -0
- package/dist/validators/tests/is-quantity.decorator.unit.test.d.ts +1 -0
- package/dist/validators/tests/is-quantity.decorator.unit.test.js +170 -0
- package/dist/validators/tests/is-quantity.decorator.unit.test.js.map +1 -0
- package/package.json +28 -23
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"min-quantity.validator.js","sourceRoot":"","sources":["../../lib/validators/min-quantity.validator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAGhD,MAAM,OAAO,oBAAoB;IAGrB;IADV,YACU,GAAM;QAAN,QAAG,GAAH,GAAG,CAAG;IACb,CAAC;IAEJ,QAAQ,CAAE,CAAU,EAAE,KAA0B;QAC9C,IAAI,CAAC,CAAC,CAAC,YAAY,WAAW,CAAC,EAAE,CAAC;YAChC,OAAO,KAAK,CAAA;QACd,CAAC;QAED,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,EAAO,CAAA;QAE5B,OAAO,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAA;IAC5C,CAAC;IAED,cAAc,CAAE,IAAyB;QACvC,OAAO,GAAG,IAAI,CAAC,QAAQ,eAAe,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAA;IAC7D,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { describe, it } from 'node:test';
|
|
11
|
+
import { plainToInstance } from 'class-transformer';
|
|
12
|
+
import { validate } from 'class-validator';
|
|
13
|
+
import { expect } from 'expect';
|
|
14
|
+
import { Distance } from '../../quantities/distance/distance.js';
|
|
15
|
+
import { DistanceUnit } from '../../quantities/distance/distance-unit.enum.js';
|
|
16
|
+
import { DistanceDto } from '../../quantities/distance/distance.dto.js';
|
|
17
|
+
import { IsQuantity } from '../is-quantity.decorator.js';
|
|
18
|
+
describe('is quantity decorator tests', () => {
|
|
19
|
+
describe('min option', () => {
|
|
20
|
+
class MinDistanceTestDto {
|
|
21
|
+
distance;
|
|
22
|
+
}
|
|
23
|
+
__decorate([
|
|
24
|
+
IsQuantity(DistanceDto, { min: new Distance(10, DistanceUnit.METER) }),
|
|
25
|
+
__metadata("design:type", DistanceDto)
|
|
26
|
+
], MinDistanceTestDto.prototype, "distance", void 0);
|
|
27
|
+
it('detects validation errors when the distance is less than the minimum', async () => {
|
|
28
|
+
const dto = plainToInstance(MinDistanceTestDto, { distance: {
|
|
29
|
+
value: 5,
|
|
30
|
+
unit: DistanceUnit.METER
|
|
31
|
+
} });
|
|
32
|
+
const errors = await validate(dto);
|
|
33
|
+
expect(errors.length).toBeGreaterThan(0);
|
|
34
|
+
});
|
|
35
|
+
it('passes a distance exactly at the minimum', async () => {
|
|
36
|
+
const dto = plainToInstance(MinDistanceTestDto, { distance: {
|
|
37
|
+
value: 10,
|
|
38
|
+
unit: DistanceUnit.METER
|
|
39
|
+
} });
|
|
40
|
+
const errors = await validate(dto);
|
|
41
|
+
expect(errors).toHaveLength(0);
|
|
42
|
+
});
|
|
43
|
+
it('passes a distance above the minimum', async () => {
|
|
44
|
+
const dto = plainToInstance(MinDistanceTestDto, { distance: {
|
|
45
|
+
value: 20,
|
|
46
|
+
unit: DistanceUnit.METER
|
|
47
|
+
} });
|
|
48
|
+
const errors = await validate(dto);
|
|
49
|
+
expect(errors).toHaveLength(0);
|
|
50
|
+
});
|
|
51
|
+
it('passes a distance above the minimum expressed in a different unit', async () => {
|
|
52
|
+
const dto = plainToInstance(MinDistanceTestDto, { distance: {
|
|
53
|
+
value: 0.02,
|
|
54
|
+
unit: DistanceUnit.KILOMETER
|
|
55
|
+
} });
|
|
56
|
+
const errors = await validate(dto);
|
|
57
|
+
expect(errors).toHaveLength(0);
|
|
58
|
+
});
|
|
59
|
+
it('detects validation errors when the distance is less than the minimum expressed in a different unit', async () => {
|
|
60
|
+
const dto = plainToInstance(MinDistanceTestDto, { distance: {
|
|
61
|
+
value: 0.005,
|
|
62
|
+
unit: DistanceUnit.KILOMETER
|
|
63
|
+
} });
|
|
64
|
+
const errors = await validate(dto);
|
|
65
|
+
expect(errors.length).toBeGreaterThan(0);
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
describe('max option', () => {
|
|
69
|
+
class MaxDistanceTestDto {
|
|
70
|
+
distance;
|
|
71
|
+
}
|
|
72
|
+
__decorate([
|
|
73
|
+
IsQuantity(DistanceDto, { max: new Distance(100, DistanceUnit.METER) }),
|
|
74
|
+
__metadata("design:type", DistanceDto)
|
|
75
|
+
], MaxDistanceTestDto.prototype, "distance", void 0);
|
|
76
|
+
it('detects validation errors when the distance exceeds the maximum', async () => {
|
|
77
|
+
const dto = plainToInstance(MaxDistanceTestDto, { distance: {
|
|
78
|
+
value: 150,
|
|
79
|
+
unit: DistanceUnit.METER
|
|
80
|
+
} });
|
|
81
|
+
const errors = await validate(dto);
|
|
82
|
+
expect(errors.length).toBeGreaterThan(0);
|
|
83
|
+
});
|
|
84
|
+
it('passes a distance exactly at the maximum', async () => {
|
|
85
|
+
const dto = plainToInstance(MaxDistanceTestDto, { distance: {
|
|
86
|
+
value: 100,
|
|
87
|
+
unit: DistanceUnit.METER
|
|
88
|
+
} });
|
|
89
|
+
const errors = await validate(dto);
|
|
90
|
+
expect(errors).toHaveLength(0);
|
|
91
|
+
});
|
|
92
|
+
it('passes a distance below the maximum', async () => {
|
|
93
|
+
const dto = plainToInstance(MaxDistanceTestDto, { distance: {
|
|
94
|
+
value: 50,
|
|
95
|
+
unit: DistanceUnit.METER
|
|
96
|
+
} });
|
|
97
|
+
const errors = await validate(dto);
|
|
98
|
+
expect(errors).toHaveLength(0);
|
|
99
|
+
});
|
|
100
|
+
it('passes a distance below the maximum expressed in a different unit', async () => {
|
|
101
|
+
const dto = plainToInstance(MaxDistanceTestDto, { distance: {
|
|
102
|
+
value: 0.05,
|
|
103
|
+
unit: DistanceUnit.KILOMETER
|
|
104
|
+
} });
|
|
105
|
+
const errors = await validate(dto);
|
|
106
|
+
expect(errors).toHaveLength(0);
|
|
107
|
+
});
|
|
108
|
+
it('detects validation errors when the distance exceeds the maximum expressed in a different unit', async () => {
|
|
109
|
+
const dto = plainToInstance(MaxDistanceTestDto, { distance: {
|
|
110
|
+
value: 0.2,
|
|
111
|
+
unit: DistanceUnit.KILOMETER
|
|
112
|
+
} });
|
|
113
|
+
const errors = await validate(dto);
|
|
114
|
+
expect(errors.length).toBeGreaterThan(0);
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
describe('min and max options together', () => {
|
|
118
|
+
class MinMaxDistanceTestDto {
|
|
119
|
+
distance;
|
|
120
|
+
}
|
|
121
|
+
__decorate([
|
|
122
|
+
IsQuantity(DistanceDto, {
|
|
123
|
+
min: new Distance(10, DistanceUnit.METER),
|
|
124
|
+
max: new Distance(100, DistanceUnit.METER)
|
|
125
|
+
}),
|
|
126
|
+
__metadata("design:type", DistanceDto)
|
|
127
|
+
], MinMaxDistanceTestDto.prototype, "distance", void 0);
|
|
128
|
+
it('detects validation errors when the distance is below the minimum', async () => {
|
|
129
|
+
const dto = plainToInstance(MinMaxDistanceTestDto, { distance: {
|
|
130
|
+
value: 5,
|
|
131
|
+
unit: DistanceUnit.METER
|
|
132
|
+
} });
|
|
133
|
+
const errors = await validate(dto);
|
|
134
|
+
expect(errors.length).toBeGreaterThan(0);
|
|
135
|
+
});
|
|
136
|
+
it('detects validation errors when the distance exceeds the maximum', async () => {
|
|
137
|
+
const dto = plainToInstance(MinMaxDistanceTestDto, { distance: {
|
|
138
|
+
value: 150,
|
|
139
|
+
unit: DistanceUnit.METER
|
|
140
|
+
} });
|
|
141
|
+
const errors = await validate(dto);
|
|
142
|
+
expect(errors.length).toBeGreaterThan(0);
|
|
143
|
+
});
|
|
144
|
+
it('passes a distance within the range', async () => {
|
|
145
|
+
const dto = plainToInstance(MinMaxDistanceTestDto, { distance: {
|
|
146
|
+
value: 50,
|
|
147
|
+
unit: DistanceUnit.METER
|
|
148
|
+
} });
|
|
149
|
+
const errors = await validate(dto);
|
|
150
|
+
expect(errors).toHaveLength(0);
|
|
151
|
+
});
|
|
152
|
+
it('passes a distance at the minimum boundary', async () => {
|
|
153
|
+
const dto = plainToInstance(MinMaxDistanceTestDto, { distance: {
|
|
154
|
+
value: 10,
|
|
155
|
+
unit: DistanceUnit.METER
|
|
156
|
+
} });
|
|
157
|
+
const errors = await validate(dto);
|
|
158
|
+
expect(errors).toHaveLength(0);
|
|
159
|
+
});
|
|
160
|
+
it('passes a distance at the maximum boundary', async () => {
|
|
161
|
+
const dto = plainToInstance(MinMaxDistanceTestDto, { distance: {
|
|
162
|
+
value: 100,
|
|
163
|
+
unit: DistanceUnit.METER
|
|
164
|
+
} });
|
|
165
|
+
const errors = await validate(dto);
|
|
166
|
+
expect(errors).toHaveLength(0);
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
//# sourceMappingURL=is-quantity.decorator.unit.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-quantity.decorator.unit.test.js","sourceRoot":"","sources":["../../../lib/validators/tests/is-quantity.decorator.unit.test.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAA;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAA;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAExD,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;QAC1B,MAAM,kBAAkB;YAEtB,QAAQ,CAAa;SACtB;QADC;YADC,UAAU,CAAC,WAAW,EAAE,EAAE,GAAG,EAAE,IAAI,QAAQ,CAAC,EAAE,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;sCAC7D,WAAW;4DAAA;QAGvB,EAAE,CAAC,sEAAsE,EAAE,KAAK,IAAI,EAAE;YACpF,MAAM,GAAG,GAAG,eAAe,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE;oBAC1D,KAAK,EAAE,CAAC;oBACR,IAAI,EAAE,YAAY,CAAC,KAAK;iBACzB,EAAE,CAAC,CAAA;YAEJ,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAA;YAElC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,EAAE,CAAC,CAAA;YAEJ,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAA;YAElC,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;QAChC,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,2CAA2C,EAAE,KAAK,IAAI,EAAE;YACzD,MAAM,GAAG,GAAG,eAAe,CAAC,qBAAqB,EAAE,EAAE,QAAQ,EAAE;oBAC7D,KAAK,EAAE,EAAE;oBACT,IAAI,EAAE,YAAY,CAAC,KAAK;iBACzB,EAAE,CAAC,CAAA;YAEJ,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAA;YAElC,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;QAChC,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,2CAA2C,EAAE,KAAK,IAAI,EAAE;YACzD,MAAM,GAAG,GAAG,eAAe,CAAC,qBAAqB,EAAE,EAAE,QAAQ,EAAE;oBAC7D,KAAK,EAAE,GAAG;oBACV,IAAI,EAAE,YAAY,CAAC,KAAK;iBACzB,EAAE,CAAC,CAAA;YAEJ,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAA;YAElC,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;QAChC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,40 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wisemen/quantity",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
4
7
|
"main": "./dist/index.js",
|
|
5
8
|
"types": "./dist/index.d.ts",
|
|
6
9
|
"type": "module",
|
|
7
10
|
"files": [
|
|
8
11
|
"dist/"
|
|
9
12
|
],
|
|
10
|
-
"scripts": {
|
|
11
|
-
"prebuild": "rm -rf ./dist",
|
|
12
|
-
"clean": "rm -rf ./dist",
|
|
13
|
-
"build": "tsc",
|
|
14
|
-
"pretest": "npm run clean && npm run build",
|
|
15
|
-
"test": "node --test ./dist/**/*.test.js",
|
|
16
|
-
"lint": "eslint --cache",
|
|
17
|
-
"prerelease": "npm run build",
|
|
18
|
-
"release": "pnpx release-it"
|
|
19
|
-
},
|
|
20
13
|
"peerDependencies": {
|
|
21
|
-
"@nestjs/common": "
|
|
22
|
-
"@nestjs/swagger": "
|
|
23
|
-
"
|
|
24
|
-
"class-
|
|
25
|
-
"
|
|
26
|
-
"typeorm": "^0.3.28"
|
|
14
|
+
"@nestjs/common": ">=11.1.17",
|
|
15
|
+
"@nestjs/swagger": ">=11.2.6",
|
|
16
|
+
"class-transformer": ">=0.5.1",
|
|
17
|
+
"class-validator": ">=0.15.1",
|
|
18
|
+
"typeorm": ">=0.3.28"
|
|
27
19
|
},
|
|
28
20
|
"devDependencies": {
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
21
|
+
"eslint": "9.39.4",
|
|
22
|
+
"expect": "30.2.0",
|
|
23
|
+
"typescript": ">=4.8.4 <=5.9.3",
|
|
24
|
+
"@wisemen/eslint-config-nestjs": "0.2.13"
|
|
33
25
|
},
|
|
34
26
|
"author": "Maarten Sijmkens",
|
|
35
27
|
"license": "GPL",
|
|
36
28
|
"repository": {
|
|
37
29
|
"type": "git",
|
|
38
|
-
"url": "
|
|
30
|
+
"url": "https://github.com/wisemen-digital/wisemen-core",
|
|
31
|
+
"directory": "packages/quantity"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@wisemen/nestjs-typeorm": "0.2.1"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"clean": "rm -rf ./dist",
|
|
38
|
+
"build": "tsc",
|
|
39
|
+
"pretest": "pnpm run build",
|
|
40
|
+
"test": "node --test './dist/**/*.test.js'",
|
|
41
|
+
"lint": "eslint --cache",
|
|
42
|
+
"prerelease": "npm run build",
|
|
43
|
+
"release": "pnpx release-it"
|
|
39
44
|
}
|
|
40
|
-
}
|
|
45
|
+
}
|