1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | Object.defineProperty(exports, "__esModule", { value: true });
|
11 | const innerRegex = /[#@] sourceMappingURL=([^\s'"]*)/;
|
12 | const regex = RegExp("(?:" +
|
13 | "/\\*" +
|
14 | "(?:\\s*\r?\n(?://)?)?" +
|
15 | "(?:" + innerRegex.source + ")" +
|
16 | "\\s*" +
|
17 | "\\*/" +
|
18 | "|" +
|
19 | "//(?:" + innerRegex.source + ")" +
|
20 | ")" +
|
21 | "\\s*$");
|
22 | function insertBefore(code, string) {
|
23 | let match = code.match(regex);
|
24 | if (match) {
|
25 | return code.slice(0, match.index) + string + code.slice(match.index);
|
26 | }
|
27 | else {
|
28 | return code + string;
|
29 | }
|
30 | }
|
31 | exports.insertBefore = insertBefore;
|
32 |
|
\ | No newline at end of file |