|
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:
974 bytes
|
| Rev | Line | |
|---|
| [9af201e] | 1 | "use strict";
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
|---|
| 4 | value: true
|
|---|
| 5 | });
|
|---|
| 6 | exports.default = void 0;
|
|---|
| 7 | var _helperPluginUtils = require("@babel/helper-plugin-utils");
|
|---|
| 8 | var _default = exports.default = (0, _helperPluginUtils.declare)(api => {
|
|---|
| 9 | api.assertVersion("^7.0.0-0 || ^8.0.0-0 || >8.0.0-alpha <8.0.0-beta");
|
|---|
| 10 | const regex = /(\\*)([\u2028\u2029])/g;
|
|---|
| 11 | function replace(match, escapes, separator) {
|
|---|
| 12 | const isEscaped = escapes.length % 2 === 1;
|
|---|
| 13 | if (isEscaped) return match;
|
|---|
| 14 | return `${escapes}\\u${separator.charCodeAt(0).toString(16)}`;
|
|---|
| 15 | }
|
|---|
| 16 | return {
|
|---|
| 17 | name: "transform-json-strings",
|
|---|
| 18 | manipulateOptions: (_, parser) => parser.plugins.push("jsonStrings"),
|
|---|
| 19 | visitor: {
|
|---|
| 20 | "DirectiveLiteral|StringLiteral"({
|
|---|
| 21 | node
|
|---|
| 22 | }) {
|
|---|
| 23 | const {
|
|---|
| 24 | extra
|
|---|
| 25 | } = node;
|
|---|
| 26 | if (!(extra != null && extra.raw)) return;
|
|---|
| 27 | extra.raw = extra.raw.replace(regex, replace);
|
|---|
| 28 | }
|
|---|
| 29 | }
|
|---|
| 30 | };
|
|---|
| 31 | });
|
|---|
| 32 |
|
|---|
| 33 | //# sourceMappingURL=index.js.map
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.