redis-distributed-cache-tools 1.0.0 → 1.0.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.
@@ -0,0 +1,3 @@
1
+ export * from './get-hot-ket.function';
2
+ export * from './get-jitter.function';
3
+ export * from './should-recompute.function';
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./get-hot-ket.function"), exports);
18
+ __exportStar(require("./get-jitter.function"), exports);
19
+ __exportStar(require("./should-recompute.function"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "redis-distributed-cache-tools",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
package/readme.md DELETED
@@ -1,71 +0,0 @@
1
- ## String type decorator
2
-
3
-
4
- | Decorator | Type | Description|
5
- | --- | --- | --- |
6
- | @IsNullableString | string | null | If want to ignore value ≠= ‘’, @IsNullableString({ blank: true }) |
7
- | @IsUndefinableString | string | undefined | If want to ignore value ≠= ‘’, @IsUndefinableString({ blank: true }) |
8
- | @IsOptionalString | string | null | undefined | If want to ignore value ≠= ‘’, @IsOptionalString({ blank: true }) |
9
- | @IsNotEmptyNumberString | string | Checks a string is a number |
10
- | @IsNotEmptyBooleanString | string | Checks a string is a boolean |
11
- | @IsNullableNumberString | string | null | Checks a string is a number or null |
12
- | @IsNullableBooleanString | string | null | Checks a string is a boolean or null |
13
- | @IsUndefinableNumberString | string | undefined | Checks a string is a number or undefined |
14
- | @IsUndefinableBooleanString | string | undefined | Checks a string is a boolean or null |
15
- | @IsOptionalNumberString | string | null | undefined | Checks a string is a number or null or undefined |
16
- | @IsOptionalBooleanString | string | null | undefined | Checks a string is a boolean or null or undefined |
17
-
18
- ## Number type decorator
19
-
20
-
21
- | Decorator | Type |
22
- |----------------------|--------|
23
- | @IsNotEmptyNumber | number |
24
- | @IsNullableNumber | nubmer | null |
25
- | @IsUndefinableNumber | number | undefined |
26
- | @IsOptionalNumber | number | null | undefined |
27
- | | |
28
-
29
- ## Boolean type decorator
30
-
31
- | Decorator | Type |
32
- | --- | --- |
33
- | @IsNotEmptyBoolean | boolean |
34
- | @IsNullableBoolean | boolean | null |
35
- | @IsUndefinalbeBoolean | boolean | undefined |
36
- | @IsOptionalBoolean | boolean | null | undefined |
37
-
38
- ## ValidateNested usage case
39
-
40
- ```ts
41
- import { isNotEmptyString, IsNotEmptyBoolean, isNullable, IsUndefinable } from 'custom-class-validator-tools';
42
- import { IsInstance, ArrayNotEmpty, ValidateNested } from 'class-validator';
43
- import { Type } from 'class-transformer';
44
-
45
- class Tag {
46
- @IsNotEmptyString()
47
- tag1: string;
48
- @IsNotEmptyString()
49
- tag2: string;
50
- }
51
-
52
- class Result {
53
- @IsNotEmptyBoolean()
54
- failed: boolean;
55
- }
56
-
57
- class Post {
58
- @IsNullable()
59
- @ArrayNotEmpty()
60
- @IsInstance(Tag, { each: true })
61
- @ValidateNested({ each: true })
62
- @Type(() => Tag)
63
- tags: Tag[] | null;
64
-
65
- @IsUndefinable()
66
- @IsInstance(Result)
67
- @ValidateNested()
68
- @Type(() => Result)
69
- result?: Result;
70
- }
71
- ```