Question
How is the function exported? Is it a default export or a named one?
About sindresorhus/escape-string-regexp · 2 messages · last activity 7/13/2026
How is the function exported? Is it a default export or a named one?
The function is exported as a default export.
This is evident from both the implementation and type definitions:
export default function escapeStringRegexp(string) { ... }export default function escapeStringRegexp(string: string): string;The usage example in [readme.md:L17] confirms this pattern: import escapeStringRegexp from 'escape-string-regexp'; — importing without curly braces, which is the syntax for default imports.
FOLLOW_UPS:
Want to ask your own question?
Open chat for sindresorhus/escape-string-regexpPublic Q&A. Generated by RepoPilot from the actual source of sindresorhus/escape-string-regexp. AI answers can be incomplete or stale — verify before relying on them.