Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 3d7dca84
authored
Dec 07, 2014
by
Sean Arme
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workaround to deal with an issue in node-webkit where the validate function fail…
…s on object literals.
1 parent
dfffa2b2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
lib/utils/parameter-validator.js
lib/utils/parameter-validator.js
View file @
3d7dca8
...
@@ -8,7 +8,7 @@ var validateDeprecation = function(value, expectation, options) {
...
@@ -8,7 +8,7 @@ var validateDeprecation = function(value, expectation, options) {
return
;
return
;
}
}
var
valid
=
value
instanceof
options
.
deprecated
;
var
valid
=
(
value
instanceof
options
.
deprecated
||
typeof
(
value
)
===
typeof
(
options
.
deprecated
.
call
()))
;
if
(
valid
)
{
if
(
valid
)
{
var
message
=
util
.
format
(
'%s should not be of type "%s"'
,
util
.
inspect
(
value
),
options
.
deprecated
.
name
);
var
message
=
util
.
format
(
'%s should not be of type "%s"'
,
util
.
inspect
(
value
),
options
.
deprecated
.
name
);
...
@@ -20,7 +20,7 @@ var validateDeprecation = function(value, expectation, options) {
...
@@ -20,7 +20,7 @@ var validateDeprecation = function(value, expectation, options) {
};
};
var
validate
=
function
(
value
,
expectation
,
options
)
{
var
validate
=
function
(
value
,
expectation
,
options
)
{
if
(
value
instanceof
expectation
)
{
if
(
value
instanceof
expectation
||
typeof
(
value
)
===
typeof
(
expectation
.
call
())
)
{
return
true
;
return
true
;
}
}
...
@@ -53,3 +53,4 @@ var ParameterValidator = module.exports = {
...
@@ -53,3 +53,4 @@ var ParameterValidator = module.exports = {
||
validate
(
value
,
expectation
,
options
);
||
validate
(
value
,
expectation
,
options
);
}
}
};
};
Write
Preview
Markdown
is supported
Attach a file
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 post a comment