We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f934667 commit 7c910d4Copy full SHA for 7c910d4
lib/src/utils.ts
@@ -155,3 +155,8 @@ export const useRGSWithPlugins = <T>(
155
if (!globalRGS[key]?.s) initWithPlugins(key, value, plugins, doNotInit);
156
return createHook<T>(key, includeRegExp, excludeRegExp);
157
};
158
+
159
+export const listToRegExp = (list: string[]) => {
160
+ const escapedList = list.map(s => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
161
+ return new RegExp(`^(${escapedList.join("|")})$`);
162
+};
0 commit comments