Skip to content

underiveQualifiedKey doesn't reverse deriveQualifiedKey #321

Open
@spinnytea

Description

@spinnytea

deriveQualifiedKey has a particular implementation: 'prefix' + 'key'
underiveQualifiedKey should reverse the process using the same logic (i.e. key.substr(prefix.length))

while building a regex to replace the beginning is fun, it doesn't work if the prefix is itself a regex.

For example, if the prefix is '...', then it will match anything in local storage that's at least three characters long. Sure it will basically do the right thing if angular-local-storage is the only thing using local storage for the site.

Another example, if the prefix is 'my[wonderful]site', then it won't ever do the right thing.

It looks like that function is only used in one place. And there's one other place that builds a regex to test for the prefix. All the other places use the string functions for stripping the prefix (instead of using this function).

Great tool! It's super easy to use.

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