@sankhyalabs/core-docs 0.0.0-hotfix-ga-KB-4098.0
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/README.md +63 -0
- package/classes/ApplicationContext.md +90 -0
- package/classes/ArrayUtils.md +99 -0
- package/classes/AuthorizedServiceCaller.md +76 -0
- package/classes/Change.md +190 -0
- package/classes/DataUnit.md +2427 -0
- package/classes/DataUnitAction.md +96 -0
- package/classes/DataUnitStorage.md +116 -0
- package/classes/DateUtils.md +327 -0
- package/classes/ElementIDUtils.md +308 -0
- package/classes/ErrorException.md +214 -0
- package/classes/ErrorTracking.md +62 -0
- package/classes/FloatingManager.md +530 -0
- package/classes/HttpProvider.md +96 -0
- package/classes/JSUtils.md +115 -0
- package/classes/MaskFormatter-1.md +347 -0
- package/classes/NumberUtils.md +335 -0
- package/classes/ObjectUtils.md +160 -0
- package/classes/OnboardingUtils.md +126 -0
- package/classes/PromiseSync.md +91 -0
- package/classes/ReadyUtil.md +115 -0
- package/classes/RequestMetadata.md +84 -0
- package/classes/SelectionInfo.md +168 -0
- package/classes/SkwHttpProvider.md +109 -0
- package/classes/StringUtils.md +562 -0
- package/classes/TimeFormatter.md +98 -0
- package/classes/UserAgentUtils.md +58 -0
- package/classes/VersionUtils.md +42 -0
- package/classes/WaitingChangeException.md +200 -0
- package/classes/WarningException.md +214 -0
- package/enums/Action.md +283 -0
- package/enums/ChangeOperation.md +52 -0
- package/enums/DataType.md +63 -0
- package/enums/DependencyType.md +41 -0
- package/enums/SelectionMode.md +30 -0
- package/enums/SortMode.md +30 -0
- package/enums/UserInterface.md +195 -0
- package/interfaces/ChildDescriptor.md +41 -0
- package/interfaces/ChildLink.md +30 -0
- package/interfaces/DUActionInterceptor.md +29 -0
- package/interfaces/ExecutionContext.md +58 -0
- package/interfaces/FieldDescriptor.md +140 -0
- package/interfaces/Filter.md +41 -0
- package/interfaces/IElementIDInfo.md +30 -0
- package/interfaces/LoadDataRequest.md +101 -0
- package/interfaces/LoadDataResponse.md +36 -0
- package/interfaces/PageRequest.md +41 -0
- package/interfaces/PaginationInfo.md +75 -0
- package/interfaces/PromiseSyncCallback.md +39 -0
- package/interfaces/QuickFilter.md +41 -0
- package/interfaces/Record.md +62 -0
- package/interfaces/SavedRecord.md +85 -0
- package/interfaces/Sort.md +41 -0
- package/interfaces/SortingProvider.md +29 -0
- package/interfaces/UnitMetadata.md +52 -0
- package/interfaces/WaitingChange.md +41 -0
- package/modules/MaskFormatter.md +37 -0
- package/modules.md +73 -0
- package/package.json +14 -0
@@ -0,0 +1,562 @@
|
|
1
|
+
[@sankhyalabs/core](../README.md) / [Exports](../modules.md) / StringUtils
|
2
|
+
|
3
|
+
# Class: StringUtils
|
4
|
+
|
5
|
+
`StringUtils`: Utilizado para manipulação de Strings.
|
6
|
+
|
7
|
+
## Table of contents
|
8
|
+
|
9
|
+
### Constructors
|
10
|
+
|
11
|
+
- [constructor](StringUtils.md#constructor)
|
12
|
+
|
13
|
+
### Methods
|
14
|
+
|
15
|
+
- [compare](StringUtils.md#compare)
|
16
|
+
- [decodeHtmlEntities](StringUtils.md#decodehtmlentities)
|
17
|
+
- [formatBytes](StringUtils.md#formatbytes)
|
18
|
+
- [generateUUID](StringUtils.md#generateuuid)
|
19
|
+
- [getBooleanValue](StringUtils.md#getbooleanvalue)
|
20
|
+
- [hashCode](StringUtils.md#hashcode)
|
21
|
+
- [isEmpty](StringUtils.md#isempty)
|
22
|
+
- [padEnd](StringUtils.md#padend)
|
23
|
+
- [padStart](StringUtils.md#padstart)
|
24
|
+
- [prettyPrecision](StringUtils.md#prettyprecision)
|
25
|
+
- [replaceAccentuatedChars](StringUtils.md#replaceaccentuatedchars)
|
26
|
+
- [replaceAccentuatedCharsKeepSymbols](StringUtils.md#replaceaccentuatedcharskeepsymbols)
|
27
|
+
- [replaceAccentuatedCharsLower](StringUtils.md#replaceaccentuatedcharslower)
|
28
|
+
- [replaceAccentuatedCharsUpper](StringUtils.md#replaceaccentuatedcharsupper)
|
29
|
+
- [replaceBlankCharacters](StringUtils.md#replaceblankcharacters)
|
30
|
+
- [toCamelCase](StringUtils.md#tocamelcase)
|
31
|
+
- [toKebabCase](StringUtils.md#tokebabcase)
|
32
|
+
- [toPascalCase](StringUtils.md#topascalcase)
|
33
|
+
- [toSnakeCase](StringUtils.md#tosnakecase)
|
34
|
+
|
35
|
+
## Constructors
|
36
|
+
|
37
|
+
### constructor
|
38
|
+
|
39
|
+
• **new StringUtils**()
|
40
|
+
|
41
|
+
## Methods
|
42
|
+
|
43
|
+
### compare
|
44
|
+
|
45
|
+
▸ `Static` **compare**(`a`, `b`): `number`
|
46
|
+
|
47
|
+
Determina a ordem de strings.
|
48
|
+
|
49
|
+
#### Parameters
|
50
|
+
|
51
|
+
| Name | Type | Description |
|
52
|
+
| :------ | :------ | :------ |
|
53
|
+
| `a` | `string` | Primeira string para comparação. |
|
54
|
+
| `b` | `string` | Segunda string para comparação. |
|
55
|
+
|
56
|
+
#### Returns
|
57
|
+
|
58
|
+
`number`
|
59
|
+
|
60
|
+
- Um numeral negativo se o primeiro argumento é menor que o segundo, zero se os dois são iguais e um numeral positivo quando o primeiro é maior que o segundo.
|
61
|
+
|
62
|
+
#### Defined in
|
63
|
+
|
64
|
+
src/utils/StringUtils.ts:223
|
65
|
+
|
66
|
+
___
|
67
|
+
|
68
|
+
### decodeHtmlEntities
|
69
|
+
|
70
|
+
▸ `Static` **decodeHtmlEntities**(`text`): `string`
|
71
|
+
|
72
|
+
Converte todas as entidades HTML de um texto
|
73
|
+
|
74
|
+
**`Example`**
|
75
|
+
|
76
|
+
```ts
|
77
|
+
entrada: "<Teste>" // retorno: "<Teste>"
|
78
|
+
```
|
79
|
+
|
80
|
+
#### Parameters
|
81
|
+
|
82
|
+
| Name | Type | Description |
|
83
|
+
| :------ | :------ | :------ |
|
84
|
+
| `text` | `string` | String para ser transformada. |
|
85
|
+
|
86
|
+
#### Returns
|
87
|
+
|
88
|
+
`string`
|
89
|
+
|
90
|
+
#### Defined in
|
91
|
+
|
92
|
+
src/utils/StringUtils.ts:55
|
93
|
+
|
94
|
+
___
|
95
|
+
|
96
|
+
### formatBytes
|
97
|
+
|
98
|
+
▸ `Static` **formatBytes**(`bytes`): `string`
|
99
|
+
|
100
|
+
Utilitário para formatar bytes em string legível, convertendo para
|
101
|
+
múltiplos maiores caso necessário.
|
102
|
+
|
103
|
+
#### Parameters
|
104
|
+
|
105
|
+
| Name | Type |
|
106
|
+
| :------ | :------ |
|
107
|
+
| `bytes` | `number` |
|
108
|
+
|
109
|
+
#### Returns
|
110
|
+
|
111
|
+
`string`
|
112
|
+
|
113
|
+
string formatada de acordo com a unidade.
|
114
|
+
|
115
|
+
#### Defined in
|
116
|
+
|
117
|
+
src/utils/StringUtils.ts:308
|
118
|
+
|
119
|
+
___
|
120
|
+
|
121
|
+
### generateUUID
|
122
|
+
|
123
|
+
▸ `Static` **generateUUID**(): `string`
|
124
|
+
|
125
|
+
Método utilizado para gerar IDs únicos.
|
126
|
+
|
127
|
+
#### Returns
|
128
|
+
|
129
|
+
`string`
|
130
|
+
|
131
|
+
id único randômico.
|
132
|
+
|
133
|
+
#### Defined in
|
134
|
+
|
135
|
+
src/utils/StringUtils.ts:355
|
136
|
+
|
137
|
+
___
|
138
|
+
|
139
|
+
### getBooleanValue
|
140
|
+
|
141
|
+
▸ `Static` **getBooleanValue**(`value`, `defaultValue?`): `boolean`
|
142
|
+
|
143
|
+
Converte um texto do tipo string para um booleano.
|
144
|
+
|
145
|
+
**`Example`**
|
146
|
+
|
147
|
+
```ts
|
148
|
+
Informado: 'true' | Retorna: true
|
149
|
+
Informado: 'false' | Retorna: false
|
150
|
+
```
|
151
|
+
|
152
|
+
#### Parameters
|
153
|
+
|
154
|
+
| Name | Type | Default value | Description |
|
155
|
+
| :------ | :------ | :------ | :------ |
|
156
|
+
| `value` | `string` | `undefined` | Valor a ser convertido. |
|
157
|
+
| `defaultValue` | `boolean` | `false` | Valor padrão. |
|
158
|
+
|
159
|
+
#### Returns
|
160
|
+
|
161
|
+
`boolean`
|
162
|
+
|
163
|
+
- Texto convertido.
|
164
|
+
|
165
|
+
#### Defined in
|
166
|
+
|
167
|
+
src/utils/StringUtils.ts:153
|
168
|
+
|
169
|
+
___
|
170
|
+
|
171
|
+
### hashCode
|
172
|
+
|
173
|
+
▸ `Static` **hashCode**(`value`): `string`
|
174
|
+
|
175
|
+
Calcula um código hash para uma string.
|
176
|
+
|
177
|
+
**`Example`**
|
178
|
+
|
179
|
+
```ts
|
180
|
+
Informado: '123456' | Retorna: 1450575459
|
181
|
+
```
|
182
|
+
|
183
|
+
#### Parameters
|
184
|
+
|
185
|
+
| Name | Type | Description |
|
186
|
+
| :------ | :------ | :------ |
|
187
|
+
| `value` | `string` | String que será gerado o hash code. |
|
188
|
+
|
189
|
+
#### Returns
|
190
|
+
|
191
|
+
`string`
|
192
|
+
|
193
|
+
- Um hash calculado com base no valor informado.
|
194
|
+
|
195
|
+
#### Defined in
|
196
|
+
|
197
|
+
src/utils/StringUtils.ts:132
|
198
|
+
|
199
|
+
___
|
200
|
+
|
201
|
+
### isEmpty
|
202
|
+
|
203
|
+
▸ `Static` **isEmpty**(`value`): `Boolean`
|
204
|
+
|
205
|
+
Retorna se a string está vazia.
|
206
|
+
Valores null e undefined são considerados como vazio.
|
207
|
+
|
208
|
+
#### Parameters
|
209
|
+
|
210
|
+
| Name | Type | Description |
|
211
|
+
| :------ | :------ | :------ |
|
212
|
+
| `value` | `any` | String para ser validada. |
|
213
|
+
|
214
|
+
#### Returns
|
215
|
+
|
216
|
+
`Boolean`
|
217
|
+
|
218
|
+
- Verdadeiro caso a string não contenha informação.
|
219
|
+
|
220
|
+
#### Defined in
|
221
|
+
|
222
|
+
src/utils/StringUtils.ts:16
|
223
|
+
|
224
|
+
___
|
225
|
+
|
226
|
+
### padEnd
|
227
|
+
|
228
|
+
▸ `Static` **padEnd**(`str`, `len`, `pad?`): `string`
|
229
|
+
|
230
|
+
Adiciona caracteres à direita caso texto seja menor que o valor do parâmetro len passado.
|
231
|
+
|
232
|
+
**`Example`**
|
233
|
+
|
234
|
+
```ts
|
235
|
+
padStart('SANKHYA', 8,'.') | Retorna: 'SANKHYA...'
|
236
|
+
```
|
237
|
+
|
238
|
+
**`Example`**
|
239
|
+
|
240
|
+
```ts
|
241
|
+
padStart('SANKHYA', 5,'A') | Retorna: 'SANKHYA'
|
242
|
+
```
|
243
|
+
|
244
|
+
#### Parameters
|
245
|
+
|
246
|
+
| Name | Type | Default value | Description |
|
247
|
+
| :------ | :------ | :------ | :------ |
|
248
|
+
| `str` | `string` | `undefined` | Texto para ser ajustado. |
|
249
|
+
| `len` | `number` | `undefined` | Tamanho desejado do texto. |
|
250
|
+
| `pad` | `string` | `" "` | Caractere a ser adicionado a direita caso o texto menor que o tamanho passado. |
|
251
|
+
|
252
|
+
#### Returns
|
253
|
+
|
254
|
+
`string`
|
255
|
+
|
256
|
+
- Texto passado se este for maior que o len.
|
257
|
+
Ou retorna o texto com os caracteres adicionados na direita.
|
258
|
+
|
259
|
+
#### Defined in
|
260
|
+
|
261
|
+
src/utils/StringUtils.ts:207
|
262
|
+
|
263
|
+
___
|
264
|
+
|
265
|
+
### padStart
|
266
|
+
|
267
|
+
▸ `Static` **padStart**(`str`, `len`, `pad?`): `string`
|
268
|
+
|
269
|
+
Adiciona caracteres à esquerda caso texto seja menor que o valor do parâmetro len passado.
|
270
|
+
|
271
|
+
**`Example`**
|
272
|
+
|
273
|
+
```ts
|
274
|
+
padStart('SANKHYA', 8,'.') | Retorna: '...SANKHYA'
|
275
|
+
```
|
276
|
+
|
277
|
+
**`Example`**
|
278
|
+
|
279
|
+
```ts
|
280
|
+
padStart('SANKHYA', 5,'A') | Retorna: 'SANKHYA'
|
281
|
+
```
|
282
|
+
|
283
|
+
#### Parameters
|
284
|
+
|
285
|
+
| Name | Type | Default value | Description |
|
286
|
+
| :------ | :------ | :------ | :------ |
|
287
|
+
| `str` | `string` | `undefined` | Texto para ser ajustado. |
|
288
|
+
| `len` | `number` | `undefined` | Tamanho desejado do texto. |
|
289
|
+
| `pad` | `string` | `" "` | Caractere a ser adicionado a esquerda caso o texto menor que o tamanho passado. |
|
290
|
+
|
291
|
+
#### Returns
|
292
|
+
|
293
|
+
`string`
|
294
|
+
|
295
|
+
- Texto passado se este for maior que o len.
|
296
|
+
Ou retorna o texto com os caracteres adicionados na esquerda.
|
297
|
+
|
298
|
+
#### Defined in
|
299
|
+
|
300
|
+
src/utils/StringUtils.ts:182
|
301
|
+
|
302
|
+
___
|
303
|
+
|
304
|
+
### prettyPrecision
|
305
|
+
|
306
|
+
▸ `Static` `Private` **prettyPrecision**(`strNumber`): `string`
|
307
|
+
|
308
|
+
Método interno. Remove zeros depois da vírgula diminuindo o tamanho
|
309
|
+
da string.
|
310
|
+
|
311
|
+
#### Parameters
|
312
|
+
|
313
|
+
| Name | Type | Description |
|
314
|
+
| :------ | :------ | :------ |
|
315
|
+
| `strNumber` | `string` | representação textual do número a ser ajustado. |
|
316
|
+
|
317
|
+
#### Returns
|
318
|
+
|
319
|
+
`string`
|
320
|
+
|
321
|
+
simplificação do strNumber, sem os zeros à direita depois do ponto.
|
322
|
+
|
323
|
+
#### Defined in
|
324
|
+
|
325
|
+
src/utils/StringUtils.ts:334
|
326
|
+
|
327
|
+
___
|
328
|
+
|
329
|
+
### replaceAccentuatedChars
|
330
|
+
|
331
|
+
▸ `Static` **replaceAccentuatedChars**(`text`, `removeSpecialChars?`): `string`
|
332
|
+
|
333
|
+
Remove acentuação de vogais e de caracteres especiais que não sejam letras ou numeral.
|
334
|
+
|
335
|
+
**`Example`**
|
336
|
+
|
337
|
+
```ts
|
338
|
+
entrada: "á@Êç#Ò", false // retorno: "a@Ec#O"
|
339
|
+
entrada: "á@Êç#Ò", true // retorno: "aEcO"
|
340
|
+
```
|
341
|
+
|
342
|
+
#### Parameters
|
343
|
+
|
344
|
+
| Name | Type | Default value | Description |
|
345
|
+
| :------ | :------ | :------ | :------ |
|
346
|
+
| `text` | `string` | `undefined` | String para ser transformada. |
|
347
|
+
| `removeSpecialChars` | `boolean` | `true` | Remove outros caracteres especiais que não sejam letras e números. |
|
348
|
+
|
349
|
+
#### Returns
|
350
|
+
|
351
|
+
`string`
|
352
|
+
|
353
|
+
#### Defined in
|
354
|
+
|
355
|
+
src/utils/StringUtils.ts:105
|
356
|
+
|
357
|
+
___
|
358
|
+
|
359
|
+
### replaceAccentuatedCharsKeepSymbols
|
360
|
+
|
361
|
+
▸ `Static` **replaceAccentuatedCharsKeepSymbols**(`text`): `string`
|
362
|
+
|
363
|
+
Remove acentos de vogais, substitui Ç por c e retorna a string em caixa alta mantendo espaços e símbolos.
|
364
|
+
|
365
|
+
#### Parameters
|
366
|
+
|
367
|
+
| Name | Type | Description |
|
368
|
+
| :------ | :------ | :------ |
|
369
|
+
| `text` | `string` | Texto para ser transformado. |
|
370
|
+
|
371
|
+
#### Returns
|
372
|
+
|
373
|
+
`string`
|
374
|
+
|
375
|
+
- Texto sem acentuação e caixa alta, mantendo espaços e símbolos.
|
376
|
+
|
377
|
+
#### Defined in
|
378
|
+
|
379
|
+
src/utils/StringUtils.ts:121
|
380
|
+
|
381
|
+
___
|
382
|
+
|
383
|
+
### replaceAccentuatedCharsLower
|
384
|
+
|
385
|
+
▸ `Static` **replaceAccentuatedCharsLower**(`text`): `string`
|
386
|
+
|
387
|
+
Remove acentos de vogais minúsculas.
|
388
|
+
|
389
|
+
**`Example`**
|
390
|
+
|
391
|
+
```ts
|
392
|
+
entrada: "áêçò" // retorno: "aeco"
|
393
|
+
```
|
394
|
+
|
395
|
+
#### Parameters
|
396
|
+
|
397
|
+
| Name | Type | Description |
|
398
|
+
| :------ | :------ | :------ |
|
399
|
+
| `text` | `string` | String para ser transformada. |
|
400
|
+
|
401
|
+
#### Returns
|
402
|
+
|
403
|
+
`string`
|
404
|
+
|
405
|
+
#### Defined in
|
406
|
+
|
407
|
+
src/utils/StringUtils.ts:85
|
408
|
+
|
409
|
+
___
|
410
|
+
|
411
|
+
### replaceAccentuatedCharsUpper
|
412
|
+
|
413
|
+
▸ `Static` **replaceAccentuatedCharsUpper**(`text`): `string`
|
414
|
+
|
415
|
+
Remove acentos de vogais maiúsculas
|
416
|
+
|
417
|
+
**`Example`**
|
418
|
+
|
419
|
+
```ts
|
420
|
+
entrada: "ÁÊÇÒ" // retorno: "AECO"
|
421
|
+
```
|
422
|
+
|
423
|
+
#### Parameters
|
424
|
+
|
425
|
+
| Name | Type | Description |
|
426
|
+
| :------ | :------ | :------ |
|
427
|
+
| `text` | `string` | String para ser transformada. |
|
428
|
+
|
429
|
+
#### Returns
|
430
|
+
|
431
|
+
`string`
|
432
|
+
|
433
|
+
#### Defined in
|
434
|
+
|
435
|
+
src/utils/StringUtils.ts:38
|
436
|
+
|
437
|
+
___
|
438
|
+
|
439
|
+
### replaceBlankCharacters
|
440
|
+
|
441
|
+
▸ `Static` **replaceBlankCharacters**(`value`): `string`
|
442
|
+
|
443
|
+
Utilitário para remover caracteres em branco da string.
|
444
|
+
|
445
|
+
#### Parameters
|
446
|
+
|
447
|
+
| Name | Type | Description |
|
448
|
+
| :------ | :------ | :------ |
|
449
|
+
| `value` | `string` | String a ser removido os espaços. |
|
450
|
+
|
451
|
+
#### Returns
|
452
|
+
|
453
|
+
`string`
|
454
|
+
|
455
|
+
String sem espaços em branco.
|
456
|
+
|
457
|
+
#### Defined in
|
458
|
+
|
459
|
+
src/utils/StringUtils.ts:298
|
460
|
+
|
461
|
+
___
|
462
|
+
|
463
|
+
### toCamelCase
|
464
|
+
|
465
|
+
▸ `Static` **toCamelCase**(`value`): `string`
|
466
|
+
|
467
|
+
Converte string em camelCase.
|
468
|
+
Combina palavras compostas ou frases, alterando a inicial de cada uma, a partir da primeira, para maiúscula e unidas sem espaços.
|
469
|
+
|
470
|
+
**`Example`**
|
471
|
+
|
472
|
+
```ts
|
473
|
+
toCamelCase('Exemplo de uso') | Retorna: 'exemploDeUso'
|
474
|
+
```
|
475
|
+
|
476
|
+
#### Parameters
|
477
|
+
|
478
|
+
| Name | Type | Description |
|
479
|
+
| :------ | :------ | :------ |
|
480
|
+
| `value` | `string` | String a ser convertida. |
|
481
|
+
|
482
|
+
#### Returns
|
483
|
+
|
484
|
+
`string`
|
485
|
+
|
486
|
+
String convertida em camelCase.
|
487
|
+
|
488
|
+
#### Defined in
|
489
|
+
|
490
|
+
src/utils/StringUtils.ts:249
|
491
|
+
|
492
|
+
___
|
493
|
+
|
494
|
+
### toKebabCase
|
495
|
+
|
496
|
+
▸ `Static` **toKebabCase**(`value`): `string`
|
497
|
+
|
498
|
+
Utilitário para converter string em kebab-case.
|
499
|
+
|
500
|
+
#### Parameters
|
501
|
+
|
502
|
+
| Name | Type | Description |
|
503
|
+
| :------ | :------ | :------ |
|
504
|
+
| `value` | `string` | String a ser convertida. |
|
505
|
+
|
506
|
+
#### Returns
|
507
|
+
|
508
|
+
`string`
|
509
|
+
|
510
|
+
String convertida em KebabCase.
|
511
|
+
|
512
|
+
#### Defined in
|
513
|
+
|
514
|
+
src/utils/StringUtils.ts:289
|
515
|
+
|
516
|
+
___
|
517
|
+
|
518
|
+
### toPascalCase
|
519
|
+
|
520
|
+
▸ `Static` **toPascalCase**(`value`): `string`
|
521
|
+
|
522
|
+
Converte string para PascalCase.
|
523
|
+
|
524
|
+
#### Parameters
|
525
|
+
|
526
|
+
| Name | Type | Description |
|
527
|
+
| :------ | :------ | :------ |
|
528
|
+
| `value` | `string` | String a ser convertida. |
|
529
|
+
|
530
|
+
#### Returns
|
531
|
+
|
532
|
+
`string`
|
533
|
+
|
534
|
+
String convertida em PascalCase.
|
535
|
+
|
536
|
+
#### Defined in
|
537
|
+
|
538
|
+
src/utils/StringUtils.ts:264
|
539
|
+
|
540
|
+
___
|
541
|
+
|
542
|
+
### toSnakeCase
|
543
|
+
|
544
|
+
▸ `Static` **toSnakeCase**(`value`): `string`
|
545
|
+
|
546
|
+
Utilitário para converter string em snake_case.
|
547
|
+
|
548
|
+
#### Parameters
|
549
|
+
|
550
|
+
| Name | Type | Description |
|
551
|
+
| :------ | :------ | :------ |
|
552
|
+
| `value` | `string` | String a ser convertida. |
|
553
|
+
|
554
|
+
#### Returns
|
555
|
+
|
556
|
+
`string`
|
557
|
+
|
558
|
+
String convertida em snake_case.
|
559
|
+
|
560
|
+
#### Defined in
|
561
|
+
|
562
|
+
src/utils/StringUtils.ts:276
|
@@ -0,0 +1,98 @@
|
|
1
|
+
[@sankhyalabs/core](../README.md) / [Exports](../modules.md) / TimeFormatter
|
2
|
+
|
3
|
+
# Class: TimeFormatter
|
4
|
+
|
5
|
+
`TimeFormatter`: Utilizado para formatar horas.
|
6
|
+
|
7
|
+
## Table of contents
|
8
|
+
|
9
|
+
### Constructors
|
10
|
+
|
11
|
+
- [constructor](TimeFormatter.md#constructor)
|
12
|
+
|
13
|
+
### Properties
|
14
|
+
|
15
|
+
- [\_maskFormatter](TimeFormatter.md#_maskformatter)
|
16
|
+
|
17
|
+
### Methods
|
18
|
+
|
19
|
+
- [prepareValue](TimeFormatter.md#preparevalue)
|
20
|
+
- [validateTime](TimeFormatter.md#validatetime)
|
21
|
+
|
22
|
+
## Constructors
|
23
|
+
|
24
|
+
### constructor
|
25
|
+
|
26
|
+
• **new TimeFormatter**()
|
27
|
+
|
28
|
+
## Properties
|
29
|
+
|
30
|
+
### \_maskFormatter
|
31
|
+
|
32
|
+
▪ `Static` **\_maskFormatter**: [`MaskFormatter`](MaskFormatter-1.md)
|
33
|
+
|
34
|
+
#### Defined in
|
35
|
+
|
36
|
+
src/utils/TimeFormatter.ts:8
|
37
|
+
|
38
|
+
## Methods
|
39
|
+
|
40
|
+
### prepareValue
|
41
|
+
|
42
|
+
▸ `Static` **prepareValue**(`value`, `showSeconds`): `string`
|
43
|
+
|
44
|
+
Converte um texto para o formato de hora.
|
45
|
+
|
46
|
+
**`Exemples`**
|
47
|
+
|
48
|
+
@"1012" | "10:12"
|
49
|
+
@"10:12" | "10:12:00"
|
50
|
+
@"100112" | "10:01:12"
|
51
|
+
|
52
|
+
#### Parameters
|
53
|
+
|
54
|
+
| Name | Type | Description |
|
55
|
+
| :------ | :------ | :------ |
|
56
|
+
| `value` | `string` | Texto não formatado. |
|
57
|
+
| `showSeconds` | `boolean` | Se será validado os segundos. |
|
58
|
+
|
59
|
+
#### Returns
|
60
|
+
|
61
|
+
`string`
|
62
|
+
|
63
|
+
- Texto em formato de hora.
|
64
|
+
|
65
|
+
#### Defined in
|
66
|
+
|
67
|
+
src/utils/TimeFormatter.ts:22
|
68
|
+
|
69
|
+
___
|
70
|
+
|
71
|
+
### validateTime
|
72
|
+
|
73
|
+
▸ `Static` **validateTime**(`value`, `showSeconds`): `boolean`
|
74
|
+
|
75
|
+
Retorna se o texto está no formato de hora.
|
76
|
+
|
77
|
+
**`Exemples`**
|
78
|
+
|
79
|
+
@"1012" | true
|
80
|
+
@"14e4" | false
|
81
|
+
@"2624" | false
|
82
|
+
|
83
|
+
#### Parameters
|
84
|
+
|
85
|
+
| Name | Type | Description |
|
86
|
+
| :------ | :------ | :------ |
|
87
|
+
| `value` | `string` | Texto a ser validado. |
|
88
|
+
| `showSeconds` | `boolean` | Se será validado os segundos. |
|
89
|
+
|
90
|
+
#### Returns
|
91
|
+
|
92
|
+
`boolean`
|
93
|
+
|
94
|
+
- Verdadeiro para valores no formato de hora e False para formatos diferentes.
|
95
|
+
|
96
|
+
#### Defined in
|
97
|
+
|
98
|
+
src/utils/TimeFormatter.ts:64
|
@@ -0,0 +1,58 @@
|
|
1
|
+
[@sankhyalabs/core](../README.md) / [Exports](../modules.md) / UserAgentUtils
|
2
|
+
|
3
|
+
# Class: UserAgentUtils
|
4
|
+
|
5
|
+
`UserAgentUtils`: Utilitario para tratativas relacionadas ao navegador.
|
6
|
+
|
7
|
+
## Table of contents
|
8
|
+
|
9
|
+
### Constructors
|
10
|
+
|
11
|
+
- [constructor](UserAgentUtils.md#constructor)
|
12
|
+
|
13
|
+
### Methods
|
14
|
+
|
15
|
+
- [getBrowserInfo](UserAgentUtils.md#getbrowserinfo)
|
16
|
+
- [isFirefox](UserAgentUtils.md#isfirefox)
|
17
|
+
|
18
|
+
## Constructors
|
19
|
+
|
20
|
+
### constructor
|
21
|
+
|
22
|
+
• **new UserAgentUtils**()
|
23
|
+
|
24
|
+
## Methods
|
25
|
+
|
26
|
+
### getBrowserInfo
|
27
|
+
|
28
|
+
▸ `Static` **getBrowserInfo**(): `any`
|
29
|
+
|
30
|
+
Obtém nome e versão do navegador que está sendo utilizado.
|
31
|
+
|
32
|
+
#### Returns
|
33
|
+
|
34
|
+
`any`
|
35
|
+
|
36
|
+
Objeto com o nome e versão do navegador.
|
37
|
+
|
38
|
+
#### Defined in
|
39
|
+
|
40
|
+
src/utils/UserAgentUtils/index.ts:22
|
41
|
+
|
42
|
+
___
|
43
|
+
|
44
|
+
### isFirefox
|
45
|
+
|
46
|
+
▸ `Static` **isFirefox**(): `boolean`
|
47
|
+
|
48
|
+
Obtém se o navegador do usuário é o firefox.
|
49
|
+
|
50
|
+
#### Returns
|
51
|
+
|
52
|
+
`boolean`
|
53
|
+
|
54
|
+
Verdadeiro se o navegador do usuário for o firefox.
|
55
|
+
|
56
|
+
#### Defined in
|
57
|
+
|
58
|
+
src/utils/UserAgentUtils/index.ts:13
|