ig-serialize 1.0.5 → 1.0.6
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/package.json +1 -1
- package/serialize.js +2 -1
- package/test.js +9 -0
package/package.json
CHANGED
package/serialize.js
CHANGED
|
@@ -413,7 +413,7 @@ module.eJSON = {
|
|
|
413
413
|
var mode = 'dec'
|
|
414
414
|
if(str[j] == '0'
|
|
415
415
|
&& 'xXbBoO'.includes(str[j+1])){
|
|
416
|
-
mode = str[j+1]
|
|
416
|
+
mode = str[j+1].toLowerCase()
|
|
417
417
|
j++ }
|
|
418
418
|
j++
|
|
419
419
|
while(j < str.length
|
|
@@ -432,6 +432,7 @@ module.eJSON = {
|
|
|
432
432
|
// exponent...
|
|
433
433
|
|| str[j] == 'e'
|
|
434
434
|
|| str[j] == 'E')){
|
|
435
|
+
// exponent sign...
|
|
435
436
|
if('eE'.includes(str[j])
|
|
436
437
|
&& '+-'.includes(str[j+1])){
|
|
437
438
|
j++ }
|
package/test.js
CHANGED
|
@@ -49,6 +49,8 @@ var setups = test.Setups({
|
|
|
49
49
|
// return ['+123', json] },
|
|
50
50
|
'number-exp': function(assert){
|
|
51
51
|
return ['1e+100', json] },
|
|
52
|
+
'number-exp-neg': function(assert){
|
|
53
|
+
return ['1e-100', json] },
|
|
52
54
|
'number-zero': function(assert){
|
|
53
55
|
return ['0', json] },
|
|
54
56
|
'float-a': function(assert){
|
|
@@ -204,9 +206,16 @@ test.Cases({
|
|
|
204
206
|
['123.', '123'],
|
|
205
207
|
['+123', '123'],
|
|
206
208
|
['123e100', '123e+100'],
|
|
209
|
+
['123E100', '123e+100'],
|
|
207
210
|
['0xff', '255'],
|
|
211
|
+
['0Xff', '255'],
|
|
212
|
+
['0o77', '63'],
|
|
213
|
+
['0O77', '63'],
|
|
214
|
+
['0b11', '3'],
|
|
215
|
+
['0B11', '3'],
|
|
208
216
|
|
|
209
217
|
// string quotes...
|
|
218
|
+
// XXX test new lines...
|
|
210
219
|
["'abc'", '"abc"'],
|
|
211
220
|
['`abc`', '"abc"'],
|
|
212
221
|
|