Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
0418a471
Commit
0418a471
authored
Apr 08, 2021
by
好多大米
Committed by
GitHub
Apr 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: update isFunction (#20912)
parent
0606cb8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
src/utils/types.js
src/utils/types.js
+17
-1
No files found.
src/utils/types.js
View file @
0418a471
import
Vue
from
'
vue
'
;
export
function
isString
(
obj
)
{
return
Object
.
prototype
.
toString
.
call
(
obj
)
===
'
[object String]
'
;
}
...
...
@@ -10,11 +12,25 @@ export function isHtmlElement(node) {
return
node
&&
node
.
nodeType
===
Node
.
ELEMENT_NODE
;
}
export
const
isFunction
=
(
functionToCheck
)
=>
{
/**
* - Inspired:
* https://github.com/jashkenas/underscore/blob/master/modules/isFunction.js
*/
let
isFunction
=
(
functionToCheck
)
=>
{
var
getType
=
{};
return
functionToCheck
&&
getType
.
toString
.
call
(
functionToCheck
)
===
'
[object Function]
'
;
};
if
(
typeof
/./
!==
'
function
'
&&
typeof
Int8Array
!==
'
object
'
&&
(
Vue
.
prototype
.
$isServer
||
typeof
document
.
childNodes
!==
'
function
'
))
{
isFunction
=
function
(
obj
)
{
return
typeof
obj
===
'
function
'
||
false
;
};
}
export
{
isFunction
};
export
const
isUndefined
=
(
val
)
=>
{
return
val
===
void
0
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment