source: imaps-frontend/node_modules/@babel/plugin-transform-json-strings/lib/index.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 2 weeks ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 962 bytes
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = void 0;
7var _helperPluginUtils = require("@babel/helper-plugin-utils");
8var _default = exports.default = (0, _helperPluginUtils.declare)(api => {
9 api.assertVersion("^7.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.