Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

underiveQualifiedKey doesn't reverse deriveQualifiedKey #321

Open
spinnytea opened this issue Jul 30, 2016 · 0 comments
Open

underiveQualifiedKey doesn't reverse deriveQualifiedKey #321

spinnytea opened this issue Jul 30, 2016 · 0 comments

Comments

@spinnytea
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant