FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nodegit/lib/filter_registry.js at master · dawnsgithub/nodegit · GitHub
dawnsgithub
nodegit
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
nodegit
/
lib
/
filter_registry.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
42 lines (35 loc) · 1.13 KB
Breadcrumbs
nodegit
/
lib
/
filter_registry.js
Copy path
File metadata and controls
42 lines (35 loc) · 1.13 KB
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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
var
NodeGit
=
require
(
"../"
)
;
var
normalizeOptions
=
NodeGit
.
Utils
.
normalizeOptions
;
var
FilterRegistry
=
NodeGit
.
FilterRegistry
;
var
_register
=
FilterRegistry
.
register
;
var
_unregister
=
FilterRegistry
.
unregister
;
// register should add filter by name to dict and return
// Override FilterRegistry.register to normalize Filter
FilterRegistry
.
register
=
function
(
name
,
filter
,
priority
,
callback
)
{
// setting default value of attributes
if
(
filter
.
attributes
===
undefined
)
{
filter
.
attributes
=
""
;
}
filter
=
normalizeOptions
(
filter
,
NodeGit
.
Filter
)
;
if
(
!
filter
.
check
||
!
filter
.
apply
)
{
return
callback
(
new
Error
(
"ERROR: please provide check and apply callbacks for filter"
)
)
;
}
return
_register
(
name
,
filter
,
priority
)
.
then
(
function
(
result
)
{
if
(
typeof
callback
===
"function"
)
{
callback
(
null
,
result
)
;
}
return
result
;
}
,
callback
)
;
}
;
FilterRegistry
.
unregister
=
function
(
name
,
callback
)
{
return
_unregister
(
name
)
.
then
(
function
(
result
)
{
if
(
typeof
callback
===
"function"
)
{
callback
(
null
,
result
)
;
}
return
result
;
}
,
callback
)
;
}
;
Back
|
FazBrowse Home
|
New Git URL