Deep flatten and housekeeping
Changed original flatten to be named deepFlatten, added normal flatten, improved some other snippets.
This commit is contained in:
@ -3,7 +3,6 @@
|
||||
Use `replace()` to escape special characters.
|
||||
|
||||
```js
|
||||
const escapeRegExp = s =>
|
||||
s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
const escapeRegExp = str => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
// escapeRegExp('(test)') -> \\(test\\)
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user