MCPcopy Index your code
hub / github.com/nodegit/nodegit / normalizeOptions

Function normalizeOptions

lib/utils/normalize_options.js:9–27  ·  view source on GitHub ↗

* Normalize an object to match a struct. * * @param {String, Object} oid - The oid string or instance. * @return {Object} An Oid instance.

(options, Ctor)

Source from the content-addressed store, hash-verified

7 * @return {Object} An Oid instance.
8 */
9function normalizeOptions(options, Ctor) {
10 if (!options) {
11 return null;
12 }
13
14 if (options instanceof Ctor) {
15 return options;
16 }
17
18 var instance = new Ctor();
19
20 Object.keys(options).forEach(function(key) {
21 if (typeof options[key] !== "undefined") {
22 instance[key] = options[key];
23 }
24 });
25
26 return instance;
27}
28
29NodeGit.Utils.normalizeOptions = normalizeOptions;

Callers 15

checkout.jsFile · 0.85
defaultRebaseOptionsFunction · 0.85
diff.jsFile · 0.85
cherrypick.jsFile · 0.85
repository.jsFile · 0.85
blame.jsFile · 0.85
remote.jsFile · 0.85
status_list.jsFile · 0.85
reset.jsFile · 0.85
status.jsFile · 0.85
revert.jsFile · 0.85
blob.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…