| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -554,9 +554,6 @@ | |||
| 554 | 554 | "git_index_add_all": { | |
| 555 | 555 | "ignore": true | |
| 556 | 556 | }, | |
| 557 | - "git_index_add_bypath": { | ||
| 558 | - "jsFunctionName": "addByPath" | ||
| 559 | - }, | ||
| 560 | 557 | "git_index_conflict_get": { | |
| 561 | 558 | "ignore": true | |
| 562 | 559 | }, | |
@@ -584,13 +581,13 @@ | |||
| 584 | 581 | "git_index_new": { | |
| 585 | 582 | "ignore": true | |
| 586 | 583 | }, | |
| 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 | + }, | ||
| 594 | 591 | "git_index_remove_all": { | |
| 595 | 592 | "ignore": true | |
| 596 | 593 | }, | |
@@ -599,7 +596,7 @@ | |||
| 599 | 596 | }, | |
| 600 | 597 | "git_index_update_all": { | |
| 601 | 598 | "ignore": true | |
| 602 | - }, | ||
| 599 | + }, | ||
| 603 | 600 | "git_index_write": { | |
| 604 | 601 | "args": { | |
| 605 | 602 | "force": { | |
@@ -827,7 +824,6 @@ | |||
| 827 | 824 | "ignore": true | |
| 828 | 825 | }, | |
| 829 | 826 | "git_oid_fromstr": { | |
| 830 | - "jsFunctionName": "fromString", | ||
| 831 | 827 | "isAsync": false | |
| 832 | 828 | }, | |
| 833 | 829 | "git_oid_fromstrn": { | |
@@ -852,8 +848,7 @@ | |||
| 852 | 848 | "ignore": true | |
| 853 | 849 | }, | |
| 854 | 850 | "git_oid_tostr": { | |
| 855 | - "ignore": true, | ||
| 856 | - "jsFunctionName": "toString" | ||
| 851 | + "ignore": true | ||
| 857 | 852 | } | |
| 858 | 853 | }, | |
| 859 | 854 | "fields": { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -75,7 +75,18 @@ var Utils = { | |||
| 75 | 75 | }, | |
| 76 | 76 | ||
| 77 | 77 | cTypeToJsName: function(cType, ownerType) { | |
| 78 | - return Utils.camelCase(Utils.cTypeToCppName(cType, ownerType).replace("Git", "")); | ||
| 78 | + var output = Utils.camelCase(Utils.cTypeToCppName(cType, ownerType).replace(/^Git/, "")); | ||
| 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])Str$/, "$1String") | ||
| 89 | + return output; | ||
| 79 | 90 | }, | |
| 80 | 91 | ||
| 81 | 92 | isConstructorFunction: function(cType, fnName) { | |
@@ -287,7 +298,6 @@ var Utils = { | |||
| 287 | 298 | fnDef.jsFunctionName = Utils.cTypeToJsName(key, "git_" + typeDef.typeName); | |
| 288 | 299 | //fnDef.isAsync = false; // until proven otherwise | |
| 289 | 300 | ||
| 290 | - | ||
| 291 | 301 | if (fnDef.cppFunctionName == typeDef.cppClassName) { | |
| 292 | 302 | fnDef.cppFunctionName = fnDef.cppFunctionName.replace("Git", ""); | |
| 293 | 303 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ Index.prototype.entries = function() { | |||
| 11 | 11 | var result = []; | |
| 12 | 12 | ||
| 13 | 13 | for (var i = 0; i < size; i++) { | |
| 14 | - result.push(this.entry(i)); | ||
| 14 | + result.push(this.getByIndex(i)); | ||
| 15 | 15 | } | |
| 16 | 16 | ||
| 17 | 17 | return result; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,6 +4,7 @@ var Treebuilder = git.Treebuilder; | |||
| 4 | 4 | var Diff = git.Diff; | |
| 5 | 5 | var events = require("events"); | |
| 6 | 6 | ||
| 7 | + var oldEntryByIndex = Tree.prototype.entryByIndex; | ||
| 7 | 8 | // Backwards compatibility. | |
| 8 | 9 | Object.defineProperties(Tree.prototype, { | |
| 9 | 10 | "size": { | |
@@ -34,8 +35,9 @@ Tree.prototype.diff = function(tree, callback) { | |||
| 34 | 35 | * @param {Number} i | |
| 35 | 36 | * @return {TreeEntry} | |
| 36 | 37 | */ | |
| 38 | + | ||
| 37 | 39 | Tree.prototype.entryByIndex = function(i) { | |
| 38 | - var entry = this.entryByindex(i); | ||
| 40 | + var entry = oldEntryByIndex.call(this, i); | ||
| 39 | 41 | entry.parent = this; | |
| 40 | 42 | return entry; | |
| 41 | 43 | }; | |
@@ -62,7 +64,7 @@ Tree.prototype.entryByName = function(name) { | |||
| 62 | 64 | Tree.prototype.getEntry = function(path, callback) { | |
| 63 | 65 | var tree = this; | |
| 64 | 66 | ||
| 65 | - return this.entryBypath(path).then(function(entry) { | ||
| 67 | + return this.entryByPath(path).then(function(entry) { | ||
| 66 | 68 | entry.parent = tree; | |
| 67 | 69 | ||
| 68 | 70 | if (typeof callback === "function") { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments