@futdevpro/fsm-dynamo 1.14.9 → 1.14.11
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/build/_collections/constants/data-sizes.const.d.ts +3 -3
- package/build/_collections/constants/data-sizes.const.d.ts.map +1 -1
- package/build/_collections/constants/data-sizes.const.js +4 -3
- package/build/_collections/constants/data-sizes.const.js.map +1 -1
- package/build/_collections/utils/array.util.d.ts +189 -0
- package/build/_collections/utils/array.util.d.ts.map +1 -1
- package/build/_collections/utils/array.util.js +189 -0
- package/build/_collections/utils/array.util.js.map +1 -1
- package/build/_collections/utils/async.util.d.ts +29 -0
- package/build/_collections/utils/async.util.d.ts.map +1 -1
- package/build/_collections/utils/async.util.js +40 -0
- package/build/_collections/utils/async.util.js.map +1 -1
- package/build/_collections/utils/json-error-helper.util.d.ts +38 -0
- package/build/_collections/utils/json-error-helper.util.d.ts.map +1 -1
- package/build/_collections/utils/json-error-helper.util.js +38 -0
- package/build/_collections/utils/json-error-helper.util.js.map +1 -1
- package/build/_collections/utils/log.util.d.ts +195 -5
- package/build/_collections/utils/log.util.d.ts.map +1 -1
- package/build/_collections/utils/log.util.js +195 -5
- package/build/_collections/utils/log.util.js.map +1 -1
- package/build/_collections/utils/math/box-bounds.util.d.ts +36 -0
- package/build/_collections/utils/math/box-bounds.util.d.ts.map +1 -1
- package/build/_collections/utils/math/box-bounds.util.js +36 -0
- package/build/_collections/utils/math/box-bounds.util.js.map +1 -1
- package/build/_collections/utils/math/math.util.d.ts +48 -12
- package/build/_collections/utils/math/math.util.d.ts.map +1 -1
- package/build/_collections/utils/math/math.util.js +48 -14
- package/build/_collections/utils/math/math.util.js.map +1 -1
- package/build/_collections/utils/math/math.util.spec.js +0 -9
- package/build/_collections/utils/math/math.util.spec.js.map +1 -1
- package/build/_collections/utils/math/random.util.d.ts +30 -0
- package/build/_collections/utils/math/random.util.d.ts.map +1 -1
- package/build/_collections/utils/math/random.util.js +30 -0
- package/build/_collections/utils/math/random.util.js.map +1 -1
- package/build/_collections/utils/math/trigonometry.util.d.ts +30 -0
- package/build/_collections/utils/math/trigonometry.util.d.ts.map +1 -1
- package/build/_collections/utils/math/trigonometry.util.js +30 -0
- package/build/_collections/utils/math/trigonometry.util.js.map +1 -1
- package/build/_collections/utils/math/vector2.util.d.ts +247 -17
- package/build/_collections/utils/math/vector2.util.d.ts.map +1 -1
- package/build/_collections/utils/math/vector2.util.js +247 -19
- package/build/_collections/utils/math/vector2.util.js.map +1 -1
- package/build/_collections/utils/regex/password-regex.util.d.ts +12 -0
- package/build/_collections/utils/regex/password-regex.util.d.ts.map +1 -1
- package/build/_collections/utils/regex/password-regex.util.js +12 -0
- package/build/_collections/utils/regex/password-regex.util.js.map +1 -1
- package/build/_collections/utils/round-list.util.d.ts +39 -0
- package/build/_collections/utils/round-list.util.d.ts.map +1 -1
- package/build/_collections/utils/round-list.util.js +39 -0
- package/build/_collections/utils/round-list.util.js.map +1 -1
- package/build/_collections/utils/stack.util.d.ts +19 -0
- package/build/_collections/utils/stack.util.d.ts.map +1 -1
- package/build/_collections/utils/stack.util.js +19 -0
- package/build/_collections/utils/stack.util.js.map +1 -1
- package/build/_collections/utils/string.util.d.ts +17 -0
- package/build/_collections/utils/string.util.d.ts.map +1 -1
- package/build/_collections/utils/string.util.js +17 -0
- package/build/_collections/utils/string.util.js.map +1 -1
- package/build/_collections/utils/time.util.d.ts +136 -0
- package/build/_collections/utils/time.util.d.ts.map +1 -1
- package/build/_collections/utils/time.util.js +136 -0
- package/build/_collections/utils/time.util.js.map +1 -1
- package/build/_collections/utils/utilities.util.d.ts +17 -1
- package/build/_collections/utils/utilities.util.d.ts.map +1 -1
- package/build/_collections/utils/utilities.util.js +17 -1
- package/build/_collections/utils/utilities.util.js.map +1 -1
- package/build/_collections/utils/uuid.util.d.ts +6 -0
- package/build/_collections/utils/uuid.util.d.ts.map +1 -1
- package/build/_collections/utils/uuid.util.js +6 -0
- package/build/_collections/utils/uuid.util.js.map +1 -1
- package/build/_enums/data-model-type.enum.d.ts +6 -0
- package/build/_enums/data-model-type.enum.d.ts.map +1 -1
- package/build/_enums/data-model-type.enum.js +6 -0
- package/build/_enums/data-model-type.enum.js.map +1 -1
- package/build/_enums/http/http-call-type.enum.d.ts +8 -0
- package/build/_enums/http/http-call-type.enum.d.ts.map +1 -1
- package/build/_enums/http/http-call-type.enum.js +8 -0
- package/build/_enums/http/http-call-type.enum.js.map +1 -1
- package/build/_enums/http/http-event-type.enum.d.ts +5 -0
- package/build/_enums/http/http-event-type.enum.d.ts.map +1 -1
- package/build/_enums/http/http-event-type.enum.js +5 -0
- package/build/_enums/http/http-event-type.enum.js.map +1 -1
- package/build/_enums/time/day-of-week.enum.d.ts +14 -1
- package/build/_enums/time/day-of-week.enum.d.ts.map +1 -1
- package/build/_enums/time/day-of-week.enum.js +14 -1
- package/build/_enums/time/day-of-week.enum.js.map +1 -1
- package/build/_models/control-models/data-model-params.control-model.d.ts.map +1 -1
- package/build/_models/control-models/data-model-params.control-model.js +11 -1
- package/build/_models/control-models/data-model-params.control-model.js.map +1 -1
- package/build/_models/control-models/data-property-params.control-model.d.ts +8 -0
- package/build/_models/control-models/data-property-params.control-model.d.ts.map +1 -1
- package/build/_models/control-models/data-property-params.control-model.js +8 -0
- package/build/_models/control-models/data-property-params.control-model.js.map +1 -1
- package/build/_models/control-models/http/http-error-response.control-model.d.ts +25 -0
- package/build/_models/control-models/http/http-error-response.control-model.d.ts.map +1 -1
- package/build/_models/control-models/http/http-error-response.control-model.js +25 -0
- package/build/_models/control-models/http/http-error-response.control-model.js.map +1 -1
- package/build/_models/control-models/http/http-headers.control-model.d.ts +8 -0
- package/build/_models/control-models/http/http-headers.control-model.d.ts.map +1 -1
- package/build/_models/control-models/http/http-headers.control-model.js +8 -0
- package/build/_models/control-models/http/http-headers.control-model.js.map +1 -1
- package/build/_models/control-models/http/http-response.model-base.d.ts +9 -0
- package/build/_models/control-models/http/http-response.model-base.d.ts.map +1 -1
- package/build/_models/control-models/http/http-response.model-base.js +9 -0
- package/build/_models/control-models/http/http-response.model-base.js.map +1 -1
- package/build/_models/control-models/poll.control-model.d.ts +18 -0
- package/build/_models/control-models/poll.control-model.d.ts.map +1 -1
- package/build/_models/control-models/poll.control-model.js +18 -0
- package/build/_models/control-models/poll.control-model.js.map +1 -1
- package/build/_models/control-models/range-value.control-model.d.ts +141 -0
- package/build/_models/control-models/range-value.control-model.d.ts.map +1 -1
- package/build/_models/control-models/range-value.control-model.js +141 -0
- package/build/_models/control-models/range-value.control-model.js.map +1 -1
- package/build/_models/control-models/server-status.control-model.d.ts +10 -0
- package/build/_models/control-models/server-status.control-model.d.ts.map +1 -1
- package/build/_models/control-models/server-status.control-model.js +10 -0
- package/build/_models/control-models/server-status.control-model.js.map +1 -1
- package/build/_models/control-models/service-endpoint-settings-base.control-model.d.ts +12 -0
- package/build/_models/control-models/service-endpoint-settings-base.control-model.d.ts.map +1 -1
- package/build/_models/control-models/service-endpoint-settings-base.control-model.js +12 -0
- package/build/_models/control-models/service-endpoint-settings-base.control-model.js.map +1 -1
- package/build/_models/data-models/errors.data-model.d.ts +10 -0
- package/build/_models/data-models/errors.data-model.d.ts.map +1 -1
- package/build/_models/data-models/errors.data-model.js +10 -0
- package/build/_models/data-models/errors.data-model.js.map +1 -1
- package/build/_models/data-models/metadata.data-model.d.ts +26 -0
- package/build/_models/data-models/metadata.data-model.d.ts.map +1 -1
- package/build/_models/data-models/metadata.data-model.js +26 -0
- package/build/_models/data-models/metadata.data-model.js.map +1 -1
- package/build/_modules/ci-tools/_models/cit-ci-result-info.data-models.d.ts +23 -0
- package/build/_modules/ci-tools/_models/cit-ci-result-info.data-models.d.ts.map +1 -1
- package/build/_modules/ci-tools/_models/cit-ci-result-info.data-models.js +23 -0
- package/build/_modules/ci-tools/_models/cit-ci-result-info.data-models.js.map +1 -1
- package/build/_modules/custom-data/_models/cud.data-model.d.ts +7 -0
- package/build/_modules/custom-data/_models/cud.data-model.d.ts.map +1 -1
- package/build/_modules/custom-data/_models/cud.data-model.js +7 -0
- package/build/_modules/custom-data/_models/cud.data-model.js.map +1 -1
- package/build/_modules/location/_collections/loc-regions.util.d.ts +33 -0
- package/build/_modules/location/_collections/loc-regions.util.d.ts.map +1 -1
- package/build/_modules/location/_collections/loc-regions.util.js +33 -0
- package/build/_modules/location/_collections/loc-regions.util.js.map +1 -1
- package/build/_modules/location/_collections/loc.util.d.ts +10 -0
- package/build/_modules/location/_collections/loc.util.d.ts.map +1 -1
- package/build/_modules/location/_collections/loc.util.js +10 -0
- package/build/_modules/location/_collections/loc.util.js.map +1 -1
- package/futdevpro-fsm-dynamo-01.14.11.tgz +0 -0
- package/package.json +1 -1
- package/src/_collections/constants/data-sizes.const.ts +4 -4
- package/src/_collections/utils/array.util.ts +189 -0
- package/src/_collections/utils/async.util.ts +40 -0
- package/src/_collections/utils/json-error-helper.util.ts +38 -0
- package/src/_collections/utils/log.util.ts +194 -4
- package/src/_collections/utils/math/box-bounds.util.ts +36 -0
- package/src/_collections/utils/math/math.util.spec.ts +0 -10
- package/src/_collections/utils/math/math.util.ts +48 -16
- package/src/_collections/utils/math/random.util.ts +30 -0
- package/src/_collections/utils/math/trigonometry.util.ts +30 -0
- package/src/_collections/utils/math/vector2.util.ts +254 -24
- package/src/_collections/utils/regex/password-regex.util.ts +12 -0
- package/src/_collections/utils/round-list.util.ts +39 -0
- package/src/_collections/utils/stack.util.ts +19 -0
- package/src/_collections/utils/string.util.ts +17 -0
- package/src/_collections/utils/time.util.ts +136 -0
- package/src/_collections/utils/utilities.util.ts +17 -1
- package/src/_collections/utils/uuid.util.ts +6 -0
- package/src/_enums/data-model-type.enum.ts +6 -0
- package/src/_enums/http/http-call-type.enum.ts +8 -0
- package/src/_enums/http/http-event-type.enum.ts +5 -0
- package/src/_enums/time/day-of-week.enum.ts +14 -1
- package/src/_models/control-models/data-model-params.control-model.ts +11 -1
- package/src/_models/control-models/data-property-params.control-model.ts +8 -0
- package/src/_models/control-models/http/http-error-response.control-model.ts +25 -0
- package/src/_models/control-models/http/http-headers.control-model.ts +8 -0
- package/src/_models/control-models/http/http-response.model-base.ts +9 -0
- package/src/_models/control-models/poll.control-model.ts +18 -0
- package/src/_models/control-models/range-value.control-model.ts +141 -0
- package/src/_models/control-models/server-status.control-model.ts +10 -0
- package/src/_models/control-models/service-endpoint-settings-base.control-model.ts +12 -0
- package/src/_models/data-models/errors.data-model.ts +10 -0
- package/src/_models/data-models/metadata.data-model.ts +27 -0
- package/src/_modules/ci-tools/_models/cit-ci-result-info.data-models.ts +23 -0
- package/src/_modules/custom-data/_models/cud.data-model.ts +7 -0
- package/src/_modules/location/_collections/loc-regions.util.ts +34 -1
- package/src/_modules/location/_collections/loc.util.ts +10 -0
- package/futdevpro-fsm-dynamo-01.14.9.tgz +0 -0
|
@@ -8,6 +8,13 @@ const trigonometry_util_1 = require("./trigonometry.util");
|
|
|
8
8
|
* is that static functions return new Vector2,
|
|
9
9
|
* while instance functions change the current Vector2 and returns itself.
|
|
10
10
|
* (if this is not true, report it as a bug)
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const vector2 = new DyFM_Vector2_Util(1);
|
|
15
|
+
* const vector2 = new DyFM_Vector2_Util(1, 2);
|
|
16
|
+
* const vector2 = new DyFM_Vector2_Util({ x: 1, y: 2 });
|
|
17
|
+
* ```
|
|
11
18
|
*/
|
|
12
19
|
class DyFM_Vector2_Util {
|
|
13
20
|
isVector2Util = true;
|
|
@@ -85,6 +92,12 @@ class DyFM_Vector2_Util {
|
|
|
85
92
|
}
|
|
86
93
|
/**
|
|
87
94
|
* returns the distance between two vectors
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```ts
|
|
98
|
+
* const distance = DyFM_Vector2_Util.distance({ x: 1, y: 2 }, { x: 3, y: 4 });
|
|
99
|
+
* console.log(distance); // 2.8284271247461903
|
|
100
|
+
* ```
|
|
88
101
|
*/
|
|
89
102
|
static distance(a, b) {
|
|
90
103
|
return this.minus(a, b).magintude;
|
|
@@ -93,7 +106,13 @@ class DyFM_Vector2_Util {
|
|
|
93
106
|
return DyFM_Vector2_Util.distance(this, to);
|
|
94
107
|
}
|
|
95
108
|
/**
|
|
96
|
-
* returns a new vector with the
|
|
109
|
+
* returns a new vector with the subtraction of two vectors
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```ts
|
|
113
|
+
* const minus = DyFM_Vector2_Util.minus({ x: 1, y: 2 }, { x: 3, y: 4 });
|
|
114
|
+
* console.log(minus); // { x: -2, y: -2 }
|
|
115
|
+
* ```
|
|
97
116
|
*/
|
|
98
117
|
static minus(a, minusB) {
|
|
99
118
|
return this.plus(a, this.negative(minusB));
|
|
@@ -104,6 +123,12 @@ class DyFM_Vector2_Util {
|
|
|
104
123
|
}
|
|
105
124
|
/**
|
|
106
125
|
* returns a new vector with the sum of two vectors
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```ts
|
|
129
|
+
* const plus = DyFM_Vector2_Util.plus({ x: 1, y: 2 }, { x: 3, y: 4 });
|
|
130
|
+
* console.log(plus); // { x: 4, y: 6 }
|
|
131
|
+
* ```
|
|
107
132
|
*/
|
|
108
133
|
static plus(a, plusB) {
|
|
109
134
|
return new DyFM_Vector2_Util(a.x + plusB.x, a.y + plusB.y);
|
|
@@ -114,14 +139,26 @@ class DyFM_Vector2_Util {
|
|
|
114
139
|
}
|
|
115
140
|
static add = this.plus;
|
|
116
141
|
add = this.plus;
|
|
117
|
-
/** returns new
|
|
142
|
+
/** returns a new vector with the multiplication of two vectors
|
|
143
|
+
* @example
|
|
144
|
+
* ```ts
|
|
145
|
+
* const multiply = DyFM_Vector2_Util.multiply({ x: 1, y: 2 }, 2);
|
|
146
|
+
* console.log(multiply); // { x: 2, y: 4 }
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
118
149
|
static multiply(v, n) {
|
|
119
150
|
return new DyFM_Vector2_Util(v.x * n, v.y * n);
|
|
120
151
|
}
|
|
121
152
|
multiply(n) {
|
|
122
153
|
return this.newValues(DyFM_Vector2_Util.multiply(this, n));
|
|
123
154
|
}
|
|
124
|
-
/** returns new
|
|
155
|
+
/** returns a new vector with the division of two vectors
|
|
156
|
+
* @example
|
|
157
|
+
* ```ts
|
|
158
|
+
* const divide = DyFM_Vector2_Util.divide({ x: 1, y: 2 }, 2);
|
|
159
|
+
* console.log(divide); // { x: 0.5, y: 1 }
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
125
162
|
static divide(v, divideBy) {
|
|
126
163
|
return new DyFM_Vector2_Util(v.x / divideBy, v.y / divideBy);
|
|
127
164
|
}
|
|
@@ -129,6 +166,13 @@ class DyFM_Vector2_Util {
|
|
|
129
166
|
this.newValues(DyFM_Vector2_Util.divide(this, n));
|
|
130
167
|
return this;
|
|
131
168
|
}
|
|
169
|
+
/** returns the negative value of the original vector at new vector
|
|
170
|
+
* @example
|
|
171
|
+
* ```ts
|
|
172
|
+
* const negative = DyFM_Vector2_Util.negative({ x: 1, y: 2 });
|
|
173
|
+
* console.log(negative); // { x: -1, y: -2 }
|
|
174
|
+
* ```
|
|
175
|
+
*/
|
|
132
176
|
static negative(v) {
|
|
133
177
|
return new DyFM_Vector2_Util(-v.x, -v.y);
|
|
134
178
|
}
|
|
@@ -141,7 +185,13 @@ class DyFM_Vector2_Util {
|
|
|
141
185
|
return this;
|
|
142
186
|
}
|
|
143
187
|
/**
|
|
144
|
-
* returns a new vector with the
|
|
188
|
+
* returns a new vector with the rebase of the original vector
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* ```ts
|
|
192
|
+
* const rebase = DyFM_Vector2_Util.rebase({ x: 1, y: 2 }, { x: 3, y: 4 }, { x: 5, y: 6 });
|
|
193
|
+
* console.log(rebase); // { x: 4, y: 6 }
|
|
194
|
+
* ```
|
|
145
195
|
*/
|
|
146
196
|
static rebase(v, baseFrom, baseTo) {
|
|
147
197
|
return this.plus(v, this.minus(baseTo, baseFrom));
|
|
@@ -151,14 +201,26 @@ class DyFM_Vector2_Util {
|
|
|
151
201
|
return this;
|
|
152
202
|
}
|
|
153
203
|
/**
|
|
154
|
-
* returns a new vector with the
|
|
204
|
+
* returns a new vector with the rotation of the original vector by degrees
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
207
|
+
* ```ts
|
|
208
|
+
* const rotate = DyFM_Vector2_Util.rotate({ x: 1, y: 2 }, 30);
|
|
209
|
+
* console.log(rotate); // { x: 0.8660254037844386, y: 1.5 }
|
|
210
|
+
* ```
|
|
155
211
|
*/
|
|
156
212
|
static rotate(vector, angle) {
|
|
157
213
|
const rad = trigonometry_util_1.DyFM_Trigonometry.angleToRadians(angle);
|
|
158
214
|
return this.rotateRad(vector, rad);
|
|
159
215
|
}
|
|
160
216
|
/**
|
|
161
|
-
* returns a new vector with the
|
|
217
|
+
* returns a new vector with the rotation of the original vector by radians
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```ts
|
|
221
|
+
* const rotateRad = DyFM_Vector2_Util.rotateRad({ x: 1, y: 2 }, 3.141592653589793);
|
|
222
|
+
* console.log(rotateRad); // { x: -1, y: 2 }
|
|
223
|
+
* ```
|
|
162
224
|
*/
|
|
163
225
|
static rotateRad(vector, rad) {
|
|
164
226
|
const cos = Math.cos(rad);
|
|
@@ -168,21 +230,39 @@ class DyFM_Vector2_Util {
|
|
|
168
230
|
return new DyFM_Vector2_Util(newX, newY);
|
|
169
231
|
}
|
|
170
232
|
/**
|
|
171
|
-
* returns a new vector with the
|
|
233
|
+
* returns a new vector with the rotation of the original vector by degrees
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* ```ts
|
|
237
|
+
* const vector = new DyFM_Vector2_Util({ x: 1, y: 2 });
|
|
238
|
+
* vector.rotate(30);
|
|
239
|
+
* ```
|
|
172
240
|
*/
|
|
173
241
|
rotate(angle) {
|
|
174
242
|
this.newValues(DyFM_Vector2_Util.rotate(this, angle));
|
|
175
243
|
return this;
|
|
176
244
|
}
|
|
177
245
|
/**
|
|
178
|
-
* returns a new vector with the
|
|
246
|
+
* returns a new vector with the rotation of the original vector by radians
|
|
247
|
+
*
|
|
248
|
+
* @example
|
|
249
|
+
* ```ts
|
|
250
|
+
* const vector = new DyFM_Vector2_Util({ x: 1, y: 2 });
|
|
251
|
+
* vector.rotateRad(3.141592653589793);
|
|
252
|
+
* ```
|
|
179
253
|
*/
|
|
180
254
|
rotateRad(rad) {
|
|
181
255
|
this.newValues(DyFM_Vector2_Util.rotateRad(this, rad));
|
|
182
256
|
return this;
|
|
183
257
|
}
|
|
184
258
|
/**
|
|
185
|
-
* returns a new
|
|
259
|
+
* returns a new DyFM_Vector2_Util with the new values
|
|
260
|
+
*
|
|
261
|
+
* @example
|
|
262
|
+
* ```ts
|
|
263
|
+
* const vector = new DyFM_Vector2_Util({ x: 1, y: 2 });
|
|
264
|
+
* vector.newValues({ x: 3, y: 4 });
|
|
265
|
+
* ```
|
|
186
266
|
*/
|
|
187
267
|
newValues(newV) {
|
|
188
268
|
this.newXY(newV.x, newV.y);
|
|
@@ -190,6 +270,12 @@ class DyFM_Vector2_Util {
|
|
|
190
270
|
}
|
|
191
271
|
/**
|
|
192
272
|
* returns a new vector with the sum of a vector and the difference of two vectors
|
|
273
|
+
*
|
|
274
|
+
* @example
|
|
275
|
+
* ```ts
|
|
276
|
+
* const vector = new DyFM_Vector2_Util({ x: 1, y: 2 });
|
|
277
|
+
* vector.newXY(3, 4);
|
|
278
|
+
* ```
|
|
193
279
|
*/
|
|
194
280
|
newXY(newX, newY) {
|
|
195
281
|
this._x = newX;
|
|
@@ -198,7 +284,13 @@ class DyFM_Vector2_Util {
|
|
|
198
284
|
return this;
|
|
199
285
|
}
|
|
200
286
|
/**
|
|
201
|
-
* returns a new
|
|
287
|
+
* returns a new DyFM_Vector2_Util with the new values
|
|
288
|
+
*
|
|
289
|
+
* @example
|
|
290
|
+
* ```ts
|
|
291
|
+
* const vector = new DyFM_Vector2_Util({ x: 1, y: 2 });
|
|
292
|
+
* DyFM_Vector2_Util.newValues(vector, { x: 3, y: 4 });
|
|
293
|
+
* ```
|
|
202
294
|
*/
|
|
203
295
|
static newValues(to, newV) {
|
|
204
296
|
to.x = newV.x;
|
|
@@ -209,48 +301,98 @@ class DyFM_Vector2_Util {
|
|
|
209
301
|
//// AI-ed UNCHECKED
|
|
210
302
|
/**
|
|
211
303
|
* returns the angle between two vectors
|
|
304
|
+
*
|
|
305
|
+
* @example
|
|
306
|
+
* ```ts
|
|
307
|
+
* const angle = DyFM_Vector2_Util.angle({ x: 1, y: 2 }, { x: 3, y: 4 });
|
|
308
|
+
* console.log(angle); // 45
|
|
309
|
+
* ```
|
|
212
310
|
*/
|
|
213
311
|
static angle(from, to) {
|
|
214
312
|
return trigonometry_util_1.DyFM_Trigonometry.radiansToAngle(DyFM_Vector2_Util.angleRad(from, to));
|
|
215
313
|
}
|
|
216
314
|
/**
|
|
217
315
|
* returns the angle between two vectors in radians
|
|
316
|
+
*
|
|
317
|
+
* @example
|
|
318
|
+
* ```ts
|
|
319
|
+
* const angleRad = DyFM_Vector2_Util.angleRad({ x: 1, y: 2 }, { x: 3, y: 4 });
|
|
320
|
+
* console.log(angleRad); // 0.7853981633974483
|
|
321
|
+
* ```
|
|
218
322
|
*/
|
|
219
323
|
static angleRad(from, to) {
|
|
220
324
|
return Math.atan2(to.y - from.y, to.x - from.x);
|
|
221
325
|
}
|
|
222
326
|
/**
|
|
223
327
|
* returns the angle between two vectors
|
|
328
|
+
*
|
|
329
|
+
* @example
|
|
330
|
+
* ```ts
|
|
331
|
+
* const vector = new DyFM_Vector2_Util({ x: 1, y: 2 });
|
|
332
|
+
* const angle = vector.angle({ x: 3, y: 4 });
|
|
333
|
+
* console.log(angle); // 45
|
|
334
|
+
* ```
|
|
224
335
|
*/
|
|
225
336
|
angle(from, to) {
|
|
226
337
|
return DyFM_Vector2_Util.angle(from, to);
|
|
227
338
|
}
|
|
228
339
|
/**
|
|
229
340
|
* returns the angle between two vectors in degrees
|
|
341
|
+
*
|
|
342
|
+
* @example
|
|
343
|
+
* ```ts
|
|
344
|
+
* const angle = DyFM_Vector2_Util.deg({ x: 1, y: 2 });
|
|
345
|
+
* console.log(angle); // 45
|
|
230
346
|
*/
|
|
231
347
|
static deg(vector) {
|
|
232
348
|
return trigonometry_util_1.DyFM_Trigonometry.radiansToAngle(DyFM_Vector2_Util.rad(vector));
|
|
233
349
|
}
|
|
234
350
|
/**
|
|
235
351
|
* returns the angle between two vectors in radians
|
|
352
|
+
*
|
|
353
|
+
* @example
|
|
354
|
+
* ```ts
|
|
355
|
+
* const angleRad = DyFM_Vector2_Util.rad({ x: 1, y: 2 });
|
|
356
|
+
* console.log(angleRad); // 0.7853981633974483
|
|
357
|
+
* ```
|
|
236
358
|
*/
|
|
237
359
|
static rad(vector) {
|
|
238
360
|
return Math.atan2(vector.y, vector.x);
|
|
239
361
|
}
|
|
240
362
|
/**
|
|
241
|
-
* returns the angle
|
|
363
|
+
* returns the vector angle in degrees
|
|
364
|
+
*
|
|
365
|
+
* @example
|
|
366
|
+
* ```ts
|
|
367
|
+
* const vector = new DyFM_Vector2_Util({ x: 1, y: 2 });
|
|
368
|
+
* const deg = vector.deg();
|
|
369
|
+
* console.log(deg); // 45
|
|
370
|
+
* ```
|
|
242
371
|
*/
|
|
243
372
|
deg() {
|
|
244
373
|
return DyFM_Vector2_Util.deg(this);
|
|
245
374
|
}
|
|
246
375
|
/**
|
|
247
376
|
* returns math floor of the vector
|
|
377
|
+
*
|
|
378
|
+
* @example
|
|
379
|
+
* ```ts
|
|
380
|
+
* const vector = DyFM_Vector2_Util.floor({ x: 1.5, y: 2.5 });
|
|
381
|
+
* console.log(vector); // { x: 1, y: 2 }
|
|
382
|
+
* ```
|
|
248
383
|
*/
|
|
249
384
|
static floor(v) {
|
|
250
385
|
return new DyFM_Vector2_Util(Math.floor(v.x), Math.floor(v.y));
|
|
251
386
|
}
|
|
252
387
|
/**
|
|
253
388
|
* returns math floor of the vector
|
|
389
|
+
*
|
|
390
|
+
* @example
|
|
391
|
+
* ```ts
|
|
392
|
+
* const vector = new DyFM_Vector2_Util({ x: 1.5, y: 2.5 });
|
|
393
|
+
* const floor = vector.floor();
|
|
394
|
+
* console.log(floor); // { x: 1, y: 2 }
|
|
395
|
+
* ```
|
|
254
396
|
*/
|
|
255
397
|
floor() {
|
|
256
398
|
return DyFM_Vector2_Util.floor(this);
|
|
@@ -258,18 +400,37 @@ class DyFM_Vector2_Util {
|
|
|
258
400
|
/////
|
|
259
401
|
/**
|
|
260
402
|
* returns the direction vector from one point to another
|
|
403
|
+
*
|
|
404
|
+
* @example
|
|
405
|
+
* ```ts
|
|
406
|
+
* const direction = DyFM_Vector2_Util.direction({ x: 1, y: 2 }, { x: 3, y: 4 });
|
|
407
|
+
* console.log(direction); // { x: 2, y: 2 }
|
|
408
|
+
* ```
|
|
261
409
|
*/
|
|
262
410
|
static direction(from, to) {
|
|
263
411
|
return DyFM_Vector2_Util.minus(to, from);
|
|
264
412
|
}
|
|
265
413
|
/**
|
|
266
414
|
* returns the direction vector from one point to another
|
|
415
|
+
*
|
|
416
|
+
* @example
|
|
417
|
+
* ```ts
|
|
418
|
+
* const vector = new DyFM_Vector2_Util({ x: 1, y: 2 });
|
|
419
|
+
* const direction = vector.direction({ x: 3, y: 4 });
|
|
420
|
+
* console.log(direction); // { x: 2, y: 2 }
|
|
421
|
+
* ```
|
|
267
422
|
*/
|
|
268
423
|
direction(to) {
|
|
269
424
|
return DyFM_Vector2_Util.direction(this, to);
|
|
270
425
|
}
|
|
271
426
|
/**
|
|
272
427
|
* returns a normalized vector
|
|
428
|
+
*
|
|
429
|
+
* @example
|
|
430
|
+
* ```ts
|
|
431
|
+
* const vector = DyFM_Vector2_Util.normalize({ x: 1, y: 2 });
|
|
432
|
+
* console.log(vector); // { x: 0.4472135954999579, y: 0.8944271909999159 }
|
|
433
|
+
* ```
|
|
273
434
|
*/
|
|
274
435
|
static normalize(v) {
|
|
275
436
|
const v_U = new DyFM_Vector2_Util(v);
|
|
@@ -277,6 +438,13 @@ class DyFM_Vector2_Util {
|
|
|
277
438
|
}
|
|
278
439
|
/**
|
|
279
440
|
* returns a normalized vector
|
|
441
|
+
*
|
|
442
|
+
* @example
|
|
443
|
+
* ```ts
|
|
444
|
+
* const vector = new DyFM_Vector2_Util({ x: 1, y: 2 });
|
|
445
|
+
* vector.normalize();
|
|
446
|
+
* console.log(vector); // { x: 0.4472135954999579, y: 0.8944271909999159 }
|
|
447
|
+
* ```
|
|
280
448
|
*/
|
|
281
449
|
normalize() {
|
|
282
450
|
this.newValues(DyFM_Vector2_Util.normalize(this));
|
|
@@ -284,48 +452,94 @@ class DyFM_Vector2_Util {
|
|
|
284
452
|
/**
|
|
285
453
|
* this will return a new instance,
|
|
286
454
|
* if you want to change the current instance, use normalize()
|
|
287
|
-
|
|
455
|
+
*
|
|
456
|
+
* @example
|
|
457
|
+
* ```ts
|
|
458
|
+
* const vector = new DyFM_Vector2_Util({ x: 1, y: 2 });
|
|
459
|
+
* const normalized = vector.normalized();
|
|
460
|
+
* console.log(normalized); // { x: 0.4472135954999579, y: 0.8944271909999159 }
|
|
461
|
+
* ```
|
|
462
|
+
*/
|
|
288
463
|
normalized() {
|
|
289
464
|
return DyFM_Vector2_Util.normalize(this);
|
|
290
465
|
}
|
|
291
466
|
/**
|
|
292
467
|
* returns the magnitude of the vector
|
|
468
|
+
*
|
|
469
|
+
* @example
|
|
470
|
+
* ```ts
|
|
471
|
+
* const vector = new DyFM_Vector2_Util({ x: 1, y: 2 });
|
|
472
|
+
* const magnitude = vector.magnitude();
|
|
473
|
+
* console.log(magnitude); // 2.23606797749979
|
|
474
|
+
* ```
|
|
293
475
|
*/
|
|
294
476
|
calcMagnitude() {
|
|
295
477
|
this._magintude = trigonometry_util_1.DyFM_Trigonometry.getHypotenuse(this._x, this._y);
|
|
296
478
|
}
|
|
297
479
|
/**
|
|
298
480
|
* returns a new vector with the same values
|
|
481
|
+
*
|
|
482
|
+
* @example
|
|
483
|
+
* ```ts
|
|
484
|
+
* const vector = new DyFM_Vector2_Util({ x: 1, y: 2 });
|
|
485
|
+
* const clone = vector.clone();
|
|
486
|
+
* console.log(clone); // { x: 1, y: 2 }
|
|
487
|
+
* ```
|
|
299
488
|
*/
|
|
300
489
|
clone() {
|
|
301
490
|
return new DyFM_Vector2_Util(this._x, this._y);
|
|
302
491
|
}
|
|
303
492
|
/**
|
|
304
493
|
* returns true if the vector has changed
|
|
494
|
+
*
|
|
495
|
+
* @example
|
|
496
|
+
* ```ts
|
|
497
|
+
* const vector1 = new DyFM_Vector2_Util({ x: 1, y: 2 });
|
|
498
|
+
* const vector2 = new DyFM_Vector2_Util({ x: 3, y: 4 });
|
|
499
|
+
* const isChanged = DyFM_Vector2_Util.isChanged(vector1, vector2);
|
|
500
|
+
* console.log(isChanged); // true
|
|
501
|
+
* ```
|
|
305
502
|
*/
|
|
306
503
|
static isChanged(a, b) {
|
|
307
504
|
return a.x !== b.x || a.y !== b.y;
|
|
308
505
|
}
|
|
309
506
|
/**
|
|
310
507
|
* returns true if the vectors are equal
|
|
508
|
+
*
|
|
509
|
+
* @example
|
|
510
|
+
* ```ts
|
|
511
|
+
* const vector1 = new DyFM_Vector2_Util({ x: 1, y: 2 });
|
|
512
|
+
* const vector2 = new DyFM_Vector2_Util({ x: 1, y: 2 });
|
|
513
|
+
* const isEqual = DyFM_Vector2_Util.isEqual(vector1, vector2);
|
|
514
|
+
* console.log(isEqual); // true
|
|
515
|
+
* ```
|
|
311
516
|
*/
|
|
312
517
|
static isEqual(a, b) {
|
|
313
518
|
return a.x === b.x && a.y === b.y;
|
|
314
519
|
}
|
|
315
520
|
/**
|
|
316
|
-
* returns true if the vectors
|
|
521
|
+
* returns true if the vectors have changed
|
|
522
|
+
*
|
|
523
|
+
* @example
|
|
524
|
+
* ```ts
|
|
525
|
+
* const vector1 = new DyFM_Vector2_Util({ x: 1, y: 2 });
|
|
526
|
+
* const vector2 = new DyFM_Vector2_Util({ x: 1, y: 2 });
|
|
527
|
+
* const isVectorChanged = DyFM_Vector2_Util.vectorChanged(vector1, vector2);
|
|
528
|
+
* console.log(isVectorChanged); // false
|
|
529
|
+
* ```
|
|
317
530
|
*/
|
|
318
531
|
static vectorChanged(a, b) {
|
|
319
532
|
return a.x !== b.x || a.y !== b.y;
|
|
320
533
|
}
|
|
321
|
-
/**
|
|
322
|
-
* returns true if the vectors are equal
|
|
323
|
-
*/
|
|
324
|
-
static equals(a, b) {
|
|
325
|
-
return a.x === b.x && a.y === b.y;
|
|
326
|
-
}
|
|
327
534
|
/**
|
|
328
535
|
* returns a new vector with the absolute values of the original vector
|
|
536
|
+
*
|
|
537
|
+
* @example
|
|
538
|
+
* ```ts
|
|
539
|
+
* const vector = new DyFM_Vector2_Util({ x: 1, y: 2 });
|
|
540
|
+
* const vector = DyFM_Vector2_Util.abs(vector);
|
|
541
|
+
* console.log(vector);
|
|
542
|
+
* ```
|
|
329
543
|
*/
|
|
330
544
|
static abs(v) {
|
|
331
545
|
return new DyFM_Vector2_Util(Math.abs(v.x), Math.abs(v.y));
|
|
@@ -335,12 +549,26 @@ class DyFM_Vector2_Util {
|
|
|
335
549
|
}
|
|
336
550
|
/**
|
|
337
551
|
* returns a new vector with the rounded values of the original vector
|
|
552
|
+
*
|
|
553
|
+
* @example
|
|
554
|
+
* ```ts
|
|
555
|
+
* const vector = new DyFM_Vector2_Util({ x: 1.5, y: 2.5 });
|
|
556
|
+
* const rounded = DyFM_Vector2_Util.round(vector);
|
|
557
|
+
* const rounded2 = DyFM_Vector2_Util.round(vector,3);
|
|
558
|
+
* ```
|
|
338
559
|
*/
|
|
339
560
|
static round(v, decimals = 0) {
|
|
340
561
|
return new DyFM_Vector2_Util(math_util_1.DyFM_Math.round(v.x, decimals), math_util_1.DyFM_Math.round(v.y, decimals));
|
|
341
562
|
}
|
|
342
563
|
/**
|
|
343
564
|
* returns a instance of DyFM_Vector2 from a DyFM_Vector2_Util
|
|
565
|
+
*
|
|
566
|
+
* @example
|
|
567
|
+
* ```ts
|
|
568
|
+
* const vector = new DyFM_Vector2_Util({ x: 1, y: 2 });
|
|
569
|
+
* const vector2 = DyFM_Vector2_Util.toVector2(vector);
|
|
570
|
+
* console.log(vector2);
|
|
571
|
+
* ```
|
|
344
572
|
*/
|
|
345
573
|
static toVector2(v) {
|
|
346
574
|
return (new DyFM_Vector2_Util(v)).get();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vector2.util.js","sourceRoot":"","sources":["../../../../src/_collections/utils/math/vector2.util.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AAExC,2DAAwD;AAKxD
|
|
1
|
+
{"version":3,"file":"vector2.util.js","sourceRoot":"","sources":["../../../../src/_collections/utils/math/vector2.util.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AAExC,2DAAwD;AAKxD;;;;;;;;;;;;GAYG;AACH,MAAa,iBAAiB;IACnB,aAAa,GAAY,IAAI,CAAC;IAE/B,EAAE,GAAW,CAAC,CAAC;IACvB;;;SAGK;IACL,IAAI,CAAC,CAAE,KAAa;QAClB,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC;QAEhB,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;IACD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;IAEO,EAAE,GAAW,CAAC,CAAC;IACvB;;;SAGK;IACL,IAAI,CAAC,CAAE,KAAa;QAClB,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC;QAEhB,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;IACD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;IAEO,UAAU,GAAW,CAAC,CAAC;IAC/B,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,qGAAqG;IACrG;;OAEG;IACH,MAAM,CAAU,IAAI,GAAiB,EAAE,CA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B,CAAC;QAChD,OAAO,IAAI,iBAAiB,CAC1B,qBAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EAC9B,qBAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAC/B,CAAC;IACJ,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,SAAS,CAAC,CAAoB;QACnC,OAAO,CAAC,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IAC1C,CAAC;IAED;;OAEG;IACH,GAAG;QACD,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC;IAClC,CAAC;IACD,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC;IACtB,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC;IAErB;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,CAAe;QAC1B,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5B,CAAC;;AArnBH,8CAsnBC"}
|
|
@@ -1,3 +1,15 @@
|
|
|
1
1
|
export declare const DyFM_passwordRegex: RegExp;
|
|
2
|
+
/**
|
|
3
|
+
* returns an array of errors for a given password if it not match all the requirements
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* const errors = DyFM_getPasswordErrors('Invalid1');
|
|
8
|
+
* console.log(errors); // ['Password must include at least one of the !@#$%^&* characters.']
|
|
9
|
+
*
|
|
10
|
+
* const errors = DyFM_getPasswordErrors('ValidPassword1!');
|
|
11
|
+
* console.log(errors); // []
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
2
14
|
export declare function DyFM_getPasswordErrors(password: string): string[];
|
|
3
15
|
//# sourceMappingURL=password-regex.util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password-regex.util.d.ts","sourceRoot":"","sources":["../../../../src/_collections/utils/regex/password-regex.util.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,EAAE,MAEhC,CAAC;AAUF,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAUjE"}
|
|
1
|
+
{"version":3,"file":"password-regex.util.d.ts","sourceRoot":"","sources":["../../../../src/_collections/utils/regex/password-regex.util.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,EAAE,MAEhC,CAAC;AAUF;;;;;;;;;;;IAWI;AACJ,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAUjE"}
|
|
@@ -9,6 +9,18 @@ exports.DyFM_passwordRegex = new RegExp('^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*
|
|
|
9
9
|
'Password must include at least one digit.' +
|
|
10
10
|
'Password must include at least one of the !@#$%^&* characters.' +
|
|
11
11
|
'Password must be at least 6 characters long.'; */
|
|
12
|
+
/**
|
|
13
|
+
* returns an array of errors for a given password if it not match all the requirements
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const errors = DyFM_getPasswordErrors('Invalid1');
|
|
18
|
+
* console.log(errors); // ['Password must include at least one of the !@#$%^&* characters.']
|
|
19
|
+
*
|
|
20
|
+
* const errors = DyFM_getPasswordErrors('ValidPassword1!');
|
|
21
|
+
* console.log(errors); // []
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
12
24
|
function DyFM_getPasswordErrors(password) {
|
|
13
25
|
const errors = [];
|
|
14
26
|
DyFM_passwordErrorsOneByOne.forEach((error) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password-regex.util.js","sourceRoot":"","sources":["../../../../src/_collections/utils/regex/password-regex.util.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"password-regex.util.js","sourceRoot":"","sources":["../../../../src/_collections/utils/regex/password-regex.util.ts"],"names":[],"mappings":";;;AAyBA,wDAUC;AAlCY,QAAA,kBAAkB,GAAW,IAAI,MAAM,CAClD,wDAAwD,CACzD,CAAC;AAGF;;;;;oDAKoD;AAEpD;;;;;;;;;;;IAWI;AACJ,SAAgB,sBAAsB,CAAC,QAAgB;IACrD,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,2BAA2B,CAAC,OAAO,CAAC,CAAC,KAAK,EAAQ,EAAE;QAClD,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YAChC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,2BAA2B,GAAG;IAClC;QACE,KAAK,EAAE,IAAI,MAAM,CAAC,cAAc,CAAC;QACjC,IAAI,EAAE,kBAAkB;QACxB,OAAO,EAAE,sDAAsD;KAChE;IACD;QACE,KAAK,EAAE,IAAI,MAAM,CAAC,cAAc,CAAC;QACjC,IAAI,EAAE,kBAAkB;QACxB,OAAO,EAAE,sDAAsD;KAChE;IACD;QACE,KAAK,EAAE,IAAI,MAAM,CAAC,cAAc,CAAC;QACjC,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,2CAA2C;KACrD;IACD;QACE,KAAK,EAAE,IAAI,MAAM,CAAC,mBAAmB,CAAC;QACtC,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,gEAAgE;KAC1E;IACD;QACE,KAAK,EAAE,IAAI,MAAM,CAAC,YAAY,CAAC;QAC/B,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,8CAA8C;KACxD;CACF,CAAC;AAEF,wBAAwB"}
|
|
@@ -9,6 +9,14 @@ export declare class DyFM_RoundList {
|
|
|
9
9
|
* @param listLength
|
|
10
10
|
* @param outboundIndex
|
|
11
11
|
* @returns
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const listLength = 10;
|
|
16
|
+
* const outboundIndex = 15;
|
|
17
|
+
* const result = DyFM_RoundList.getOutboundedIndex(listLength, outboundIndex);
|
|
18
|
+
* console.log(result); // 5
|
|
19
|
+
* ```
|
|
12
20
|
*/
|
|
13
21
|
static getOutboundedIndex(listLength: number, outboundIndex: number): number;
|
|
14
22
|
/**
|
|
@@ -18,6 +26,14 @@ export declare class DyFM_RoundList {
|
|
|
18
26
|
* @param length
|
|
19
27
|
* @param oppositeOf
|
|
20
28
|
* @returns
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const length = 10;
|
|
33
|
+
* const oppositeOf = 5;
|
|
34
|
+
* const result = DyFM_RoundList.getIndexOpposite(length, oppositeOf);
|
|
35
|
+
* console.log(result); // 0
|
|
36
|
+
* ```
|
|
21
37
|
*/
|
|
22
38
|
static getIndexOpposite(length: number, oppositeOf: number): number;
|
|
23
39
|
/**
|
|
@@ -25,6 +41,14 @@ export declare class DyFM_RoundList {
|
|
|
25
41
|
* @param list
|
|
26
42
|
* @param outboundIndex
|
|
27
43
|
* @returns
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const list = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];
|
|
48
|
+
* const outboundIndex = 15;
|
|
49
|
+
* const result = DyFM_RoundList.getListIndex(list, outboundIndex);
|
|
50
|
+
* console.log(result); // 5
|
|
51
|
+
* ```
|
|
28
52
|
*/
|
|
29
53
|
static getListIndex<T>(list: T[], outboundIndex: number): T;
|
|
30
54
|
/**
|
|
@@ -32,11 +56,26 @@ export declare class DyFM_RoundList {
|
|
|
32
56
|
* @param list
|
|
33
57
|
* @param oppositeOf
|
|
34
58
|
* @returns
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* const list = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];
|
|
63
|
+
* const oppositeOf = 5;
|
|
64
|
+
* const result = DyFM_RoundList.getListOpposite(list, oppositeOf);
|
|
65
|
+
* console.log(result); // 0
|
|
66
|
+
* ```
|
|
35
67
|
*/
|
|
36
68
|
static getListOpposite<T>(list: T[], oppositeOf: T): T;
|
|
37
69
|
/**
|
|
38
70
|
* returns the last element of the list
|
|
39
71
|
* returns null if the list is empty
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* const list = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];
|
|
76
|
+
* const result = DyFM_RoundList.getLast(list);
|
|
77
|
+
* console.log(result); // 10
|
|
78
|
+
* ```
|
|
40
79
|
*/
|
|
41
80
|
static getLast<T>(list: T[]): T | null;
|
|
42
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"round-list.util.d.ts","sourceRoot":"","sources":["../../../src/_collections/utils/round-list.util.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,qBAAa,cAAc;IACzB
|
|
1
|
+
{"version":3,"file":"round-list.util.d.ts","sourceRoot":"","sources":["../../../src/_collections/utils/round-list.util.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,qBAAa,cAAc;IACzB;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM;IAiB5E;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM;IAOnE;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,aAAa,EAAE,MAAM,GAAG,CAAC;IAI3D;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC;IAItD;;;;;;;;;;OAUG;IACH,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,IAAI;CAoDvC"}
|