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 adfbb25f
authored
Apr 17, 2014
by
Nuno Sousa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Fix hstore parse number conversion"
This reverts commit
48e04c4d
.
1 parent
4d7c9cab
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
lib/dialects/postgres/hstore.js
test/postgres/hstore.test.js
lib/dialects/postgres/hstore.js
View file @
adfbb25
var
_
=
require
(
'lodash'
)
module
.
exports
=
{
module
.
exports
=
{
stringifyPart
:
function
(
part
)
{
stringifyPart
:
function
(
part
)
{
switch
(
typeof
part
)
{
switch
(
typeof
part
)
{
...
@@ -32,7 +30,7 @@ module.exports = {
...
@@ -32,7 +30,7 @@ module.exports = {
case
'['
:
case
'['
:
return
JSON
.
parse
(
part
)
return
JSON
.
parse
(
part
)
default
:
default
:
return
_
.
isFinite
(
part
)
?
parseFloat
(
part
)
:
part
return
part
}
}
},
},
parse
:
function
(
string
)
{
parse
:
function
(
string
)
{
...
...
test/postgres/hstore.test.js
View file @
adfbb25
...
@@ -116,7 +116,7 @@ if (dialect.match(/^postgres/)) {
...
@@ -116,7 +116,7 @@ if (dialect.match(/^postgres/)) {
})
})
it
(
'should handle multiple keys with different types of values'
,
function
(
done
)
{
it
(
'should handle multiple keys with different types of values'
,
function
(
done
)
{
expect
(
hstore
.
parse
(
'"true"=>true,"false"=>false,"null"=>NULL,"undefined"=>NULL,"integer"=>1,"array"=>"[1,\\"2\\"]","object"=>"{\\"object\\":\\"value\\"}"'
)).
to
.
deep
.
equal
({
true
:
true
,
false
:
false
,
null
:
null
,
undefined
:
null
,
integer
:
1
,
array
:
[
1
,
'2'
],
object
:
{
object
:
'value'
}})
expect
(
hstore
.
parse
(
'"true"=>true,"false"=>false,"null"=>NULL,"undefined"=>NULL,"integer"=>1,"array"=>"[1,\\"2\\"]","object"=>"{\\"object\\":\\"value\\"}"'
)).
to
.
deep
.
equal
({
true
:
true
,
false
:
false
,
null
:
null
,
undefined
:
null
,
integer
:
"1"
,
array
:
[
1
,
'2'
],
object
:
{
object
:
'value'
}})
done
()
done
()
})
})
})
})
...
...
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