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 bdd9005d
authored
Aug 19, 2013
by
Jan Aagaard Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't remove 0 in compactLite
1 parent
dac4e1c8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
lib/utils.js
lib/utils.js
View file @
bdd9005
...
@@ -30,6 +30,9 @@ var Utils = module.exports = {
...
@@ -30,6 +30,9 @@ var Utils = module.exports = {
return
result
return
result
},
},
/*
* Returns an array with some falsy values removed. The values null, "", undefined and NaN are considered falsey.
*/
compactLite
:
function
(
array
)
{
compactLite
:
function
(
array
)
{
var
index
=
-
1
,
var
index
=
-
1
,
length
=
array
?
array
.
length
:
0
,
length
=
array
?
array
.
length
:
0
,
...
@@ -37,7 +40,7 @@ var Utils = module.exports = {
...
@@ -37,7 +40,7 @@ var Utils = module.exports = {
while
(
++
index
<
length
)
{
while
(
++
index
<
length
)
{
var
value
=
array
[
index
];
var
value
=
array
[
index
];
if
(
typeof
value
===
"boolean"
||
value
)
{
if
(
typeof
value
===
"boolean"
||
value
===
0
||
value
)
{
result
.
push
(
value
);
result
.
push
(
value
);
}
}
}
}
...
@@ -214,7 +217,7 @@ var Utils = module.exports = {
...
@@ -214,7 +217,7 @@ var Utils = module.exports = {
}
}
}
}
return
[
text
.
join
(
' AND '
)].
concat
(
whereArgs
)
return
Utils
.
_
.
compactLite
([
text
.
join
(
' AND '
)].
concat
(
whereArgs
)
)
},
},
getWhereLogic
:
function
(
logic
)
{
getWhereLogic
:
function
(
logic
)
{
switch
(
logic
)
{
switch
(
logic
)
{
...
...
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