-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -273,7 +273,7 @@ class RootValue { | |
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 2.0.0 | ||
* @version 2.0.1 | ||
* @version 2.0.2 | ||
* | ||
* @param {Object} holder The object that holds the value | ||
* @param {String} key The key this value is held under | ||
|
@@ -312,6 +312,8 @@ class RootValue { | |
return new DateValue(holder, key, value, parent, this); | ||
} else if (dry_type === 'escape') { | ||
return new EscapedObjectValue(holder, key, value.value, parent, this); | ||
} else if (dry_type === 'bigint') { | ||
return new BigIntValue(holder, key, value, parent, this); | ||
} else { | ||
result = new UnknownUndrierValue(holder, key, value, parent, this); | ||
} | ||
|
@@ -330,7 +332,7 @@ class RootValue { | |
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 2.0.0 | ||
* @version 2.0.1 | ||
* @version 2.0.2 | ||
* | ||
* @param {Object} holder The object that holds the value | ||
* @param {String} key The key this value is held under | ||
|
@@ -356,6 +358,9 @@ class RootValue { | |
|
||
case 'number': | ||
return new NumberValue(holder, key, value, parent, this); | ||
|
||
case 'bigint': | ||
return new BigIntValue(holder, key, value, parent, this); | ||
|
||
default: | ||
return new Value(holder, key, value, parent, this); | ||
|
@@ -773,6 +778,23 @@ class NumberValue extends Value { | |
} | ||
} | ||
|
||
/** | ||
* Represent a BigInt value | ||
* | ||
* @author Jelle De Loecker <[email protected]> | ||
* @since 2.0.2 | ||
* @version 2.0.2 | ||
*/ | ||
class BigIntValue extends Value { | ||
driedValue() { | ||
return {dry: 'bigint', value: '' + this.value}; | ||
} | ||
|
||
initialRevive(value) { | ||
return BigInt(value.value); | ||
} | ||
} | ||
|
||
/** | ||
* Represent a regexp value | ||
* (For undrying) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "json-dry", | ||
"description": "Don't repeat yourself, JSON: Add support for (circular) references, class instances, ...", | ||
"version": "2.0.1", | ||
"version": "2.0.2-alpha", | ||
"author": "Jelle De Loecker <[email protected]>", | ||
"keywords": [ | ||
"json", | ||
|