@invariant--labs/foundation 1.1.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/.pnp.cjs +22192 -0
- package/.pnp.loader.mjs +2126 -0
- package/.yarnrc.yml +1 -0
- package/CHANGELOG.md +527 -0
- package/README.md +3 -0
- package/eslint.config.mjs +52 -0
- package/invariant.json +22 -0
- package/jest/jest.config.base.ts +30 -0
- package/jest/jest.spec.base.ts +7 -0
- package/jest.config.js +49 -0
- package/package.json +99 -0
- package/src/core/application/index.ts +1 -0
- package/src/core/application/persistence/index.ts +3 -0
- package/src/core/application/persistence/query-builder.ts +2 -0
- package/src/core/application/persistence/read-projection.ts +2 -0
- package/src/core/application/persistence/repository.ts +23 -0
- package/src/core/domain/entities/aggregate-root.ts +34 -0
- package/src/core/domain/entities/entity.spec.ts +43 -0
- package/src/core/domain/entities/entity.ts +29 -0
- package/src/core/domain/entities/identifier.spec.ts +34 -0
- package/src/core/domain/entities/identifier.ts +16 -0
- package/src/core/domain/entities/index.ts +5 -0
- package/src/core/domain/entities/projection.ts +7 -0
- package/src/core/domain/entities/unique-entity-id.ts +9 -0
- package/src/core/domain/events/domain-event.ts +7 -0
- package/src/core/domain/events/index.ts +1 -0
- package/src/core/domain/index.ts +3 -0
- package/src/core/domain/value-objects/index.ts +2 -0
- package/src/core/domain/value-objects/range.ts +4 -0
- package/src/core/domain/value-objects/value-object.spec.ts +45 -0
- package/src/core/domain/value-objects/value-object.ts +17 -0
- package/src/core/errors/command-failure.error.spec.ts +30 -0
- package/src/core/errors/command-failure.error.ts +9 -0
- package/src/core/errors/command-filter.error.ts +3 -0
- package/src/core/errors/detailed.error.ts +25 -0
- package/src/core/errors/domain.error.spec.ts +27 -0
- package/src/core/errors/domain.error.ts +9 -0
- package/src/core/errors/entity-not-found.error.spec.ts +32 -0
- package/src/core/errors/entity-not-found.error.ts +9 -0
- package/src/core/errors/fake-implementation.error.spec.ts +27 -0
- package/src/core/errors/fake-implementation.error.ts +15 -0
- package/src/core/errors/index.ts +8 -0
- package/src/core/errors/query-failure.error.ts +8 -0
- package/src/core/errors/too-many-results.error.ts +3 -0
- package/src/core/index.ts +4 -0
- package/src/core/infrastructure/config/config.provider.ts +78 -0
- package/src/core/infrastructure/config/config.service.ts +25 -0
- package/src/core/infrastructure/config/index.ts +2 -0
- package/src/core/infrastructure/messaging/fake/fake-messaging.service.ts +17 -0
- package/src/core/infrastructure/messaging/fake/fake-queue-manager.service.ts +9 -0
- package/src/core/infrastructure/messaging/fake/fake-queue-messaging.service.ts +9 -0
- package/src/core/infrastructure/messaging/fake/index.ts +3 -0
- package/src/core/infrastructure/messaging/index.ts +6 -0
- package/src/core/infrastructure/messaging/messaging.service.ts +3 -0
- package/src/core/infrastructure/messaging/queue-manager.service.ts +6 -0
- package/src/core/infrastructure/messaging/queue-messaging.service.ts +3 -0
- package/src/core/infrastructure/messaging/rabbitmq/index.ts +2 -0
- package/src/core/infrastructure/messaging/rabbitmq/rabbit-messaging.service.ts +11 -0
- package/src/core/infrastructure/messaging/rabbitmq/rabbit-queue-messaging.service.ts +11 -0
- package/src/core/infrastructure/messaging/types.ts +28 -0
- package/src/core/infrastructure/persistence/errors/index.ts +2 -0
- package/src/core/infrastructure/persistence/errors/model-to-entity-conversion.error.ts +9 -0
- package/src/core/infrastructure/persistence/errors/persistence.error.ts +8 -0
- package/src/core/infrastructure/persistence/in-memory/fake.repository.ts +79 -0
- package/src/core/infrastructure/persistence/in-memory/in-memory.query-builder.ts +4 -0
- package/src/core/infrastructure/persistence/in-memory/in-memory.repository.spec.ts +50 -0
- package/src/core/infrastructure/persistence/in-memory/in-memory.repository.ts +81 -0
- package/src/core/infrastructure/persistence/in-memory/index.ts +3 -0
- package/src/core/infrastructure/persistence/index.ts +4 -0
- package/src/core/infrastructure/persistence/read-side/in-memory.query-builder.ts +4 -0
- package/src/core/infrastructure/persistence/read-side/index.ts +1 -0
- package/src/core/infrastructure/persistence/read-side/knex/index.ts +2 -0
- package/src/core/infrastructure/persistence/read-side/knex/knex-types.definition.ts +13 -0
- package/src/core/infrastructure/persistence/read-side/knex/knex.query-builder.ts +70 -0
- package/src/core/infrastructure/persistence/read-side/knex-query-builder.ts +70 -0
- package/src/core/infrastructure/persistence/read-side/knex-types.definition.ts +13 -0
- package/src/core/infrastructure/persistence/write-side/aggregate-typeorm-repository.ts +87 -0
- package/src/core/infrastructure/persistence/write-side/entity-typeorm-repository.ts +64 -0
- package/src/core/infrastructure/persistence/write-side/in-memory.repository.ts +82 -0
- package/src/core/infrastructure/persistence/write-side/index.ts +1 -0
- package/src/core/infrastructure/persistence/write-side/model-attributes.ts +4 -0
- package/src/core/infrastructure/persistence/write-side/orm-embedded-mapper.ts +11 -0
- package/src/core/infrastructure/persistence/write-side/orm-mapper.ts +11 -0
- package/src/core/infrastructure/persistence/write-side/typeorm/aggregate-typeorm.repository.ts +87 -0
- package/src/core/infrastructure/persistence/write-side/typeorm/entity-typeorm.repository.ts +64 -0
- package/src/core/infrastructure/persistence/write-side/typeorm/index.ts +5 -0
- package/src/core/infrastructure/persistence/write-side/typeorm/model-attributes.ts +4 -0
- package/src/core/infrastructure/persistence/write-side/typeorm/orm-embedded.mapper.ts +11 -0
- package/src/core/infrastructure/persistence/write-side/typeorm/orm.mapper.ts +11 -0
- package/src/core/types/architecture-layer.ts +52 -0
- package/src/core/types/array-element.ts +5 -0
- package/src/core/types/index.ts +2 -0
- package/src/index.ts +30 -0
- package/src/modules/config/config.module.ts +9 -0
- package/src/modules/config/index.ts +2 -0
- package/src/modules/graphql/index.ts +1 -0
- package/src/modules/graphql/paginated-response.object-type.ts +23 -0
- package/src/modules/healthcheck/healthcheck-out.dto.ts +43 -0
- package/src/modules/healthcheck/index.ts +1 -0
- package/src/modules/knex/index.ts +3 -0
- package/src/modules/knex/knex-core.module.ts +30 -0
- package/src/modules/knex/knex.decorator.ts +5 -0
- package/src/modules/knex/knex.interface.ts +12 -0
- package/src/modules/knex/knex.module.ts +14 -0
- package/src/modules/knex/knex.token.ts +2 -0
- package/src/modules/logger/app-logger.ts +28 -0
- package/src/modules/logger/index.ts +5 -0
- package/src/modules/logger/log.ts +26 -0
- package/src/modules/logger/logger.module.ts +47 -0
- package/src/modules/logger/logger.service.ts +131 -0
- package/src/modules/logger/transports/console-color.transport.ts +41 -0
- package/src/modules/logger/transports/console-json.transport.ts +23 -0
- package/src/modules/logger/transports/console.transport.ts +10 -0
- package/src/modules/logger/transports/fake.transport.ts +18 -0
- package/src/modules/logger/transports/index.ts +5 -0
- package/src/modules/logger/transports/logger-transport.ts +22 -0
- package/src/modules/messaging/index.ts +2 -0
- package/src/modules/messaging/messaging.module.ts +92 -0
- package/src/modules/queue/default-queue-name.resolver.ts +5 -0
- package/src/modules/queue/index.ts +3 -0
- package/src/modules/queue/queue.module.ts +73 -0
- package/src/modules/queue/rabbit-queue-manager.service.ts +67 -0
- package/src/nestjs/errors/handlers/error-handler.ts +38 -0
- package/src/nestjs/errors/handlers/error-handler.type.ts +23 -0
- package/src/nestjs/errors/handlers/generic-error-handler.ts +59 -0
- package/src/nestjs/errors/handlers/handle-errors.decorator.ts +43 -0
- package/src/nestjs/errors/handlers/index.ts +5 -0
- package/src/nestjs/errors/handlers/validation-error-handler.ts +46 -0
- package/src/nestjs/errors/index.ts +2 -0
- package/src/nestjs/errors/parsers/axios-metadata.parser.ts +21 -0
- package/src/nestjs/errors/parsers/error-metadata.definition.ts +1 -0
- package/src/nestjs/errors/parsers/index.ts +5 -0
- package/src/nestjs/errors/parsers/knex-metadata.parser.ts +18 -0
- package/src/nestjs/errors/parsers/typeorm-metadata.parser.ts +19 -0
- package/src/nestjs/errors/parsers/workos-metadata.parser.ts +17 -0
- package/src/nestjs/http/decorators/index.ts +1 -0
- package/src/nestjs/http/decorators/log-app-ctx.decorator.ts +32 -0
- package/src/nestjs/http/dtos/date-range.dto.ts +15 -0
- package/src/nestjs/http/dtos/index.ts +1 -0
- package/src/nestjs/http/filters/all-exceptions.filter.ts +92 -0
- package/src/nestjs/http/filters/command-failure.filter.ts +12 -0
- package/src/nestjs/http/filters/index.ts +4 -0
- package/src/nestjs/http/filters/rpc-exceptions.filter.ts +10 -0
- package/src/nestjs/http/filters/too-many-results.filter.ts +12 -0
- package/src/nestjs/http/index.ts +6 -0
- package/src/nestjs/http/interceptors/index.ts +2 -0
- package/src/nestjs/http/interceptors/log-app-ctx.interceptor.ts +109 -0
- package/src/nestjs/http/interceptors/serialize-output.interceptor.ts +19 -0
- package/src/nestjs/http/middleware/http-logger.middleware.ts +31 -0
- package/src/nestjs/http/middleware/index.ts +2 -0
- package/src/nestjs/http/middleware/logger.middleware.ts +21 -0
- package/src/nestjs/http/swagger/index.ts +1 -0
- package/src/nestjs/http/swagger/swagger.ts +44 -0
- package/src/nestjs/index.ts +2 -0
- package/src/testing/command-bus.stub.ts +33 -0
- package/src/testing/event-bus.stub.ts +56 -0
- package/src/testing/event-publisher.stub.ts +24 -0
- package/src/testing/fake-logger.ts +20 -0
- package/src/testing/index.ts +2 -0
- package/src/testing/query-bus.stub.ts +27 -0
- package/src/testing/stub.spec.ts +250 -0
- package/src/testing/stub.ts +170 -0
- package/src/testing/stubs/command-bus.stub.ts +33 -0
- package/src/testing/stubs/event-bus.stub.ts +56 -0
- package/src/testing/stubs/event-publisher.stub.ts +24 -0
- package/src/testing/stubs/index.ts +5 -0
- package/src/testing/stubs/query-bus.stub.ts +27 -0
- package/src/testing/stubs/stub.ts +170 -0
- package/src/utils/array.spec.ts +29 -0
- package/src/utils/array.ts +10 -0
- package/src/utils/base64.spec.ts +18 -0
- package/src/utils/base64.ts +6 -0
- package/src/utils/collection.ts +4 -0
- package/src/utils/common.ts +13 -0
- package/src/utils/csv.ts +49 -0
- package/src/utils/date/date-range.ts +4 -0
- package/src/utils/date/date.spec.ts +100 -0
- package/src/utils/date/date.ts +177 -0
- package/src/utils/date/diff.spec.ts +66 -0
- package/src/utils/date/diffYear.spec.ts +23 -0
- package/src/utils/date/fillMissingRangeValues.spec.ts +523 -0
- package/src/utils/date/groubBy.spec.ts +183 -0
- package/src/utils/date/index.ts +2 -0
- package/src/utils/date/isSame.spec.ts +111 -0
- package/src/utils/file.spec.ts +66 -0
- package/src/utils/file.ts +5 -0
- package/src/utils/hash-key.ts +23 -0
- package/src/utils/index.ts +14 -0
- package/src/utils/invariant.ts +3 -0
- package/src/utils/iso-date.ts +11 -0
- package/src/utils/object.spec.ts +18 -0
- package/src/utils/object.ts +6 -0
- package/src/utils/paginated.ts +36 -0
- package/src/utils/string.spec.ts +10 -0
- package/src/utils/string.ts +19 -0
- package/src/utils/type.ts +9 -0
- package/src/utils/xml.ts +6 -0
- package/src/validation/ensure-array.decorator.ts +5 -0
- package/src/validation/index.ts +7 -0
- package/src/validation/is-iso-date.decorator.spec.ts +29 -0
- package/src/validation/is-iso-date.decorator.ts +30 -0
- package/src/validation/is-less-than-or-equal.decorator.spec.ts +30 -0
- package/src/validation/is-less-than-or-equal.decorator.ts +52 -0
- package/src/validation/is-less-than.decorator.spec.ts +36 -0
- package/src/validation/is-less-than.decorator.ts +52 -0
- package/src/validation/is-more-than-or-equal.decorator.spec.ts +30 -0
- package/src/validation/is-more-than-or-equal.decorator.ts +52 -0
- package/src/validation/is-more-than.decorator.spec.ts +36 -0
- package/src/validation/is-more-than.decorator.ts +52 -0
- package/src/validation/is-time-string.decorator.spec.ts +35 -0
- package/src/validation/is-time-string.decorator.ts +29 -0
- package/tsconfig.build.json +6 -0
- package/tsconfig.json +34 -0
- package/tsconfig.spec.json +14 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
registerDecorator,
|
|
3
|
+
ValidationArguments,
|
|
4
|
+
ValidationOptions,
|
|
5
|
+
ValidatorConstraint,
|
|
6
|
+
ValidatorConstraintInterface,
|
|
7
|
+
} from "class-validator";
|
|
8
|
+
|
|
9
|
+
import { isValidISODate } from "../utils";
|
|
10
|
+
|
|
11
|
+
export function IsMoreThanOrEqual(property: string, validationOptions?: ValidationOptions) {
|
|
12
|
+
return function (object: object, propertyName: string) {
|
|
13
|
+
registerDecorator({
|
|
14
|
+
target: object.constructor,
|
|
15
|
+
propertyName,
|
|
16
|
+
constraints: [property],
|
|
17
|
+
options: validationOptions,
|
|
18
|
+
validator: IsMoreThanOrEqualConstraint,
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@ValidatorConstraint({ name: "isMoreThanOrEqual" })
|
|
24
|
+
class IsMoreThanOrEqualConstraint implements ValidatorConstraintInterface {
|
|
25
|
+
validate(value: unknown, args: ValidationArguments) {
|
|
26
|
+
const relatedPropertyName = args.constraints[0] as string;
|
|
27
|
+
const relatedValue = (args.object as Record<string, unknown>)[relatedPropertyName];
|
|
28
|
+
|
|
29
|
+
if (!relatedValue) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (typeof value === "number" && typeof relatedValue === "number") {
|
|
34
|
+
return value >= relatedValue;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (value instanceof Date && relatedValue instanceof Date) {
|
|
38
|
+
return +value >= +relatedValue;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (typeof value === "string" && typeof relatedValue === "string" && isValidISODate(value) && isValidISODate(relatedValue)) {
|
|
42
|
+
return +new Date(value) >= +new Date(relatedValue);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
throw new Error("Unsupported comparison");
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
defaultMessage(args: ValidationArguments) {
|
|
49
|
+
const relatedPropertyName = args.constraints[0] as string;
|
|
50
|
+
return `${args.property} must be more than or equal ${relatedPropertyName}`;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { describe, it, expect } from "@jest/globals";
|
|
2
|
+
import { validate } from "class-validator";
|
|
3
|
+
|
|
4
|
+
import { IsMoreThan } from "./is-more-than.decorator";
|
|
5
|
+
|
|
6
|
+
class Dto {
|
|
7
|
+
min: number;
|
|
8
|
+
@IsMoreThan("min")
|
|
9
|
+
max: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
describe("IsMoreThan", () => {
|
|
13
|
+
it("should pass when value is greater", async () => {
|
|
14
|
+
const dto = Object.assign(new Dto(), { min: 5, max: 10 });
|
|
15
|
+
const errors = await validate(dto);
|
|
16
|
+
expect(errors).toHaveLength(0);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("should fail when value is equal", async () => {
|
|
20
|
+
const dto = Object.assign(new Dto(), { min: 5, max: 5 });
|
|
21
|
+
const errors = await validate(dto);
|
|
22
|
+
expect(errors.length).toBeGreaterThan(0);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("should fail when value is less", async () => {
|
|
26
|
+
const dto = Object.assign(new Dto(), { min: 10, max: 5 });
|
|
27
|
+
const errors = await validate(dto);
|
|
28
|
+
expect(errors.length).toBeGreaterThan(0);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("should pass when related value is falsy", async () => {
|
|
32
|
+
const dto = Object.assign(new Dto(), { min: 0, max: 5 });
|
|
33
|
+
const errors = await validate(dto);
|
|
34
|
+
expect(errors).toHaveLength(0);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
registerDecorator,
|
|
3
|
+
ValidationArguments,
|
|
4
|
+
ValidationOptions,
|
|
5
|
+
ValidatorConstraint,
|
|
6
|
+
ValidatorConstraintInterface,
|
|
7
|
+
} from "class-validator";
|
|
8
|
+
|
|
9
|
+
import { isValidISODate } from "../utils";
|
|
10
|
+
|
|
11
|
+
export function IsMoreThan(property: string, validationOptions?: ValidationOptions) {
|
|
12
|
+
return function (object: object, propertyName: string) {
|
|
13
|
+
registerDecorator({
|
|
14
|
+
target: object.constructor,
|
|
15
|
+
propertyName,
|
|
16
|
+
constraints: [property],
|
|
17
|
+
options: validationOptions,
|
|
18
|
+
validator: IsMoreThanConstraint,
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@ValidatorConstraint({ name: "isMoreThan" })
|
|
24
|
+
class IsMoreThanConstraint implements ValidatorConstraintInterface {
|
|
25
|
+
validate(value: unknown, args: ValidationArguments) {
|
|
26
|
+
const relatedPropertyName = args.constraints[0] as string;
|
|
27
|
+
const relatedValue = (args.object as Record<string, unknown>)[relatedPropertyName];
|
|
28
|
+
|
|
29
|
+
if (!relatedValue) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (typeof value === "number" && typeof relatedValue === "number") {
|
|
34
|
+
return value > relatedValue;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (value instanceof Date && relatedValue instanceof Date) {
|
|
38
|
+
return +value > +relatedValue;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (typeof value === "string" && typeof relatedValue === "string" && isValidISODate(value) && isValidISODate(relatedValue)) {
|
|
42
|
+
return +new Date(value) > +new Date(relatedValue);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
throw new Error("Unsupported comparison");
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
defaultMessage(args: ValidationArguments) {
|
|
49
|
+
const relatedPropertyName = args.constraints[0] as string;
|
|
50
|
+
return `${args.property} must be more than ${relatedPropertyName}`;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { describe, it, expect } from "@jest/globals";
|
|
2
|
+
import { validate } from "class-validator";
|
|
3
|
+
|
|
4
|
+
import { IsTimeString } from "./is-time-string.decorator";
|
|
5
|
+
|
|
6
|
+
class Dto {
|
|
7
|
+
@IsTimeString()
|
|
8
|
+
time: unknown;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
describe("IsTimeString", () => {
|
|
12
|
+
it("should accept HH:mm:ss format", async () => {
|
|
13
|
+
const dto = Object.assign(new Dto(), { time: "14:30:00" });
|
|
14
|
+
const errors = await validate(dto);
|
|
15
|
+
expect(errors).toHaveLength(0);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("should accept compact HHmmss format", async () => {
|
|
19
|
+
const dto = Object.assign(new Dto(), { time: "143000" });
|
|
20
|
+
const errors = await validate(dto);
|
|
21
|
+
expect(errors).toHaveLength(0);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("should reject invalid time strings", async () => {
|
|
25
|
+
const dto = Object.assign(new Dto(), { time: "25:00:00" });
|
|
26
|
+
const errors = await validate(dto);
|
|
27
|
+
expect(errors.length).toBeGreaterThan(0);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("should reject non-string values", async () => {
|
|
31
|
+
const dto = Object.assign(new Dto(), { time: 1430 });
|
|
32
|
+
const errors = await validate(dto);
|
|
33
|
+
expect(errors.length).toBeGreaterThan(0);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
registerDecorator,
|
|
3
|
+
ValidationArguments,
|
|
4
|
+
ValidationOptions,
|
|
5
|
+
ValidatorConstraint,
|
|
6
|
+
ValidatorConstraintInterface,
|
|
7
|
+
} from "class-validator";
|
|
8
|
+
|
|
9
|
+
export function IsTimeString(validationOptions?: ValidationOptions) {
|
|
10
|
+
return function (object: object, propertyName: string) {
|
|
11
|
+
registerDecorator({
|
|
12
|
+
target: object.constructor,
|
|
13
|
+
propertyName,
|
|
14
|
+
options: validationOptions,
|
|
15
|
+
validator: IsTimeStringConstraint,
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@ValidatorConstraint({ name: "isTimeString" })
|
|
21
|
+
class IsTimeStringConstraint implements ValidatorConstraintInterface {
|
|
22
|
+
validate(value: unknown) {
|
|
23
|
+
return typeof value === "string" && /^(([01]\d|2[0-3]):?[0-5]\d:?[0-5]\d+)$/.test(value);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
defaultMessage(args: ValidationArguments) {
|
|
27
|
+
return `${args.property} must be in HH:mm:ss format`;
|
|
28
|
+
}
|
|
29
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"baseUrl": "./",
|
|
6
|
+
"module": "CommonJS",
|
|
7
|
+
"target": "ES2022",
|
|
8
|
+
"moduleResolution": "node",
|
|
9
|
+
"outDir": "./dist",
|
|
10
|
+
"removeComments": true,
|
|
11
|
+
"emitDecoratorMetadata": true,
|
|
12
|
+
"experimentalDecorators": true,
|
|
13
|
+
"allowSyntheticDefaultImports": true,
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"incremental": true,
|
|
16
|
+
"skipLibCheck": true,
|
|
17
|
+
"skipDefaultLibCheck": true,
|
|
18
|
+
"noImplicitAny": true,
|
|
19
|
+
"strictBindCallApply": false,
|
|
20
|
+
"forceConsistentCasingInFileNames": false,
|
|
21
|
+
"noFallthroughCasesInSwitch": false,
|
|
22
|
+
"esModuleInterop": true,
|
|
23
|
+
"importHelpers": true,
|
|
24
|
+
"resolveJsonModule": true,
|
|
25
|
+
"strict": true,
|
|
26
|
+
"strictNullChecks": true,
|
|
27
|
+
"strictPropertyInitialization": false,
|
|
28
|
+
"allowImportingTsExtensions": false,
|
|
29
|
+
"paths": {
|
|
30
|
+
"@invariant-labs/foundation": ["./src/index"]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"exclude": ["node_modules"]
|
|
34
|
+
}
|