Skip to content

Search for a string among keys #52

Description

@Paike

If you need to search among the keys for a given string you could clone the index-function and modify it:

searchIndex: function(string){
            var index = [], i;
            for(i in _storage){
                if(_storage.hasOwnProperty(i) && i != "__jstorage_meta"){
                    if(i.indexOf(string) !== -1) index.push(i);
                }
            }
            return index;
        }

It will return an array with keys containing the string.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions