string-kit
Advanced tools
Comparing version 0.11.6 to 0.11.7
@@ -42,2 +42,3 @@ /* | ||
const unicode = require( './unicode.js' ) ; | ||
const naturalSort = require( './naturalSort.js' ) ; | ||
@@ -51,3 +52,3 @@ | ||
%r raw string: without sanitizer | ||
%n natural: output the most natural representation for this type | ||
%n natural: output the most natural representation for this type, object entries are sorted by keys | ||
%N even more natural: avoid type hinting marks like bracket for array | ||
@@ -314,3 +315,4 @@ %f float | ||
// Plain objects | ||
arg = Object.entries( arg ).map( e => e[ 0 ] + ': ' + modes.N( e[ 1 ] , true ) ) ; | ||
arg = Object.entries( arg ).sort( naturalSort ) | ||
.map( e => e[ 0 ] + ': ' + modes.N( e[ 1 ] , true ) ) ; | ||
@@ -317,0 +319,0 @@ if ( isSubCall ) { |
{ | ||
"name": "string-kit", | ||
"version": "0.11.6", | ||
"version": "0.11.7", | ||
"engines": { | ||
@@ -56,2 +56,2 @@ "node": ">=6.0.0" | ||
} | ||
} | ||
} |
@@ -283,2 +283,6 @@ /* | ||
it( "%N and object keys sorting" , () => { | ||
expect( format( '%N' , { bob: 3 , alice: 4 , john: 2 , jack: 3 } ) ).to.be( 'alice: 4, bob: 3, jack: 3, john: 2' ) ; | ||
} ) ; | ||
it( "format.count() should count the number of arguments found" , () => { | ||
@@ -285,0 +289,0 @@ expect( format.count( 'blah blih blah' ) ).to.be( 0 ) ; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
254872
3851