There is a `isString` method in the [no-invalid-regexp](https://github.com/eslint/eslint/blob/master/lib/rules/no-invalid-regexp.js#L13) rule.
I don't think it's good if I copy and paste this function and use it in the `no-restricted-modules` rule. 

What do you think would be a good solution for reusing the function?