@sankhyalabs/core 5.20.0-dev.78 → 5.20.0-dev.79
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/.docs/classes/ObjectUtils.md +50 -2
- package/.docs/classes/StringUtils.md +10 -10
- package/dist/utils/ObjectUtils.d.ts +14 -0
- package/dist/utils/ObjectUtils.js +20 -0
- package/dist/utils/ObjectUtils.js.map +1 -1
- package/dist/utils/StringUtils.js +12 -6
- package/dist/utils/StringUtils.js.map +1 -1
- package/package.json +1 -1
- package/reports/test-report.xml +687 -142
- package/src/utils/ObjectUtils.ts +21 -0
- package/src/utils/StringUtils.ts +10 -6
- package/test/testCases/NumberUtilsTestCases.ts +190 -0
- package/test/testCases/StringUtilsTestCases.ts +435 -0
- package/test/testCases/TimeFormatterTestUtils.ts +43 -0
- package/test/util/NumberUtils.spec.ts +72 -150
- package/test/util/ObjectUtils.spec.ts +572 -0
- package/test/util/StringUtils.spec.ts +260 -36
- package/test/util/TimeFormatter.spec.ts +65 -18
- package/src/utils/test/objectUtils.spec.ts +0 -109
package/src/utils/ObjectUtils.ts
CHANGED
|
@@ -120,6 +120,17 @@ export default class ObjectUtils{
|
|
|
120
120
|
return Object.keys(obj).length === 0 && obj.constructor === Object;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
/**
|
|
124
|
+
* Verifica se o objeto está vazio (sem atributos) e retorna true caso seja undefined ou null.
|
|
125
|
+
*
|
|
126
|
+
* @param obj - Objeto a ser verificado.
|
|
127
|
+
* @returns - True caso o objeto esteja vazio.
|
|
128
|
+
*/
|
|
129
|
+
public static isEmptySafetyCheck(obj: object): boolean{
|
|
130
|
+
if(obj === null || obj === undefined) return true;
|
|
131
|
+
return Object.keys(obj).length === 0 && obj.constructor === Object;
|
|
132
|
+
}
|
|
133
|
+
|
|
123
134
|
/**
|
|
124
135
|
* Verifica se o objeto NÃO está vazio (sem atributos).
|
|
125
136
|
*
|
|
@@ -130,6 +141,16 @@ export default class ObjectUtils{
|
|
|
130
141
|
return !this.isEmpty(obj);
|
|
131
142
|
}
|
|
132
143
|
|
|
144
|
+
/**
|
|
145
|
+
* Verifica se o objeto NÃO está vazio (sem atributos) e retorna false caso objeto seja null ou undefined.
|
|
146
|
+
*
|
|
147
|
+
* @param obj - Objeto a ser verificado.
|
|
148
|
+
* @returns - True caso o objeto NÃO esteja vazio
|
|
149
|
+
*/
|
|
150
|
+
public static isNotEmptySafetyCheck(obj: object): boolean{
|
|
151
|
+
return !this.isEmptySafetyCheck(obj);
|
|
152
|
+
}
|
|
153
|
+
|
|
133
154
|
/**
|
|
134
155
|
* Busca a propriedade de um objeto baseado em seu caminho.
|
|
135
156
|
*
|
package/src/utils/StringUtils.ts
CHANGED
|
@@ -289,7 +289,7 @@ export class StringUtils {
|
|
|
289
289
|
* @returns String convertida em PascalCase.
|
|
290
290
|
*/
|
|
291
291
|
static toPascalCase(value: string): string{
|
|
292
|
-
return value
|
|
292
|
+
return (value || "")
|
|
293
293
|
.toLowerCase()
|
|
294
294
|
.replace(/(?:^|\s)\w/g, (match: string) => match.toUpperCase())
|
|
295
295
|
.replace(/[\s-_]/g,'');
|
|
@@ -301,7 +301,7 @@ export class StringUtils {
|
|
|
301
301
|
* @returns String convertida em snake_case.
|
|
302
302
|
*/
|
|
303
303
|
static toSnakeCase(value: string): string{
|
|
304
|
-
return value
|
|
304
|
+
return (value || "")
|
|
305
305
|
.toLowerCase()
|
|
306
306
|
.replace(/[A-Z]/g, (match: string) => `_${match.toLowerCase()}`)
|
|
307
307
|
.replace(/[\s-]/g, '_')
|
|
@@ -314,7 +314,7 @@ export class StringUtils {
|
|
|
314
314
|
* @returns String convertida em KebabCase.
|
|
315
315
|
*/
|
|
316
316
|
static toKebabCase(value: string): string{
|
|
317
|
-
return value.replace(/([a-z])([A-Z])/g, '$1-$2').replace(/[\s_]+/g, '-').toLowerCase();
|
|
317
|
+
return (value || "").replace(/([a-z])([A-Z])/g, '$1-$2').replace(/[\s_]+/g, '-').toLowerCase();
|
|
318
318
|
}
|
|
319
319
|
|
|
320
320
|
/**
|
|
@@ -336,13 +336,13 @@ export class StringUtils {
|
|
|
336
336
|
const units = ["B", "KB", "MB", "GB"];
|
|
337
337
|
|
|
338
338
|
if (bytes < 1024) {
|
|
339
|
-
return `${bytes
|
|
339
|
+
return `${bytes?.toString()}B`;
|
|
340
340
|
}
|
|
341
341
|
|
|
342
342
|
const base = Math.log(bytes) / Math.log(1024);
|
|
343
343
|
const offSet = Math.floor(base);
|
|
344
344
|
if (offSet >= units.length) {
|
|
345
|
-
return `${bytes
|
|
345
|
+
return `${bytes?.toString()}B`;
|
|
346
346
|
}
|
|
347
347
|
|
|
348
348
|
const value = this.prettyPrecision(Math.pow(1024, base - offSet).toFixed(2).toString());
|
|
@@ -389,6 +389,8 @@ export class StringUtils {
|
|
|
389
389
|
* @return {boolean} Se a string pode ser convertida
|
|
390
390
|
*/
|
|
391
391
|
static isCaseable(original: string): boolean {
|
|
392
|
+
if(original == null) return false;
|
|
393
|
+
|
|
392
394
|
const uppercase = original.toUpperCase()
|
|
393
395
|
const lowercase = original.toLowerCase()
|
|
394
396
|
|
|
@@ -402,6 +404,7 @@ export class StringUtils {
|
|
|
402
404
|
* @return {boolean} Se a string é minúscula
|
|
403
405
|
*/
|
|
404
406
|
static isLowerCase(original: string): boolean {
|
|
407
|
+
if(original == null) return false;
|
|
405
408
|
const uppercase = original.toUpperCase()
|
|
406
409
|
|
|
407
410
|
return this.isCaseable(original) && uppercase !== original
|
|
@@ -414,6 +417,7 @@ export class StringUtils {
|
|
|
414
417
|
* @return {string} A string invertida
|
|
415
418
|
*/
|
|
416
419
|
static getOppositeCase(original: string): string {
|
|
420
|
+
if(original == null) return "";
|
|
417
421
|
return this.isLowerCase(original) ? original.toUpperCase() : original.toLowerCase()
|
|
418
422
|
}
|
|
419
423
|
|
|
@@ -487,7 +491,7 @@ export class StringUtils {
|
|
|
487
491
|
}
|
|
488
492
|
|
|
489
493
|
public static highlightValue(argument: String, matchFields: any, value: string, fieldMD: any, forceMatch: boolean) {
|
|
490
|
-
const startHighlightTag = "<span class='card-item__highlight'>";
|
|
494
|
+
const startHighlightTag = "<span class='card-item__highlight'>"; //FIXME: valor hardcoded, não podemos reaproveitar para outros cenários, dessa forma.
|
|
491
495
|
const endHighlightTag = "</span>";
|
|
492
496
|
let valueAux = JSUtils.replaceHtmlEntities(value);
|
|
493
497
|
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
export const stringToNumberCases = [
|
|
2
|
+
{ valueInput: '100', valueOutput: 100 },
|
|
3
|
+
{ valueInput: '100,12', valueOutput: 100.12 },
|
|
4
|
+
{ valueInput: '11500,12', valueOutput: 11500.12 },
|
|
5
|
+
{ valueInput: '11500', valueOutput: 11500 },
|
|
6
|
+
{ valueInput: '1.000', valueOutput: 1 },
|
|
7
|
+
{ valueInput: '11.500,003', valueOutput: 11500.003 },
|
|
8
|
+
{ valueInput: '-100', valueOutput: -100 },
|
|
9
|
+
{ valueInput: '-100,12', valueOutput: -100.12 },
|
|
10
|
+
{ valueInput: '-11500,1', valueOutput: -11500.1 },
|
|
11
|
+
{ valueInput: '-11500', valueOutput: -11500 },
|
|
12
|
+
{ valueInput: '-11.500,003', valueOutput: -11500.003 },
|
|
13
|
+
{ valueInput: 'R$100', valueOutput: 100 },
|
|
14
|
+
{ valueInput: 'R$100,12', valueOutput: 100.12 },
|
|
15
|
+
{ valueInput: 'R$11500,12', valueOutput: 11500.12 },
|
|
16
|
+
{ valueInput: 'R$11500', valueOutput: 11500 },
|
|
17
|
+
{ valueInput: 'R$11.500,003', valueOutput: 11500.003 },
|
|
18
|
+
{ valueInput: '-R$100', valueOutput: -100 },
|
|
19
|
+
{ valueInput: '-R$100,12', valueOutput: -100.12 },
|
|
20
|
+
{ valueInput: '-R$11500,12', valueOutput: -11500.12 },
|
|
21
|
+
{ valueInput: '-R$11500', valueOutput: -11500 },
|
|
22
|
+
{ valueInput: '-R$11.500,003', valueOutput: -11500.003 },
|
|
23
|
+
{ valueInput: '', valueOutput: NaN },
|
|
24
|
+
{ valueInput: 'OrdinaryString', valueOutput: NaN },
|
|
25
|
+
{ valueInput: '100.167.80', valueOutput: NaN },
|
|
26
|
+
{ valueInput: 'uahsuhas,auhsuhasu', valueOutput: NaN },
|
|
27
|
+
{ valueInput: '100,100,100', valueOutput: NaN },
|
|
28
|
+
{ valueInput: 'OrdinaryString,.OrdinaryString', valueOutput: NaN },
|
|
29
|
+
{ valueInput: 'OrdinaryString.,OrdinaryString', valueOutput: NaN },
|
|
30
|
+
{ valueInput: '.121212', valueOutput: 0.121212 },
|
|
31
|
+
{ valueInput: ',121212', valueOutput: 0.121212 },
|
|
32
|
+
{ valueInput: '1,232,333.345', valueOutput: NaN },
|
|
33
|
+
{ valueInput: '1232333,345', valueOutput: 1232333.345 },
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
export const formatCases = [
|
|
37
|
+
|
|
38
|
+
{ precision: 4, prettyprecision: 2, strvalue: '1.200.999,3333', strvalueOutPut: '1.200.999,3333' },
|
|
39
|
+
{ precision: 2, prettyprecision: 1, strvalue: '1.000', strvalueOutPut: '1,0' },
|
|
40
|
+
{ precision: 2, prettyprecision: 1, strvalue: '1200999,99', strvalueOutPut: '1.200.999,99' },
|
|
41
|
+
{ precision: 4, prettyprecision: 2, strvalue: '1,232,333.345', strvalueOutPut: 'NaN' },
|
|
42
|
+
{ precision: 2, prettyprecision: 1, strvalue: '1,23', strvalueOutPut: '1,23' },
|
|
43
|
+
{ precision: 4, prettyprecision: 2, strvalue: '1.200.999', strvalueOutPut: 'NaN' },
|
|
44
|
+
{ precision: 4, prettyprecision: 0, strvalue: '1200.00001', strvalueOutPut: '1.200' },
|
|
45
|
+
{ precision: 4, prettyprecision: 0, strvalue: 'String', strvalueOutPut: 'NaN' },
|
|
46
|
+
{ precision: 4, prettyprecision: 0, strvalue: '', strvalueOutPut: 'NaN' },
|
|
47
|
+
|
|
48
|
+
{ precision: 4, prettyprecision: undefined, strvalue: '1.200.999,3333', strvalueOutPut: '1.200.999,3333' },
|
|
49
|
+
{ precision: 2, prettyprecision: undefined, strvalue: '1.000', strvalueOutPut: '1,00' },
|
|
50
|
+
{ precision: 2, prettyprecision: undefined, strvalue: '1200999,99', strvalueOutPut: '1.200.999,99' },
|
|
51
|
+
{ precision: 4, prettyprecision: undefined, strvalue: '1,232,333.345', strvalueOutPut: 'NaN' },
|
|
52
|
+
{ precision: 2, prettyprecision: undefined, strvalue: '1,23', strvalueOutPut: '1,23' },
|
|
53
|
+
{ precision: 4, prettyprecision: undefined, strvalue: '1.200.999', strvalueOutPut: 'NaN' },
|
|
54
|
+
{ precision: 4, prettyprecision: undefined, strvalue: 'NaN', strvalueOutPut: 'NaN' },
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
{ precision: 1, prettyprecision: -1, strvalue: '111,199', strvalueOutPut: '111,2' },
|
|
58
|
+
{ precision: 1, prettyprecision: -1, strvalue: '111,1000', strvalueOutPut: '111,1' },
|
|
59
|
+
{ precision: 1, prettyprecision: 1.3, strvalue: '111,100', strvalueOutPut: '111,1' },
|
|
60
|
+
{ precision: -1, prettyprecision: 1, strvalue: '111,1009', strvalueOutPut: '111,1009' },
|
|
61
|
+
{ precision: -1, prettyprecision: 1, strvalue: '111,1000', strvalueOutPut: '111,1' },
|
|
62
|
+
{ precision: 1.2, prettyprecision: 1, strvalue: '111,1009', strvalueOutPut: '111,1009' },
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
{ precision: 2, prettyprecision: -1, strvalue: '111,199', strvalueOutPut: '111,20' },
|
|
66
|
+
{ precision: 2, prettyprecision: -1, strvalue: '111,1000', strvalueOutPut: '111,10' },
|
|
67
|
+
{ precision: -2, prettyprecision: 1, strvalue: '111,1009', strvalueOutPut: '111,1009' },
|
|
68
|
+
{ precision: -2, prettyprecision: 1, strvalue: '111,1000', strvalueOutPut: '111,1' },
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
];
|
|
72
|
+
|
|
73
|
+
export const changeFormatCases = [
|
|
74
|
+
{ inputValue: '1.200.999', outPutValue: '1,200,999' },
|
|
75
|
+
{ inputValue: '1.000,99', outPutValue: '1,000.99' },
|
|
76
|
+
{ inputValue: '1200999,99', outPutValue: '1200999.99' },
|
|
77
|
+
{ inputValue: 'R$ 1,232,333.345', outPutValue: 'R$ 1.232.333,345' },
|
|
78
|
+
{ inputValue: 'R$ 1.232.333,345', outPutValue: 'R$ 1,232,333.345' },
|
|
79
|
+
]
|
|
80
|
+
|
|
81
|
+
export const keepOnlyDecimalSeparatorCases = [
|
|
82
|
+
|
|
83
|
+
{ formatnumber: 'pt-BR', inputValue: '1.200.999', outPutValue: '1200999' },
|
|
84
|
+
{ formatnumber: 'pt-BR', inputValue: '1000,99', outPutValue: '1000,99' },
|
|
85
|
+
{ formatnumber: 'pt-BR', inputValue: '1200999,99', outPutValue: '1200999,99' },
|
|
86
|
+
{ formatnumber: 'pt-BR', inputValue: 'R$ 1.232.333,345', outPutValue: 'R$ 1232333,345' },
|
|
87
|
+
|
|
88
|
+
{ formatnumber: 'en-US', inputValue: '1,200,999', outPutValue: '1200999' },
|
|
89
|
+
{ formatnumber: 'en-US', inputValue: '1,000.99', outPutValue: '1000.99' },
|
|
90
|
+
{ formatnumber: 'en-US', inputValue: '1200999.99', outPutValue: '1200999.99' },
|
|
91
|
+
{ formatnumber: 'en-US', inputValue: 'EUR 1,232,333.345', outPutValue: 'EUR 1232333.345' },
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
];
|
|
95
|
+
|
|
96
|
+
export const roundTestCases = [
|
|
97
|
+
{ decimal: undefined, inputValue: 100.12, outPutValue: 100.12 },
|
|
98
|
+
{ decimal: 1, inputValue: 100.12, outPutValue: 100.1 },
|
|
99
|
+
{ decimal: 2, inputValue: 100.12, outPutValue: 100.12 },
|
|
100
|
+
{ decimal: 3, inputValue: 100.12, outPutValue: 100.12 },
|
|
101
|
+
{ decimal: 1, inputValue: 100.15, outPutValue: 100.2 },
|
|
102
|
+
{ decimal: 2, inputValue: 100.15, outPutValue: 100.15 },
|
|
103
|
+
{ decimal: 3, inputValue: 100.15, outPutValue: 100.15 },
|
|
104
|
+
{ decimal: 1, inputValue: 100.16, outPutValue: 100.2 },
|
|
105
|
+
{ decimal: 2, inputValue: 100.16, outPutValue: 100.16 },
|
|
106
|
+
{ decimal: 3, inputValue: 100.16, outPutValue: 100.16 },
|
|
107
|
+
{ decimal: 12, inputValue: 2118000000000.0002, outPutValue: 2118000000000.0002 },
|
|
108
|
+
{ decimal: 5, inputValue: 123.45, outPutValue: 123.45 },
|
|
109
|
+
{ decimal: 0, inputValue: 123.45, outPutValue: 123 },
|
|
110
|
+
];
|
|
111
|
+
|
|
112
|
+
export const safeFormatCases = [
|
|
113
|
+
|
|
114
|
+
{ precision: 4, prettyprecision: 2, strvalue: '1.200.999,3333', strvalueOutPut: '1.200.999,3333' },
|
|
115
|
+
{ precision: 2, prettyprecision: 1, strvalue: '1.000', strvalueOutPut: '1,0' },
|
|
116
|
+
{ precision: 2, prettyprecision: 1, strvalue: '1200999,99', strvalueOutPut: '1.200.999,99' },
|
|
117
|
+
{ precision: 4, prettyprecision: 2, strvalue: '1,232,333.345', strvalueOutPut: '0,00' },
|
|
118
|
+
{ precision: 2, prettyprecision: 1, strvalue: '1,23', strvalueOutPut: '1,23' },
|
|
119
|
+
{ precision: 4, prettyprecision: 2, strvalue: '1.200.999', strvalueOutPut: '0,00' },
|
|
120
|
+
{ precision: 4, prettyprecision: 0, strvalue: '1200.00001', strvalueOutPut: '1.200' },
|
|
121
|
+
{ precision: 4, prettyprecision: 0, strvalue: 'String', strvalueOutPut: '0,00' },
|
|
122
|
+
{ precision: 4, prettyprecision: 0, strvalue: '', strvalueOutPut: '0,00' },
|
|
123
|
+
|
|
124
|
+
{ precision: 4, prettyprecision: undefined, strvalue: '1.200.999,3333', strvalueOutPut: '1.200.999,3333' },
|
|
125
|
+
{ precision: 2, prettyprecision: undefined, strvalue: '1.000', strvalueOutPut: '1,00' },
|
|
126
|
+
{ precision: 2, prettyprecision: undefined, strvalue: '1200999,99', strvalueOutPut: '1.200.999,99' },
|
|
127
|
+
{ precision: 4, prettyprecision: undefined, strvalue: '1,232,333.345', strvalueOutPut: '0,00' },
|
|
128
|
+
{ precision: 2, prettyprecision: undefined, strvalue: '1,23', strvalueOutPut: '1,23' },
|
|
129
|
+
{ precision: 4, prettyprecision: undefined, strvalue: '1.200.999', strvalueOutPut: '0,00' },
|
|
130
|
+
{ precision: 4, prettyprecision: undefined, strvalue: 'NaN', strvalueOutPut: '0,00' },
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
{ precision: 1, prettyprecision: -1, strvalue: '111,199', strvalueOutPut: '111,2' },
|
|
134
|
+
{ precision: 1, prettyprecision: -1, strvalue: '111,1000', strvalueOutPut: '111,1' },
|
|
135
|
+
{ precision: 1, prettyprecision: 1.3, strvalue: '111,100', strvalueOutPut: '111,1' },
|
|
136
|
+
{ precision: -1, prettyprecision: 1, strvalue: '111,1009', strvalueOutPut: '111,1009' },
|
|
137
|
+
{ precision: -1, prettyprecision: 1, strvalue: '111,1000', strvalueOutPut: '111,1' },
|
|
138
|
+
{ precision: 1.2, prettyprecision: 1, strvalue: '111,1009', strvalueOutPut: '111,1009' },
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
{ precision: 2, prettyprecision: -1, strvalue: '111,199', strvalueOutPut: '111,20' },
|
|
142
|
+
{ precision: 2, prettyprecision: -1, strvalue: '111,1000', strvalueOutPut: '111,10' },
|
|
143
|
+
{ precision: -2, prettyprecision: 1, strvalue: '111,1009', strvalueOutPut: '111,1009' },
|
|
144
|
+
{ precision: -2, prettyprecision: 1, strvalue: '111,1000', strvalueOutPut: '111,1' },
|
|
145
|
+
];
|
|
146
|
+
|
|
147
|
+
export const getValueOrDefaultCases = [
|
|
148
|
+
{ value: undefined, defaultValue: 0, expected: 0 },
|
|
149
|
+
{ value: null, defaultValue: 10, expected: 10 },
|
|
150
|
+
{ value: '', defaultValue: 5, expected: 5 },
|
|
151
|
+
{ value: ' ', defaultValue: 7, expected: 7 },
|
|
152
|
+
{ value: '123', defaultValue: 0, expected: 123 },
|
|
153
|
+
{ value: '-123', defaultValue: 0, expected: -123 },
|
|
154
|
+
{ value: '123.45', defaultValue: 0, expected: 123.45 },
|
|
155
|
+
{ value: 'abc', defaultValue: 8, expected: 8 },
|
|
156
|
+
{ value: 'NaN', defaultValue: 15, expected: 15 },
|
|
157
|
+
{ value: '0', defaultValue: 5, expected: 0 },
|
|
158
|
+
{ value: 42, defaultValue: 0, expected: 42 },
|
|
159
|
+
{ value: -42, defaultValue: 0, expected: -42 },
|
|
160
|
+
{ value: 0, defaultValue: 100, expected: 0 },
|
|
161
|
+
{ value: NaN, defaultValue: 50, expected: 50 },
|
|
162
|
+
];
|
|
163
|
+
|
|
164
|
+
export const getValueOrZeroCases = [
|
|
165
|
+
{ value: undefined, expected: 0 },
|
|
166
|
+
{ value: null, expected: 0 },
|
|
167
|
+
{ value: '', expected: 0 },
|
|
168
|
+
{ value: ' ', expected: 0 },
|
|
169
|
+
{ value: '123', expected: 123 },
|
|
170
|
+
{ value: '-123', expected: -123 },
|
|
171
|
+
{ value: '123.45', expected: 123.45 },
|
|
172
|
+
{ value: 'abc', expected: 0 },
|
|
173
|
+
{ value: 'NaN', expected: 0 },
|
|
174
|
+
{ value: '0', expected: 0 },
|
|
175
|
+
{ value: 42, expected: 42 },
|
|
176
|
+
{ value: -42, expected: -42 },
|
|
177
|
+
{ value: 0, expected: 0 },
|
|
178
|
+
{ value: NaN, expected: 0 },
|
|
179
|
+
];
|
|
180
|
+
|
|
181
|
+
export const compareCases = [
|
|
182
|
+
{ a: 10, b: 5, expected: 1 },
|
|
183
|
+
{ a: 5, b: 10, expected: -1 },
|
|
184
|
+
{ a: 5, b: 5, expected: 0 },
|
|
185
|
+
{ a: -10, b: -5, expected: -1 },
|
|
186
|
+
{ a: -5, b: -10, expected: 1 },
|
|
187
|
+
{ a: 0, b: 0, expected: 0 },
|
|
188
|
+
{ a: 0, b: -1, expected: 1 },
|
|
189
|
+
{ a: -1, b: 0, expected: -1 },
|
|
190
|
+
];
|