From 527c9cdb653429d0a066426dc042a5a521ac6a0a Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Fri, 3 May 2024 17:37:14 -0300 Subject: [PATCH] remove unused function --- docs/src/modules/components/DemoToolbar.js | 25 ---------------------- 1 file changed, 25 deletions(-) diff --git a/docs/src/modules/components/DemoToolbar.js b/docs/src/modules/components/DemoToolbar.js index 61082c7d345503..230ff1a0ef7665 100644 --- a/docs/src/modules/components/DemoToolbar.js +++ b/docs/src/modules/components/DemoToolbar.js @@ -261,31 +261,6 @@ function useToolbar(controlRefs, options = {}) { }; } -function copyWithRelativeModules(raw, relativeModules) { - if (relativeModules) { - relativeModules.forEach(({ module, raw: content }) => { - // remove exports from relative module - content = content.replace(/export( )*(default)*( )*\w+;|export default|export/gm, ''); - // replace import statement with relative module content - // the module might be imported with or without extension, so we need to cover all cases - // E.g.: /import .* from '(.\/top100Films.js|.\/top100Films)';/ - const extensions = ['', '.js', '.jsx', '.ts', '.tsx', '.css', '.json']; - const patterns = extensions - .map((ext) => { - if (module.endsWith(ext)) { - return module.replace(ext, ''); - } - return ''; - }) - .filter(Boolean) - .join('|'); - const importPattern = new RegExp(`import .* from '(${patterns})';`); - raw = raw.replace(importPattern, content); - }); - } - return copy(raw); -} - export default function DemoToolbar(props) { const { codeOpen,