Skip to content

Commit

Permalink
v 0.2.11 agrego la opición doNotOutputNonCopyables para no generar lo…
Browse files Browse the repository at this point in the history
…s puntos de miles
  • Loading branch information
emilioplatzer committed Sep 17, 2017
1 parent ac3ec64 commit 31d4a58
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "type-store",
"description": "type ecosystem",
"version": "0.2.10",
"version": "0.2.11",
"author": "Codenautas <codenautas@googlegroups.com>",
"repository": "codenautas/type-store",
"license": "MIT",
Expand Down
4 changes: 4 additions & 0 deletions test/test-bigint.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ describe("bigint", function(){
"<span class='number-dot'>.</span>"+
"<span class='number-decimals'>67</span></span>"
);
discrepances.showAndThrow(typeDecimal.toLocalString(value),'12,345.67');
TypeStore.options.doNotCopyNonCopyables=false;
TypeStore.options.doNotOutputNonCopyables=true;
discrepances.showAndThrow(typeDecimal.toLocalString(value),'12345.67');
TypeStore.options.doNotOutputNonCopyables=false;
});
it("have right align", function(){
discrepances.showAndThrow(typeBigint.align, 'right');
Expand Down
7 changes: 6 additions & 1 deletion type-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,12 @@ TypeBase.prototype.toLocalString=function toLocalString(typedValue){
if(this.toLocalParts){
return this.toLocalParts(
typedValue,
function Part(part){return part;},
function Part(part, className, skippable){
if(skippable && TypeStore.options.doNotOutputNonCopyables){
return '';
}
return part;
},
function Parts(parts){return parts.join('');}
);
}else{
Expand Down

0 comments on commit 31d4a58

Please sign in to comment.