unlinkAll doesn't work in case of the key including hyphen character
See original GitHub issueHi. I’v got trouble with using nohm v0.9.8 I’ve create a model that generate its id as uuid/v4. When I call remove method on instance of that model, an error occurred: Uncaught TypeError: Cannot read property ‘1’ of null at node_modules/nohm/lib/relations.js:233:29
After some reading the code, I found the reason why it make error.
Because that cannot recognize hyphen character.
So I’m suggesting search pattern of line num 233 be changed from
'/:([\w]*):([\w]*):[\w]+$/i'
to
'/:([^\ :]*):([^\ :]*):[^\ :]+$/i'
This searches all character sequence excluding whitespace and delimiter colon. I hope as soon as possible this issue to be solved.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
jq doesn't work with keys which contains dash in it from a ...
I just want to get the key-key from the curled url with jq. While it works for arrays without dashes in declare -a...
Read more >How do I delete a file whose name begins with "-" (hyphen ...
I don't think that will work. It traverses all the files in the current directory and all its subdirectories, and after all that...
Read more >Hyphen key not working. - Microsoft Community
My power has gone out 4 times today and now the hyphen key is not working and it is only the one key....
Read more >preg_match - Manual - PHP
validate input using preg_match, I tried using \p{script} but didn't work: ... The string must have 1 or more of any character like...
Read more >hyphens - CSS: Cascading Style Sheets - MDN Web Docs
This character is not rendered visibly; instead, it marks a place where the browser should break the word if hyphenation is necessary. In...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thanks martiz, you made my works more easier by this.
Fixed in v1.0.0 and docs are changed to mention modelName and relation name constraints.