File tree Expand file tree Collapse file tree 5 files changed +23
-9
lines changed
Expand file tree Collapse file tree 5 files changed +23
-9
lines changed Original file line number Diff line number Diff line change @@ -69,12 +69,12 @@ var protobuf = require("protobufjs");
6969
7070Development:
7171```
72- <script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.0.1 /dist/protobuf.js"></script>
72+ <script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.1.0 /dist/protobuf.js"></script>
7373```
7474
7575Production:
7676```
77- <script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.0.1 /dist/protobuf.min.js"></script>
77+ <script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.1.0 /dist/protobuf.min.js"></script>
7878```
7979
8080The ` protobuf ` namespace will be available globally.
Original file line number Diff line number Diff line change 11"use strict" ;
2- module . exports = json_modulee ;
2+ module . exports = json_module ;
33
44var path = require ( "path" ) ,
55 fs = require ( "fs" ) ;
66
77var protobuf = require ( "../.." ) ;
88
9- json_modulee . description = "JSON representation as a module (AMD, CommonJS, global)"
9+ json_module . description = "JSON representation as a module (AMD, CommonJS, global)"
1010
11- function json_modulee ( root , options , callback ) {
11+ function json_module ( root , options , callback ) {
1212 if ( options . wrap )
1313 options . wrap = path . resolve ( process . cwd ( ) , options . wrap ) ;
1414 else
Original file line number Diff line number Diff line change @@ -4,9 +4,23 @@ var fs = require("fs"),
44
55var protobuf = require ( ".." ) ;
66
7+ function basenameCompare ( a , b ) {
8+ var aa = String ( a ) . replace ( / \. \w + $ / , "" ) . split ( / ( - ? \d * \. ? \d + ) / g) ,
9+ bb = String ( b ) . replace ( / \. \w + $ / , "" ) . split ( / ( - ? \d * \. ? \d + ) / g) ;
10+ for ( var i = 0 , k = Math . min ( aa . length , bb . length ) ; i < k ; i ++ ) {
11+ var x = parseFloat ( aa [ i ] ) || aa [ i ] . toLowerCase ( ) ,
12+ y = parseFloat ( bb [ i ] ) || bb [ i ] . toLowerCase ( ) ;
13+ if ( x < y )
14+ return - 1 ;
15+ if ( x > y )
16+ return 1 ;
17+ }
18+ return a . length < b . length ? - 1 : 0 ;
19+ } ;
20+
721exports . requireAll = function requireAll ( dirname ) {
822 dirname = path . join ( __dirname , dirname ) ;
9- var files = fs . readdirSync ( dirname ) ,
23+ var files = fs . readdirSync ( dirname ) . sort ( basenameCompare ) ,
1024 all = { } ;
1125 files . forEach ( function ( file ) {
1226 var basename = path . basename ( file , ".js" ) ,
Original file line number Diff line number Diff line change @@ -7,12 +7,12 @@ CDN usage
77
88Development:
99```
10- <script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.0.1 /dist/protobuf.js"></script>
10+ <script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.1.0 /dist/protobuf.js"></script>
1111```
1212
1313Production:
1414```
15- <script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.0.1 /dist/protobuf.min.js"></script>
15+ <script src="//cdn.rawgit.com/dcodeIO/protobuf.js/6.1.0 /dist/protobuf.min.js"></script>
1616```
1717
1818** NOTE:** Remember to replace the version tag with the exact [ release] ( https://github.com/dcodeIO/protobuf.js/releases ) your project depends upon.
Original file line number Diff line number Diff line change 11{
22 "name" : " protobufjs" ,
3- "version" : " 6.0.2 " ,
3+ "version" : " 6.1.0 " ,
44 "description" : " Protocol Buffers for JavaScript." ,
55 "author" : " Daniel Wirtz" ,
66 "license" : " Apache-2.0" ,
You can’t perform that action at this time.
0 commit comments