Last change
on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
527 bytes
|
Line | |
---|
1 | "use strict";
|
---|
2 |
|
---|
3 | exports.__esModule = true;
|
---|
4 | exports["default"] = stripComments;
|
---|
5 |
|
---|
6 | function stripComments(str) {
|
---|
7 | var s = "";
|
---|
8 | var commentStart = str.indexOf("/*");
|
---|
9 | var lastEnd = 0;
|
---|
10 |
|
---|
11 | while (commentStart >= 0) {
|
---|
12 | s = s + str.slice(lastEnd, commentStart);
|
---|
13 | var commentEnd = str.indexOf("*/", commentStart + 2);
|
---|
14 |
|
---|
15 | if (commentEnd < 0) {
|
---|
16 | return s;
|
---|
17 | }
|
---|
18 |
|
---|
19 | lastEnd = commentEnd + 2;
|
---|
20 | commentStart = str.indexOf("/*", lastEnd);
|
---|
21 | }
|
---|
22 |
|
---|
23 | s = s + str.slice(lastEnd);
|
---|
24 | return s;
|
---|
25 | }
|
---|
26 |
|
---|
27 | module.exports = exports.default; |
---|
Note:
See
TracBrowser
for help on using the repository browser.