@contrast/rewriter 1.0.1 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +20 -0
- package/lib/source-maps.js +15 -2
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright: 2022 Contrast Security, Inc
|
|
3
|
+
* Contact: support@contrastsecurity.com
|
|
4
|
+
* License: Commercial
|
|
5
|
+
|
|
6
|
+
* NOTICE: This Software and the patented inventions embodied within may only be
|
|
7
|
+
* used as part of Contrast Security’s commercial offerings. Even though it is
|
|
8
|
+
* made available through public repositories, use of this Software is subject to
|
|
9
|
+
* the applicable End User Licensing Agreement found at
|
|
10
|
+
* https://www.contrastsecurity.com/enduser-terms-0317a or as otherwise agreed
|
|
11
|
+
* between Contrast Security and the End User. The Software may not be reverse
|
|
12
|
+
* engineered, modified, repackaged, sold, redistributed or otherwise used in a
|
|
13
|
+
* way not consistent with the End User License Agreement.
|
|
14
|
+
*/
|
|
15
|
+
|
|
1
16
|
'use strict';
|
|
2
17
|
|
|
3
18
|
const Module = require('module');
|
|
@@ -109,6 +124,11 @@ class Rewriter {
|
|
|
109
124
|
filename: opts.filename,
|
|
110
125
|
...opts
|
|
111
126
|
};
|
|
127
|
+
|
|
128
|
+
if (state.orig.indexOf('eval') === -1) {
|
|
129
|
+
return { code: state.orig };
|
|
130
|
+
}
|
|
131
|
+
|
|
112
132
|
const ast = parser.parse(state.orig, {
|
|
113
133
|
plugins: [
|
|
114
134
|
'classPrivateMethods',
|
package/lib/source-maps.js
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright: 2022 Contrast Security, Inc
|
|
3
|
+
* Contact: support@contrastsecurity.com
|
|
4
|
+
* License: Commercial
|
|
5
|
+
|
|
6
|
+
* NOTICE: This Software and the patented inventions embodied within may only be
|
|
7
|
+
* used as part of Contrast Security’s commercial offerings. Even though it is
|
|
8
|
+
* made available through public repositories, use of this Software is subject to
|
|
9
|
+
* the applicable End User Licensing Agreement found at
|
|
10
|
+
* https://www.contrastsecurity.com/enduser-terms-0317a or as otherwise agreed
|
|
11
|
+
* between Contrast Security and the End User. The Software may not be reverse
|
|
12
|
+
* engineered, modified, repackaged, sold, redistributed or otherwise used in a
|
|
13
|
+
* way not consistent with the End User License Agreement.
|
|
14
|
+
*/
|
|
15
|
+
|
|
1
16
|
'use strict';
|
|
2
17
|
|
|
3
18
|
const { readFileSync, existsSync } = require('fs');
|
|
4
19
|
const { transfer } = require('multi-stage-sourcemap');
|
|
5
20
|
const { SourceMapConsumer } = require('@contrast/synchronous-source-maps');
|
|
6
|
-
const path = require('path');
|
|
7
21
|
|
|
8
22
|
module.exports = function(deps) {
|
|
9
|
-
const { isAgentPath } = deps;
|
|
10
23
|
const sourceMaps = deps.rewriter.sourceMaps = {};
|
|
11
24
|
const consumerCache = sourceMaps.consumerCache = {};
|
|
12
25
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/rewriter",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "A transpilation tool mainly used for instrumentation",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"main": "lib/index.js",
|
|
11
11
|
"types": "lib/index.d.ts",
|
|
12
12
|
"engines": {
|
|
13
|
-
"npm": ">=6.13.7 <7 || >= 8.
|
|
13
|
+
"npm": ">=6.13.7 <7 || >= 8.3.1",
|
|
14
14
|
"node": ">= 14.15.0"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|