Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Ivan Tyagov
jio
Commits
6857cecb
Commit
6857cecb
authored
Apr 17, 2014
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
localstorage filters wrong document list
parent
13656a2a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
src/jio.storage/localstorage.js
src/jio.storage/localstorage.js
+20
-2
No files found.
src/jio.storage/localstorage.js
View file @
6857cecb
...
...
@@ -67,6 +67,24 @@
var
ram
=
{},
memorystorage
,
localstorage
,
hasOwnProperty
=
Function
.
prototype
.
call
.
bind
(
Object
.
prototype
.
hasOwnProperty
);
/**
* filterMap(array, callback) : array
*
* Acts like `Array.prototype.map` but does not produces a new array, it
* modifies the original array instead.
*
* @param {Array} array The array to modify
* @param {Function} callback Called in each element being parsed
* @return {Array} The modified array
*/
function
filterMap
(
array
,
callback
)
{
var
i
;
for
(
i
=
0
;
i
<
array
.
length
;
i
+=
1
)
{
array
[
i
]
=
callback
(
array
[
i
],
i
,
array
);
}
return
array
;
}
/**
* Checks if an object has no enumerable keys
*
...
...
@@ -456,8 +474,8 @@
}
jIO
.
QueryFactory
.
create
(
options
.
query
||
""
,
this
.
_key_schema
).
exec
(
document_list
,
options
).
then
(
function
()
{
document_list
=
document_list
.
map
(
function
(
value
)
{
exec
(
document_list
,
options
).
then
(
function
(
document_list
)
{
filterMap
(
document_list
,
function
(
value
)
{
var
o
=
{
"
id
"
:
value
.
_id
};
...
...
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