@contrast/agent 4.16.1 → 4.17.1

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.
Files changed (267) hide show
  1. package/bin/VERSION +1 -1
  2. package/bin/linux/contrast-service +0 -0
  3. package/bin/mac/contrast-service +0 -0
  4. package/bin/windows/contrast-service.exe +0 -0
  5. package/esm.mjs +21 -11
  6. package/lib/assess/policy/propagators.json +4 -0
  7. package/lib/assess/policy/signatures.json +5 -0
  8. package/lib/assess/propagators/fastify-static/allowed-path.js +85 -0
  9. package/lib/cli-rewriter/index.js +1 -1
  10. package/lib/contrast.js +1 -1
  11. package/lib/core/rewrite/index.js +2 -2
  12. package/lib/protect/rules/cmd-injection/cmdinjection-rule.js +1 -1
  13. package/lib/protect/service.js +2 -0
  14. package/lib/util/trace-util.js +5 -4
  15. package/node_modules/@colors/colors/LICENSE +26 -0
  16. package/node_modules/@colors/colors/README.md +219 -0
  17. package/node_modules/@colors/colors/examples/normal-usage.js +83 -0
  18. package/node_modules/@colors/colors/examples/safe-string.js +80 -0
  19. package/node_modules/@colors/colors/index.d.ts +136 -0
  20. package/node_modules/@colors/colors/lib/colors.js +211 -0
  21. package/node_modules/@colors/colors/lib/custom/trap.js +46 -0
  22. package/node_modules/@colors/colors/lib/custom/zalgo.js +110 -0
  23. package/node_modules/@colors/colors/lib/extendStringPrototype.js +110 -0
  24. package/node_modules/@colors/colors/lib/index.js +13 -0
  25. package/node_modules/@colors/colors/lib/maps/america.js +10 -0
  26. package/node_modules/@colors/colors/lib/maps/rainbow.js +12 -0
  27. package/node_modules/@colors/colors/lib/maps/random.js +11 -0
  28. package/node_modules/@colors/colors/lib/maps/zebra.js +5 -0
  29. package/node_modules/@colors/colors/lib/styles.js +95 -0
  30. package/node_modules/@colors/colors/lib/system/has-flag.js +35 -0
  31. package/node_modules/@colors/colors/lib/system/supports-colors.js +151 -0
  32. package/node_modules/@colors/colors/package.json +49 -0
  33. package/node_modules/@colors/colors/safe.d.ts +48 -0
  34. package/node_modules/@colors/colors/safe.js +10 -0
  35. package/node_modules/@colors/colors/themes/generic-logging.js +12 -0
  36. package/node_modules/@dabh/diagnostics/README.md +16 -16
  37. package/node_modules/@dabh/diagnostics/package.json +9 -9
  38. package/node_modules/async/CHANGELOG.md +13 -0
  39. package/node_modules/async/all.js +74 -9
  40. package/node_modules/async/allLimit.js +3 -3
  41. package/node_modules/async/allSeries.js +3 -3
  42. package/node_modules/async/any.js +75 -9
  43. package/node_modules/async/anyLimit.js +3 -3
  44. package/node_modules/async/anySeries.js +3 -3
  45. package/node_modules/async/applyEach.js +2 -2
  46. package/node_modules/async/applyEachSeries.js +2 -2
  47. package/node_modules/async/asyncify.js +3 -3
  48. package/node_modules/async/auto.js +81 -15
  49. package/node_modules/async/autoInject.js +30 -4
  50. package/node_modules/async/cargo.js +1 -1
  51. package/node_modules/async/cargoQueue.js +1 -1
  52. package/node_modules/async/compose.js +1 -1
  53. package/node_modules/async/concat.js +72 -4
  54. package/node_modules/async/concatLimit.js +3 -3
  55. package/node_modules/async/concatSeries.js +2 -2
  56. package/node_modules/async/detect.js +43 -8
  57. package/node_modules/async/detectLimit.js +3 -3
  58. package/node_modules/async/detectSeries.js +3 -3
  59. package/node_modules/async/dir.js +1 -1
  60. package/node_modules/async/dist/async.js +1379 -168
  61. package/node_modules/async/dist/async.min.js +1 -1
  62. package/node_modules/async/dist/async.mjs +1372 -161
  63. package/node_modules/async/doDuring.js +3 -3
  64. package/node_modules/async/doUntil.js +2 -2
  65. package/node_modules/async/doWhilst.js +3 -3
  66. package/node_modules/async/during.js +3 -3
  67. package/node_modules/async/each.js +69 -28
  68. package/node_modules/async/eachLimit.js +4 -4
  69. package/node_modules/async/eachOf.js +85 -16
  70. package/node_modules/async/eachOfLimit.js +3 -3
  71. package/node_modules/async/eachOfSeries.js +2 -2
  72. package/node_modules/async/eachSeries.js +2 -2
  73. package/node_modules/async/ensureAsync.js +2 -2
  74. package/node_modules/async/every.js +74 -9
  75. package/node_modules/async/everyLimit.js +3 -3
  76. package/node_modules/async/everySeries.js +3 -3
  77. package/node_modules/async/filter.js +49 -9
  78. package/node_modules/async/filterLimit.js +3 -3
  79. package/node_modules/async/filterSeries.js +3 -3
  80. package/node_modules/async/find.js +43 -8
  81. package/node_modules/async/findLimit.js +3 -3
  82. package/node_modules/async/findSeries.js +3 -3
  83. package/node_modules/async/flatMap.js +72 -4
  84. package/node_modules/async/flatMapLimit.js +3 -3
  85. package/node_modules/async/flatMapSeries.js +2 -2
  86. package/node_modules/async/foldl.js +87 -11
  87. package/node_modules/async/foldr.js +2 -2
  88. package/node_modules/async/forEach.js +69 -28
  89. package/node_modules/async/forEachLimit.js +4 -4
  90. package/node_modules/async/forEachOf.js +85 -16
  91. package/node_modules/async/forEachOfLimit.js +3 -3
  92. package/node_modules/async/forEachOfSeries.js +2 -2
  93. package/node_modules/async/forEachSeries.js +2 -2
  94. package/node_modules/async/forever.js +4 -4
  95. package/node_modules/async/groupBy.js +62 -8
  96. package/node_modules/async/groupByLimit.js +3 -3
  97. package/node_modules/async/groupBySeries.js +2 -2
  98. package/node_modules/async/inject.js +87 -11
  99. package/node_modules/async/internal/applyEach.js +2 -2
  100. package/node_modules/async/internal/asyncEachOfLimit.js +1 -1
  101. package/node_modules/async/internal/consoleFunc.js +5 -1
  102. package/node_modules/async/internal/createTester.js +2 -2
  103. package/node_modules/async/internal/eachOfLimit.js +6 -6
  104. package/node_modules/async/internal/filter.js +2 -2
  105. package/node_modules/async/internal/iterator.js +5 -2
  106. package/node_modules/async/internal/map.js +1 -1
  107. package/node_modules/async/internal/parallel.js +3 -3
  108. package/node_modules/async/internal/queue.js +4 -4
  109. package/node_modules/async/internal/reject.js +2 -2
  110. package/node_modules/async/internal/setImmediate.js +6 -2
  111. package/node_modules/async/internal/wrapAsync.js +1 -1
  112. package/node_modules/async/log.js +1 -1
  113. package/node_modules/async/map.js +86 -6
  114. package/node_modules/async/mapLimit.js +3 -3
  115. package/node_modules/async/mapSeries.js +3 -3
  116. package/node_modules/async/mapValues.js +102 -12
  117. package/node_modules/async/mapValuesLimit.js +4 -4
  118. package/node_modules/async/mapValuesSeries.js +1 -1
  119. package/node_modules/async/memoize.js +3 -3
  120. package/node_modules/async/nextTick.js +3 -3
  121. package/node_modules/async/package.json +4 -6
  122. package/node_modules/async/parallel.js +96 -7
  123. package/node_modules/async/parallelLimit.js +2 -2
  124. package/node_modules/async/priorityQueue.js +11 -4
  125. package/node_modules/async/queue.js +4 -4
  126. package/node_modules/async/race.js +3 -3
  127. package/node_modules/async/reduce.js +87 -11
  128. package/node_modules/async/reduceRight.js +2 -2
  129. package/node_modules/async/reflect.js +2 -2
  130. package/node_modules/async/reflectAll.js +1 -1
  131. package/node_modules/async/reject.js +44 -10
  132. package/node_modules/async/rejectLimit.js +3 -3
  133. package/node_modules/async/rejectSeries.js +3 -3
  134. package/node_modules/async/retry.js +2 -2
  135. package/node_modules/async/retryable.js +4 -4
  136. package/node_modules/async/select.js +49 -9
  137. package/node_modules/async/selectLimit.js +3 -3
  138. package/node_modules/async/selectSeries.js +3 -3
  139. package/node_modules/async/seq.js +4 -4
  140. package/node_modules/async/series.js +112 -12
  141. package/node_modules/async/setImmediate.js +1 -1
  142. package/node_modules/async/some.js +75 -9
  143. package/node_modules/async/someLimit.js +3 -3
  144. package/node_modules/async/someSeries.js +3 -3
  145. package/node_modules/async/sortBy.js +121 -19
  146. package/node_modules/async/timeout.js +2 -2
  147. package/node_modules/async/times.js +1 -1
  148. package/node_modules/async/timesLimit.js +3 -3
  149. package/node_modules/async/timesSeries.js +1 -1
  150. package/node_modules/async/transform.js +111 -19
  151. package/node_modules/async/tryEach.js +3 -3
  152. package/node_modules/async/until.js +3 -3
  153. package/node_modules/async/waterfall.js +4 -4
  154. package/node_modules/async/whilst.js +3 -3
  155. package/node_modules/async/wrapSync.js +3 -3
  156. package/node_modules/color/README.md +9 -0
  157. package/node_modules/color/index.js +4 -1
  158. package/node_modules/color/package.json +8 -8
  159. package/node_modules/color-string/README.md +6 -2
  160. package/node_modules/color-string/index.js +21 -13
  161. package/node_modules/color-string/package.json +4 -4
  162. package/node_modules/colorspace/package.json +5 -5
  163. package/node_modules/fecha/dist/fecha.min.js +1 -1
  164. package/node_modules/fecha/dist/fecha.min.js.map +1 -0
  165. package/node_modules/fecha/lib/fecha.d.ts +2 -2
  166. package/node_modules/fecha/lib/fecha.js +35 -18
  167. package/node_modules/fecha/lib/fecha.js.map +1 -0
  168. package/node_modules/fecha/lib/fecha.umd.js +35 -18
  169. package/node_modules/fecha/lib/fecha.umd.js.map +1 -0
  170. package/node_modules/fecha/package.json +9 -10
  171. package/node_modules/fecha/src/fecha.ts +524 -0
  172. package/node_modules/logform/.eslintrc +1 -1
  173. package/node_modules/logform/CHANGELOG.md +24 -0
  174. package/node_modules/logform/README.md +15 -17
  175. package/node_modules/logform/browser.js +3 -1
  176. package/node_modules/logform/cli.js +1 -1
  177. package/node_modules/logform/colorize.js +2 -2
  178. package/node_modules/logform/dist/browser.js +8 -2
  179. package/node_modules/logform/dist/cli.js +2 -2
  180. package/node_modules/logform/dist/colorize.js +5 -5
  181. package/node_modules/logform/dist/errors.js +1 -1
  182. package/node_modules/logform/dist/format.js +9 -5
  183. package/node_modules/logform/dist/index.js +53 -20
  184. package/node_modules/logform/dist/json.js +7 -6
  185. package/node_modules/logform/dist/logstash.js +1 -1
  186. package/node_modules/logform/dist/pad-levels.js +4 -4
  187. package/node_modules/logform/dist/printf.js +1 -1
  188. package/node_modules/logform/dist/simple.js +1 -1
  189. package/node_modules/logform/dist/splat.js +2 -2
  190. package/node_modules/logform/dist/uncolorize.js +1 -1
  191. package/node_modules/logform/errors.js +1 -1
  192. package/node_modules/logform/index.d.ts +36 -0
  193. package/node_modules/logform/index.js +19 -20
  194. package/node_modules/logform/json.js +7 -7
  195. package/node_modules/logform/logstash.js +1 -1
  196. package/node_modules/logform/package.json +10 -9
  197. package/node_modules/logform/simple.js +1 -1
  198. package/node_modules/logform/uncolorize.js +1 -1
  199. package/node_modules/safe-stable-stringify/CHANGELOG.md +75 -0
  200. package/node_modules/safe-stable-stringify/LICENSE +21 -0
  201. package/node_modules/safe-stable-stringify/esm/package.json +4 -0
  202. package/node_modules/safe-stable-stringify/esm/wrapper.js +6 -0
  203. package/node_modules/safe-stable-stringify/index.d.ts +18 -0
  204. package/node_modules/safe-stable-stringify/index.js +618 -0
  205. package/node_modules/safe-stable-stringify/package.json +69 -0
  206. package/node_modules/safe-stable-stringify/readme.md +170 -0
  207. package/node_modules/safe-stable-stringify/tsconfig.json +22 -0
  208. package/node_modules/winston/LICENSE +18 -18
  209. package/node_modules/winston/README.md +1231 -1230
  210. package/node_modules/winston/dist/winston/common.js +10 -10
  211. package/node_modules/winston/dist/winston/config/index.js +17 -17
  212. package/node_modules/winston/dist/winston/container.js +46 -46
  213. package/node_modules/winston/dist/winston/create-logger.js +28 -24
  214. package/node_modules/winston/dist/winston/exception-handler.js +49 -49
  215. package/node_modules/winston/dist/winston/exception-stream.js +27 -27
  216. package/node_modules/winston/dist/winston/logger.js +152 -138
  217. package/node_modules/winston/dist/winston/profiler.js +22 -22
  218. package/node_modules/winston/dist/winston/rejection-handler.js +54 -54
  219. package/node_modules/winston/dist/winston/tail-file.js +14 -14
  220. package/node_modules/winston/dist/winston/transports/console.js +31 -31
  221. package/node_modules/winston/dist/winston/transports/file.js +101 -101
  222. package/node_modules/winston/dist/winston/transports/http.js +119 -41
  223. package/node_modules/winston/dist/winston/transports/index.js +17 -17
  224. package/node_modules/winston/dist/winston/transports/stream.js +24 -24
  225. package/node_modules/winston/dist/winston.js +91 -97
  226. package/node_modules/winston/index.d.ts +213 -193
  227. package/node_modules/winston/lib/winston/common.js +61 -61
  228. package/node_modules/winston/lib/winston/config/index.d.ts +99 -98
  229. package/node_modules/winston/lib/winston/config/index.js +35 -35
  230. package/node_modules/winston/lib/winston/container.js +114 -114
  231. package/node_modules/winston/lib/winston/create-logger.js +104 -104
  232. package/node_modules/winston/lib/winston/exception-handler.js +245 -245
  233. package/node_modules/winston/lib/winston/exception-stream.js +54 -54
  234. package/node_modules/winston/lib/winston/logger.js +676 -667
  235. package/node_modules/winston/lib/winston/profiler.js +51 -51
  236. package/node_modules/winston/lib/winston/rejection-handler.js +251 -251
  237. package/node_modules/winston/lib/winston/tail-file.js +124 -124
  238. package/node_modules/winston/lib/winston/transports/console.js +117 -117
  239. package/node_modules/winston/lib/winston/transports/file.js +695 -695
  240. package/node_modules/winston/lib/winston/transports/http.js +267 -202
  241. package/node_modules/winston/lib/winston/transports/index.d.ts +103 -100
  242. package/node_modules/winston/lib/winston/transports/index.js +56 -56
  243. package/node_modules/winston/lib/winston/transports/stream.js +63 -63
  244. package/node_modules/winston/lib/winston.js +176 -182
  245. package/node_modules/winston/node_modules/winston-transport/.babelrc +3 -0
  246. package/node_modules/winston/node_modules/winston-transport/.eslintrc +7 -0
  247. package/node_modules/winston/node_modules/winston-transport/.gitattributes +1 -0
  248. package/node_modules/winston/node_modules/winston-transport/.nyc_output/c3d7ddb9-cc26-466b-a4f6-993ad69e86f6.json +1 -0
  249. package/node_modules/winston/node_modules/winston-transport/.nyc_output/processinfo/c3d7ddb9-cc26-466b-a4f6-993ad69e86f6.json +1 -0
  250. package/node_modules/winston/node_modules/winston-transport/.nyc_output/processinfo/index.json +1 -0
  251. package/node_modules/winston/node_modules/winston-transport/CHANGELOG.md +126 -0
  252. package/node_modules/winston/node_modules/winston-transport/LICENSE +22 -0
  253. package/node_modules/winston/node_modules/winston-transport/README.md +50 -0
  254. package/node_modules/winston/node_modules/winston-transport/dist/index.js +215 -0
  255. package/node_modules/winston/node_modules/winston-transport/dist/legacy.js +116 -0
  256. package/node_modules/winston/node_modules/winston-transport/index.d.ts +39 -0
  257. package/node_modules/winston/node_modules/winston-transport/index.js +215 -0
  258. package/node_modules/winston/node_modules/winston-transport/legacy.js +119 -0
  259. package/node_modules/winston/node_modules/winston-transport/package.json +56 -0
  260. package/node_modules/winston/package.json +76 -75
  261. package/package.json +8 -6
  262. package/node_modules/@dabh/diagnostics/example.png +0 -0
  263. package/node_modules/color-string/CHANGELOG.md +0 -18
  264. package/node_modules/colorspace/test.js +0 -14
  265. package/node_modules/fecha/CHANGELOG.md +0 -67
  266. package/node_modules/logform/.travis.yml +0 -17
  267. package/node_modules/winston/CHANGELOG.md +0 -560
@@ -1,30 +1,30 @@
1
- /**
2
- * stream.js: Transport for outputting to any arbitrary stream.
3
- *
4
- * (C) 2010 Charlie Robbins
5
- * MIT LICENCE
1
+ /**
2
+ * stream.js: Transport for outputting to any arbitrary stream.
3
+ *
4
+ * (C) 2010 Charlie Robbins
5
+ * MIT LICENCE
6
6
  */
7
7
  'use strict';
8
8
 
9
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
9
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
10
10
 
11
11
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12
12
 
13
13
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
14
14
 
15
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
15
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
16
16
 
17
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
17
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
18
18
 
19
19
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
20
20
 
21
21
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
22
22
 
23
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
23
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
24
24
 
25
25
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
26
26
 
27
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
27
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
28
28
 
29
29
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
30
30
 
@@ -36,10 +36,10 @@ var _require = require('triple-beam'),
36
36
  var os = require('os');
37
37
 
38
38
  var TransportStream = require('winston-transport');
39
- /**
40
- * Transport for outputting to any arbitrary stream.
41
- * @type {Stream}
42
- * @extends {TransportStream}
39
+ /**
40
+ * Transport for outputting to any arbitrary stream.
41
+ * @type {Stream}
42
+ * @extends {TransportStream}
43
43
  */
44
44
 
45
45
 
@@ -48,10 +48,10 @@ module.exports = /*#__PURE__*/function (_TransportStream) {
48
48
 
49
49
  var _super = _createSuper(Stream);
50
50
 
51
- /**
52
- * Constructor function for the Console transport object responsible for
53
- * persisting log messages and metadata to a terminal or TTY.
54
- * @param {!Object} [options={}] - Options for this instance.
51
+ /**
52
+ * Constructor function for the Console transport object responsible for
53
+ * persisting log messages and metadata to a terminal or TTY.
54
+ * @param {!Object} [options={}] - Options for this instance.
55
55
  */
56
56
  function Stream() {
57
57
  var _this;
@@ -73,14 +73,14 @@ module.exports = /*#__PURE__*/function (_TransportStream) {
73
73
  _this._stream.setMaxListeners(Infinity);
74
74
 
75
75
  _this.isObjectMode = options.stream._writableState.objectMode;
76
- _this.eol = options.eol || os.EOL;
76
+ _this.eol = typeof options.eol === 'string' ? options.eol : os.EOL;
77
77
  return _this;
78
78
  }
79
- /**
80
- * Core logging method exposed to Winston.
81
- * @param {Object} info - TODO: add param description.
82
- * @param {Function} callback - TODO: add param description.
83
- * @returns {undefined}
79
+ /**
80
+ * Core logging method exposed to Winston.
81
+ * @param {Object} info - TODO: add param description.
82
+ * @param {Function} callback - TODO: add param description.
83
+ * @returns {undefined}
84
84
  */
85
85
 
86
86
 
@@ -1,8 +1,8 @@
1
- /**
2
- * winston.js: Top-level include defining Winston.
3
- *
4
- * (C) 2010 Charlie Robbins
5
- * MIT LICENCE
1
+ /**
2
+ * winston.js: Top-level include defining Winston.
3
+ *
4
+ * (C) 2010 Charlie Robbins
5
+ * MIT LICENCE
6
6
  */
7
7
  'use strict';
8
8
 
@@ -10,109 +10,103 @@ var logform = require('logform');
10
10
 
11
11
  var _require = require('./winston/common'),
12
12
  warn = _require.warn;
13
- /**
14
- * Setup to expose.
15
- * @type {Object}
13
+ /**
14
+ * Expose version. Use `require` method for `webpack` support.
15
+ * @type {string}
16
16
  */
17
17
 
18
18
 
19
- var winston = exports;
20
- /**
21
- * Expose version. Use `require` method for `webpack` support.
22
- * @type {string}
19
+ exports.version = require('../package.json').version;
20
+ /**
21
+ * Include transports defined by default by winston
22
+ * @type {Array}
23
23
  */
24
24
 
25
- winston.version = require('../package.json').version;
26
- /**
27
- * Include transports defined by default by winston
28
- * @type {Array}
25
+ exports.transports = require('./winston/transports');
26
+ /**
27
+ * Expose utility methods
28
+ * @type {Object}
29
29
  */
30
30
 
31
- winston.transports = require('./winston/transports');
32
- /**
33
- * Expose utility methods
34
- * @type {Object}
31
+ exports.config = require('./winston/config');
32
+ /**
33
+ * Hoist format-related functionality from logform.
34
+ * @type {Object}
35
35
  */
36
36
 
37
- winston.config = require('./winston/config');
38
- /**
39
- * Hoist format-related functionality from logform.
40
- * @type {Object}
37
+ exports.addColors = logform.levels;
38
+ /**
39
+ * Hoist format-related functionality from logform.
40
+ * @type {Object}
41
41
  */
42
42
 
43
- winston.addColors = logform.levels;
44
- /**
45
- * Hoist format-related functionality from logform.
46
- * @type {Object}
43
+ exports.format = logform.format;
44
+ /**
45
+ * Expose core Logging-related prototypes.
46
+ * @type {function}
47
47
  */
48
48
 
49
- winston.format = logform.format;
50
- /**
51
- * Expose core Logging-related prototypes.
52
- * @type {function}
49
+ exports.createLogger = require('./winston/create-logger');
50
+ /**
51
+ * Expose core Logging-related prototypes.
52
+ * @type {Object}
53
53
  */
54
54
 
55
- winston.createLogger = require('./winston/create-logger');
56
- /**
57
- * Expose core Logging-related prototypes.
58
- * @type {Object}
55
+ exports.ExceptionHandler = require('./winston/exception-handler');
56
+ /**
57
+ * Expose core Logging-related prototypes.
58
+ * @type {Object}
59
59
  */
60
60
 
61
- winston.ExceptionHandler = require('./winston/exception-handler');
62
- /**
63
- * Expose core Logging-related prototypes.
64
- * @type {Object}
61
+ exports.RejectionHandler = require('./winston/rejection-handler');
62
+ /**
63
+ * Expose core Logging-related prototypes.
64
+ * @type {Container}
65
65
  */
66
66
 
67
- winston.RejectionHandler = require('./winston/rejection-handler');
68
- /**
69
- * Expose core Logging-related prototypes.
70
- * @type {Container}
67
+ exports.Container = require('./winston/container');
68
+ /**
69
+ * Expose core Logging-related prototypes.
70
+ * @type {Object}
71
71
  */
72
72
 
73
- winston.Container = require('./winston/container');
74
- /**
75
- * Expose core Logging-related prototypes.
76
- * @type {Object}
73
+ exports.Transport = require('winston-transport');
74
+ /**
75
+ * We create and expose a default `Container` to `winston.loggers` so that the
76
+ * programmer may manage multiple `winston.Logger` instances without any
77
+ * additional overhead.
78
+ * @example
79
+ * // some-file1.js
80
+ * const logger = require('winston').loggers.get('something');
81
+ *
82
+ * // some-file2.js
83
+ * const logger = require('winston').loggers.get('something');
77
84
  */
78
85
 
79
- winston.Transport = require('winston-transport');
80
- /**
81
- * We create and expose a default `Container` to `winston.loggers` so that the
82
- * programmer may manage multiple `winston.Logger` instances without any
83
- * additional overhead.
84
- * @example
85
- * // some-file1.js
86
- * const logger = require('winston').loggers.get('something');
87
- *
88
- * // some-file2.js
89
- * const logger = require('winston').loggers.get('something');
86
+ exports.loggers = new exports.Container();
87
+ /**
88
+ * We create and expose a 'defaultLogger' so that the programmer may do the
89
+ * following without the need to create an instance of winston.Logger directly:
90
+ * @example
91
+ * const winston = require('winston');
92
+ * winston.log('info', 'some message');
93
+ * winston.error('some error');
90
94
  */
91
95
 
92
- winston.loggers = new winston.Container();
93
- /**
94
- * We create and expose a 'defaultLogger' so that the programmer may do the
95
- * following without the need to create an instance of winston.Logger directly:
96
- * @example
97
- * const winston = require('winston');
98
- * winston.log('info', 'some message');
99
- * winston.error('some error');
100
- */
101
-
102
- var defaultLogger = winston.createLogger(); // Pass through the target methods onto `winston.
96
+ var defaultLogger = exports.createLogger(); // Pass through the target methods onto `winston.
103
97
 
104
- Object.keys(winston.config.npm.levels).concat(['log', 'query', 'stream', 'add', 'remove', 'clear', 'profile', 'startTimer', 'handleExceptions', 'unhandleExceptions', 'handleRejections', 'unhandleRejections', 'configure', 'child']).forEach(function (method) {
105
- return winston[method] = function () {
98
+ Object.keys(exports.config.npm.levels).concat(['log', 'query', 'stream', 'add', 'remove', 'clear', 'profile', 'startTimer', 'handleExceptions', 'unhandleExceptions', 'handleRejections', 'unhandleRejections', 'configure', 'child']).forEach(function (method) {
99
+ return exports[method] = function () {
106
100
  return defaultLogger[method].apply(defaultLogger, arguments);
107
101
  };
108
102
  });
109
- /**
110
- * Define getter / setter for the default logger level which need to be exposed
111
- * by winston.
112
- * @type {string}
103
+ /**
104
+ * Define getter / setter for the default logger level which need to be exposed
105
+ * by winston.
106
+ * @type {string}
113
107
  */
114
108
 
115
- Object.defineProperty(winston, 'level', {
109
+ Object.defineProperty(exports, 'level', {
116
110
  get: function get() {
117
111
  return defaultLogger.level;
118
112
  },
@@ -120,25 +114,25 @@ Object.defineProperty(winston, 'level', {
120
114
  defaultLogger.level = val;
121
115
  }
122
116
  });
123
- /**
124
- * Define getter for `exceptions` which replaces `handleExceptions` and
125
- * `unhandleExceptions`.
126
- * @type {Object}
117
+ /**
118
+ * Define getter for `exceptions` which replaces `handleExceptions` and
119
+ * `unhandleExceptions`.
120
+ * @type {Object}
127
121
  */
128
122
 
129
- Object.defineProperty(winston, 'exceptions', {
123
+ Object.defineProperty(exports, 'exceptions', {
130
124
  get: function get() {
131
125
  return defaultLogger.exceptions;
132
126
  }
133
127
  });
134
- /**
135
- * Define getters / setters for appropriate properties of the default logger
136
- * which need to be exposed by winston.
137
- * @type {Logger}
128
+ /**
129
+ * Define getters / setters for appropriate properties of the default logger
130
+ * which need to be exposed by winston.
131
+ * @type {Logger}
138
132
  */
139
133
 
140
134
  ['exitOnError'].forEach(function (prop) {
141
- Object.defineProperty(winston, prop, {
135
+ Object.defineProperty(exports, prop, {
142
136
  get: function get() {
143
137
  return defaultLogger[prop];
144
138
  },
@@ -147,12 +141,12 @@ Object.defineProperty(winston, 'exceptions', {
147
141
  }
148
142
  });
149
143
  });
150
- /**
151
- * The default transports and exceptionHandlers for the default winston logger.
152
- * @type {Object}
144
+ /**
145
+ * The default transports and exceptionHandlers for the default winston logger.
146
+ * @type {Object}
153
147
  */
154
148
 
155
- Object.defineProperty(winston, 'default', {
149
+ Object.defineProperty(exports, 'default', {
156
150
  get: function get() {
157
151
  return {
158
152
  exceptionHandlers: defaultLogger.exceptionHandlers,
@@ -163,10 +157,10 @@ Object.defineProperty(winston, 'default', {
163
157
  }); // Have friendlier breakage notices for properties that were exposed by default
164
158
  // on winston < 3.0.
165
159
 
166
- warn.deprecated(winston, 'setLevels');
167
- warn.forFunctions(winston, 'useFormat', ['cli']);
168
- warn.forProperties(winston, 'useFormat', ['padLevels', 'stripColors']);
169
- warn.forFunctions(winston, 'deprecated', ['addRewriter', 'addFilter', 'clone', 'extend']);
170
- warn.forProperties(winston, 'deprecated', ['emitErrs', 'levelLength']); // Throw a useful error when users attempt to run `new winston.Logger`.
160
+ warn.deprecated(exports, 'setLevels');
161
+ warn.forFunctions(exports, 'useFormat', ['cli']);
162
+ warn.forProperties(exports, 'useFormat', ['padLevels', 'stripColors']);
163
+ warn.forFunctions(exports, 'deprecated', ['addRewriter', 'addFilter', 'clone', 'extend']);
164
+ warn.forProperties(exports, 'deprecated', ['emitErrs', 'levelLength']); // Throw a useful error when users attempt to run `new winston.Logger`.
171
165
 
172
- warn.moved(winston, 'createLogger', 'Logger');
166
+ warn.moved(exports, 'createLogger', 'Logger');