File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 554554 "git_index_add_all" : {
555555 "ignore" : true
556556 },
557- "git_index_add_bypath" : {
558- "jsFunctionName" : " addByPath"
559- },
560557 "git_index_conflict_get" : {
561558 "ignore" : true
562559 },
584581 "git_index_new" : {
585582 "ignore" : true
586583 },
587- "git_index_read" : {
588- "args" : {
589- "force" : {
590- "isOptional" : true
591- }
592- }
593- },
584+ "git_index_read" : {
585+ "args" : {
586+ "force" : {
587+ "isOptional" : true
588+ }
589+ }
590+ },
594591 "git_index_remove_all" : {
595592 "ignore" : true
596593 },
599596 },
600597 "git_index_update_all" : {
601598 "ignore" : true
602- },
599+ },
603600 "git_index_write" : {
604601 "args" : {
605602 "force" : {
827824 "ignore" : true
828825 },
829826 "git_oid_fromstr" : {
830- "jsFunctionName" : " fromString" ,
831827 "isAsync" : false
832828 },
833829 "git_oid_fromstrn" : {
852848 "ignore" : true
853849 },
854850 "git_oid_tostr" : {
855- "ignore" : true ,
856- "jsFunctionName" : " toString"
851+ "ignore" : true
857852 }
858853 },
859854 "fields" : {
Original file line number Diff line number Diff line change @@ -75,7 +75,18 @@ var Utils = {
7575 } ,
7676
7777 cTypeToJsName : function ( cType , ownerType ) {
78- return Utils . camelCase ( Utils . cTypeToCppName ( cType , ownerType ) . replace ( "Git" , "" ) ) ;
78+ var output = Utils . camelCase ( Utils . cTypeToCppName ( cType , ownerType ) . replace ( / ^ G i t / , "" ) ) ;
79+ var mergedPrefixes = [ "from" , "by" ] ;
80+
81+ mergedPrefixes . forEach ( function ( prefix ) {
82+ var reg = new RegExp ( "(^" + prefix + "|" + Utils . titleCase ( prefix ) + ")([a-z]+)$" ) ;
83+ output = output . replace ( reg , function ( all , prefixMatch , otherWord ) {
84+ return prefixMatch + Utils . titleCase ( otherWord ) ;
85+ } ) ;
86+ } ) ;
87+
88+ output = output . replace ( / ( [ a - z ] ) S t r $ / , "$1String" )
89+ return output ;
7990 } ,
8091
8192 isConstructorFunction : function ( cType , fnName ) {
@@ -287,7 +298,6 @@ var Utils = {
287298 fnDef . jsFunctionName = Utils . cTypeToJsName ( key , "git_" + typeDef . typeName ) ;
288299 //fnDef.isAsync = false; // until proven otherwise
289300
290-
291301 if ( fnDef . cppFunctionName == typeDef . cppClassName ) {
292302 fnDef . cppFunctionName = fnDef . cppFunctionName . replace ( "Git" , "" ) ;
293303 }
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Index.prototype.entries = function() {
1111 var result = [ ] ;
1212
1313 for ( var i = 0 ; i < size ; i ++ ) {
14- result . push ( this . entry ( i ) ) ;
14+ result . push ( this . getByIndex ( i ) ) ;
1515 }
1616
1717 return result ;
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ var Treebuilder = git.Treebuilder;
44var Diff = git . Diff ;
55var events = require ( "events" ) ;
66
7+ var oldEntryByIndex = Tree . prototype . entryByIndex ;
78// Backwards compatibility.
89Object . defineProperties ( Tree . prototype , {
910 "size" : {
@@ -34,8 +35,9 @@ Tree.prototype.diff = function(tree, callback) {
3435 * @param {Number } i
3536 * @return {TreeEntry }
3637 */
38+
3739Tree . prototype . entryByIndex = function ( i ) {
38- var entry = this . entryByindex ( i ) ;
40+ var entry = oldEntryByIndex . call ( this , i ) ;
3941 entry . parent = this ;
4042 return entry ;
4143} ;
@@ -62,7 +64,7 @@ Tree.prototype.entryByName = function(name) {
6264Tree . prototype . getEntry = function ( path , callback ) {
6365 var tree = this ;
6466
65- return this . entryBypath ( path ) . then ( function ( entry ) {
67+ return this . entryByPath ( path ) . then ( function ( entry ) {
6668 entry . parent = tree ;
6769
6870 if ( typeof callback === "function" ) {
You can’t perform that action at this time.
0 commit comments