forked from globalizejs/globalize
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Runtime: Fix unitFormatter with numberFormatter
JSON.stringify omits functions, so the generated runtimeKey did not depend on the value of the numberFormatter option, causing different unitFormatters to have an identical runtimeKey. Fixes globalizejs#704
- Loading branch information
Showing
5 changed files
with
26 additions
and
7 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
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
define([], function( ) { | ||
|
||
return function( args ) { | ||
return JSON.stringify( args, function( key, value ) { | ||
if ( typeof value === "function" ) { | ||
return value.runtimeKey; // if undefined, the value will be filtered out. | ||
} | ||
return value; | ||
} ); | ||
}; | ||
|
||
}); |
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