FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nodegit.nodegit/lib/utils/normalize_options.js at master · javascript-forks/nodegit.nodegit · GitHub
javascript-forks
nodegit.nodegit
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
nodegit.nodegit
/
lib
/
utils
/
normalize_options.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
23 lines (18 loc) · 495 Bytes
Breadcrumbs
nodegit.nodegit
/
lib
/
utils
/
normalize_options.js
Copy path
File metadata and controls
23 lines (18 loc) · 495 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
var
NodeGit
=
require
(
"../../"
)
;
/**
* Normalize an object to match a struct.
*
*
@param
{
String, Object
} oid - The oid string or instance.
*
@return
{
Object
} An Oid instance.
*/
function
normalizeOptions
(
options
,
Ctor
)
{
var
instance
=
options
instanceof
Ctor
?
options
:
new
Ctor
(
)
;
if
(
!
options
)
{
return
null
;
}
Object
.
keys
(
options
)
.
forEach
(
function
(
key
)
{
instance
[
key
]
=
options
[
key
]
;
}
)
;
return
instance
;
}
NodeGit
.
Utils
.
normalizeOptions
=
normalizeOptions
;
Back
|
FazBrowse Home
|
New Git URL