source: frontend/node_modules/@svgr/core/lib/convert.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 916 bytes
Line 
1"use strict";
2
3exports.__esModule = true;
4exports.default = void 0;
5
6var _state = require("./state");
7
8var _config = require("./config");
9
10var _plugins = require("./plugins");
11
12function run(code, config, state) {
13 const expandedState = (0, _state.expandState)(state);
14 const plugins = (0, _plugins.getPlugins)(config, state).map(_plugins.resolvePlugin);
15 let nextCode = String(code).replace('\0', ''); // eslint-disable-next-line no-restricted-syntax
16
17 for (const plugin of plugins) {
18 nextCode = plugin(nextCode, config, expandedState);
19 }
20
21 return nextCode;
22}
23
24async function convert(code, config = {}, state = {}) {
25 config = await (0, _config.loadConfig)(config, state);
26 return run(code, config, state);
27}
28
29convert.sync = (code, config = {}, state = {}) => {
30 config = _config.loadConfig.sync(config, state);
31 return run(code, config, state);
32};
33
34var _default = convert;
35exports.default = _default;
Note: See TracBrowser for help on using the repository browser.