jscrambler 6.4.20 → 6.4.21

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.
@@ -91,7 +91,8 @@ var deprecationFields = {
91
91
  entity: 1
92
92
  };
93
93
  var sourceFields = {
94
- filename: 1
94
+ filename: 1,
95
+ isSource: 1
95
96
  };
96
97
  var errorMessageFields = {
97
98
  message: 1,
package/dist/index.js CHANGED
@@ -42,6 +42,7 @@ var APP_URL = 'https://app.jscrambler.com';
42
42
  var POLLING_MIN_INTERVAL = 1000;
43
43
  var POLLING_MAX_INTERVAL = 10000;
44
44
  var INCREASE_POLL_INTERVAL_EVERY = 30000;
45
+ var MAX_PRINTED_ERRORS = 3;
45
46
 
46
47
  /**
47
48
  * Calculate polling interval for protection and instrumentation.
@@ -71,9 +72,20 @@ function errorHandler(res) {
71
72
  return res;
72
73
  }
73
74
  function printSourcesErrors(errors) {
74
- console.error('Application sources errors:');
75
- console.error(JSON.stringify(errors, null, 2));
76
- console.error('');
75
+ console.error('Source errors:');
76
+ for (var i = 0; i < Math.min(MAX_PRINTED_ERRORS, errors.length); i++) {
77
+ var sourceErrorsMessage = errors[i].line ? ':' + errors[i].line + ':' + errors[i].column + ': ' : ': ';
78
+ console.error('- ' + errors[i].filename + sourceErrorsMessage + errors[i].message);
79
+ }
80
+ var errorsLeft = errors.length - MAX_PRINTED_ERRORS;
81
+ if (errorsLeft > 0) {
82
+ if (errorsLeft === 1) {
83
+ console.error('There is 1 more error.');
84
+ } else {
85
+ console.error('There are ' + errorsLeft + ' more errors.');
86
+ }
87
+ }
88
+ console.error();
77
89
  }
78
90
  function normalizeParameters(parameters) {
79
91
  var result;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jscrambler",
3
3
  "description": "Jscrambler API client.",
4
- "version": "6.4.20",
4
+ "version": "6.4.21",
5
5
  "homepage": "https://github.com/jscrambler/jscrambler",
6
6
  "author": "Jscrambler <code@jscrambler.com>",
7
7
  "repository": {