@mjhls/mjh-framework 1.0.1055 → 1.0.1058

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 (178) hide show
  1. package/README.md +168 -168
  2. package/dist/cjs/AD300x250.js +1 -1
  3. package/dist/cjs/AD300x250x600.js +1 -1
  4. package/dist/cjs/AD728x90.js +1 -1
  5. package/dist/cjs/ADFloatingFooter.js +1 -1
  6. package/dist/cjs/ADGutter.js +1 -1
  7. package/dist/cjs/{ADInfeed-98ee4120.js → ADInfeed-0519664d.js} +1 -1
  8. package/dist/cjs/ADSkyscraper.js +1 -1
  9. package/dist/cjs/ADSponsoredResources.js +1 -1
  10. package/dist/cjs/ADWebcast.js +1 -1
  11. package/dist/cjs/ADWelcome.js +1 -1
  12. package/dist/cjs/{ADlgInfeed-55df7d69.js → ADlgInfeed-e544ac1c.js} +1 -1
  13. package/dist/cjs/AdSlot.js +1 -1
  14. package/dist/cjs/AdSlotsProvider.js +1 -1
  15. package/dist/cjs/AlgoliaSearch.js +23 -27
  16. package/dist/cjs/ArticleCarousel.js +1 -1
  17. package/dist/cjs/ArticleProgramLandingPage.js +3 -4
  18. package/dist/cjs/ArticleSeriesLandingPage.js +3 -3
  19. package/dist/cjs/ArticleSeriesListing.js +1 -1
  20. package/dist/cjs/AuthWrapper.js +294 -1546
  21. package/dist/cjs/CEDeckSupabase.js +2 -2
  22. package/dist/cjs/CMEDeck.js +1 -1
  23. package/dist/cjs/Column3.js +1 -1
  24. package/dist/cjs/ConferenceArticleCard.js +15 -15
  25. package/dist/cjs/ContentCardPaginated.js +3 -3
  26. package/dist/cjs/DeckContent.js +11 -11
  27. package/dist/cjs/DeckQueue.js +2 -2
  28. package/dist/cjs/DeckQueuePaginated.js +2 -2
  29. package/dist/cjs/EventsDeck.js +18 -18
  30. package/dist/cjs/ExternalResources.js +3 -4
  31. package/dist/cjs/Feature.js +1 -1
  32. package/dist/cjs/GridContent.js +4 -4
  33. package/dist/cjs/GridContentPaginated.js +4 -4
  34. package/dist/cjs/GridHero.js +1 -1
  35. package/dist/cjs/HamMagazine.js +11 -11
  36. package/dist/cjs/HealthCareProfessionalModal.js +1 -1
  37. package/dist/cjs/Hero.js +1 -1
  38. package/dist/cjs/HorizontalArticleListing.js +3 -4
  39. package/dist/cjs/{ImageSlider-d65bc9c8.js → ImageSlider-62a43659.js} +123 -106
  40. package/dist/cjs/IssueLanding.js +34 -35
  41. package/dist/cjs/KMTracker.js +15 -15
  42. package/dist/cjs/LeftNav.js +1 -1
  43. package/dist/cjs/MasterDeck.js +11 -11
  44. package/dist/cjs/MasterDeckPaginated.js +11 -11
  45. package/dist/cjs/{MediaSeriesCard-e54b0b0c.js → MediaSeriesCard-3cf661c7.js} +2 -2
  46. package/dist/cjs/MediaSeriesLanding.js +13 -14
  47. package/dist/cjs/MediaSeriesLandingPaginated.js +13 -14
  48. package/dist/cjs/NavMagazine.js +12 -12
  49. package/dist/cjs/NavNative.js +10 -10
  50. package/dist/cjs/OncliveLargeHero.js +1 -1
  51. package/dist/cjs/PartnerDetailListing.js +6 -7
  52. package/dist/cjs/PartnerDetailListingPaginated.js +6 -7
  53. package/dist/cjs/PodcastsLanding.js +6 -7
  54. package/dist/cjs/PubSection.js +4 -4
  55. package/dist/cjs/PublicationLanding.js +26 -26
  56. package/dist/cjs/QueueDeckExpanded.js +4 -4
  57. package/dist/cjs/QueueDeckExpandedPaginated.js +4 -4
  58. package/dist/cjs/RelatedContent.js +28 -28
  59. package/dist/cjs/RelatedTopicsDropdown.js +10 -10
  60. package/dist/cjs/SeriesListingDeck.js +2 -2
  61. package/dist/cjs/{SeriesSlider-086a8319.js → SeriesSlider-edcb8e4b.js} +5 -5
  62. package/dist/cjs/SideFooter.js +2 -2
  63. package/dist/cjs/{SocialSearchComponent-d7e5d3a6.js → SocialSearchComponent-e9ec9c63.js} +1 -1
  64. package/dist/cjs/TaxonomyDescription.js +3 -4
  65. package/dist/cjs/TemplateNormal.js +2 -2
  66. package/dist/cjs/ThumbnailCard.js +1 -1
  67. package/dist/cjs/{Tooltip-02a841b5.js → Tooltip-980a1d1a.js} +140 -348
  68. package/dist/cjs/Ustream.js +1 -1
  69. package/dist/cjs/VideoProgramLandingPage.js +3 -4
  70. package/dist/cjs/VideoSeriesCard.js +1 -1
  71. package/dist/cjs/VideoSeriesLandingPage.js +3 -3
  72. package/dist/cjs/VideoSeriesListing.js +1 -1
  73. package/dist/cjs/View.js +7 -9
  74. package/dist/cjs/YahooHero.js +1 -1
  75. package/dist/cjs/YoutubeGroup.js +5 -5
  76. package/dist/cjs/{entities-df1aed86.js → entities-3f9d0f2f.js} +0 -4
  77. package/dist/cjs/faundadb.js +321 -4
  78. package/dist/cjs/getRelatedArticle.js +211 -6
  79. package/dist/cjs/getSerializers.js +3 -4
  80. package/dist/cjs/{getTargeting-5b954783.js → getTargeting-45ffbee8.js} +9 -9
  81. package/dist/cjs/getTargeting.js +1 -1
  82. package/dist/cjs/{index-9ec837cc.js → index-8041a4eb.js} +10 -0
  83. package/dist/cjs/{index-40a8d091.js → index-c19999b7.js} +605 -19
  84. package/dist/cjs/index.js +10 -18
  85. package/dist/cjs/{main-ae8472f3.js → main-47be4f9f.js} +9 -4
  86. package/dist/esm/AD300x250.js +1 -1
  87. package/dist/esm/AD300x250x600.js +1 -1
  88. package/dist/esm/AD728x90.js +1 -1
  89. package/dist/esm/ADFloatingFooter.js +1 -1
  90. package/dist/esm/ADGutter.js +1 -1
  91. package/dist/esm/{ADInfeed-6d0c0856.js → ADInfeed-c3f5613e.js} +1 -1
  92. package/dist/esm/ADSkyscraper.js +1 -1
  93. package/dist/esm/ADSponsoredResources.js +1 -1
  94. package/dist/esm/ADWebcast.js +1 -1
  95. package/dist/esm/ADWelcome.js +1 -1
  96. package/dist/esm/{ADlgInfeed-93bc2250.js → ADlgInfeed-2b148f3f.js} +1 -1
  97. package/dist/esm/AdSlot.js +1 -1
  98. package/dist/esm/AdSlotsProvider.js +1 -1
  99. package/dist/esm/AlgoliaSearch.js +22 -26
  100. package/dist/esm/ArticleCarousel.js +1 -1
  101. package/dist/esm/ArticleProgramLandingPage.js +3 -4
  102. package/dist/esm/ArticleSeriesLandingPage.js +3 -3
  103. package/dist/esm/ArticleSeriesListing.js +1 -1
  104. package/dist/esm/AuthWrapper.js +288 -1540
  105. package/dist/esm/CEDeckSupabase.js +2 -2
  106. package/dist/esm/CMEDeck.js +1 -1
  107. package/dist/esm/Column3.js +1 -1
  108. package/dist/esm/ConferenceArticleCard.js +15 -15
  109. package/dist/esm/ContentCardPaginated.js +3 -3
  110. package/dist/esm/DeckContent.js +11 -11
  111. package/dist/esm/DeckQueue.js +2 -2
  112. package/dist/esm/DeckQueuePaginated.js +2 -2
  113. package/dist/esm/EventsDeck.js +18 -18
  114. package/dist/esm/ExternalResources.js +3 -4
  115. package/dist/esm/Feature.js +1 -1
  116. package/dist/esm/GridContent.js +4 -4
  117. package/dist/esm/GridContentPaginated.js +4 -4
  118. package/dist/esm/GridHero.js +1 -1
  119. package/dist/esm/HamMagazine.js +11 -11
  120. package/dist/esm/HealthCareProfessionalModal.js +1 -1
  121. package/dist/esm/Hero.js +1 -1
  122. package/dist/esm/HorizontalArticleListing.js +3 -4
  123. package/dist/esm/{ImageSlider-da225417.js → ImageSlider-aea3a615.js} +124 -107
  124. package/dist/esm/IssueLanding.js +34 -35
  125. package/dist/esm/KMTracker.js +15 -15
  126. package/dist/esm/LeftNav.js +1 -1
  127. package/dist/esm/MasterDeck.js +11 -11
  128. package/dist/esm/MasterDeckPaginated.js +11 -11
  129. package/dist/esm/{MediaSeriesCard-3906e9ad.js → MediaSeriesCard-52a2e1ca.js} +2 -2
  130. package/dist/esm/MediaSeriesLanding.js +13 -14
  131. package/dist/esm/MediaSeriesLandingPaginated.js +13 -14
  132. package/dist/esm/NavMagazine.js +12 -12
  133. package/dist/esm/NavNative.js +10 -10
  134. package/dist/esm/OncliveLargeHero.js +1 -1
  135. package/dist/esm/PartnerDetailListing.js +6 -7
  136. package/dist/esm/PartnerDetailListingPaginated.js +6 -7
  137. package/dist/esm/PodcastsLanding.js +6 -7
  138. package/dist/esm/PubSection.js +4 -4
  139. package/dist/esm/PublicationLanding.js +26 -26
  140. package/dist/esm/QueueDeckExpanded.js +4 -4
  141. package/dist/esm/QueueDeckExpandedPaginated.js +4 -4
  142. package/dist/esm/RelatedContent.js +28 -28
  143. package/dist/esm/RelatedTopicsDropdown.js +10 -10
  144. package/dist/esm/SeriesListingDeck.js +2 -2
  145. package/dist/esm/{SeriesSlider-a6b1d617.js → SeriesSlider-2e83e861.js} +5 -5
  146. package/dist/esm/SideFooter.js +2 -2
  147. package/dist/esm/{SocialSearchComponent-6065bff2.js → SocialSearchComponent-020f9e81.js} +1 -1
  148. package/dist/esm/TaxonomyDescription.js +3 -4
  149. package/dist/esm/TemplateNormal.js +2 -2
  150. package/dist/esm/ThumbnailCard.js +1 -1
  151. package/dist/esm/{Tooltip-7a093cd4.js → Tooltip-51957f7c.js} +298 -506
  152. package/dist/esm/Ustream.js +1 -1
  153. package/dist/esm/VideoProgramLandingPage.js +3 -4
  154. package/dist/esm/VideoSeriesCard.js +1 -1
  155. package/dist/esm/VideoSeriesLandingPage.js +3 -3
  156. package/dist/esm/VideoSeriesListing.js +1 -1
  157. package/dist/esm/View.js +7 -9
  158. package/dist/esm/YahooHero.js +1 -1
  159. package/dist/esm/YoutubeGroup.js +5 -5
  160. package/dist/esm/{entities-6d9154b4.js → entities-932b50cf.js} +0 -4
  161. package/dist/esm/faundadb.js +319 -2
  162. package/dist/esm/getRelatedArticle.js +206 -1
  163. package/dist/esm/getSerializers.js +3 -4
  164. package/dist/esm/{getTargeting-5a281334.js → getTargeting-a569a9cc.js} +9 -9
  165. package/dist/esm/getTargeting.js +1 -1
  166. package/dist/esm/{index-718f95b2.js → index-588abaff.js} +595 -9
  167. package/dist/esm/{index-0ce54f8a.js → index-67e1773f.js} +10 -1
  168. package/dist/esm/index.js +10 -17
  169. package/dist/esm/{main-754d4992.js → main-f97773b2.js} +9 -4
  170. package/package.json +116 -116
  171. package/dist/cjs/Auth.js +0 -3682
  172. package/dist/cjs/index-bd6c9f56.js +0 -211
  173. package/dist/cjs/md5-e1ca5797.js +0 -323
  174. package/dist/cjs/util-93a37fd0.js +0 -587
  175. package/dist/esm/Auth.js +0 -3661
  176. package/dist/esm/index-db3bb315.js +0 -207
  177. package/dist/esm/md5-4e42248e.js +0 -321
  178. package/dist/esm/util-8ed16d48.js +0 -585
@@ -1,585 +0,0 @@
1
- // shim for using process in browser
2
-
3
- // from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js
4
- var performance = global.performance || {};
5
- performance.now ||
6
- performance.mozNow ||
7
- performance.msNow ||
8
- performance.oNow ||
9
- performance.webkitNow ||
10
- function(){ return (new Date()).getTime() };
11
-
12
- var inherits;
13
- if (typeof Object.create === 'function'){
14
- inherits = function inherits(ctor, superCtor) {
15
- // implementation from standard node.js 'util' module
16
- ctor.super_ = superCtor;
17
- ctor.prototype = Object.create(superCtor.prototype, {
18
- constructor: {
19
- value: ctor,
20
- enumerable: false,
21
- writable: true,
22
- configurable: true
23
- }
24
- });
25
- };
26
- } else {
27
- inherits = function inherits(ctor, superCtor) {
28
- ctor.super_ = superCtor;
29
- var TempCtor = function () {};
30
- TempCtor.prototype = superCtor.prototype;
31
- ctor.prototype = new TempCtor();
32
- ctor.prototype.constructor = ctor;
33
- };
34
- }
35
- var inherits$1 = inherits;
36
-
37
- // Copyright Joyent, Inc. and other Node contributors.
38
- var formatRegExp = /%[sdj%]/g;
39
- function format(f) {
40
- if (!isString(f)) {
41
- var objects = [];
42
- for (var i = 0; i < arguments.length; i++) {
43
- objects.push(inspect(arguments[i]));
44
- }
45
- return objects.join(' ');
46
- }
47
-
48
- var i = 1;
49
- var args = arguments;
50
- var len = args.length;
51
- var str = String(f).replace(formatRegExp, function(x) {
52
- if (x === '%%') return '%';
53
- if (i >= len) return x;
54
- switch (x) {
55
- case '%s': return String(args[i++]);
56
- case '%d': return Number(args[i++]);
57
- case '%j':
58
- try {
59
- return JSON.stringify(args[i++]);
60
- } catch (_) {
61
- return '[Circular]';
62
- }
63
- default:
64
- return x;
65
- }
66
- });
67
- for (var x = args[i]; i < len; x = args[++i]) {
68
- if (isNull(x) || !isObject(x)) {
69
- str += ' ' + x;
70
- } else {
71
- str += ' ' + inspect(x);
72
- }
73
- }
74
- return str;
75
- }
76
-
77
- // Mark that a method should not be used.
78
- // Returns a modified function which warns once by default.
79
- // If --no-deprecation is set, then it is a no-op.
80
- function deprecate(fn, msg) {
81
- // Allow for deprecating things in the process of starting up.
82
- if (isUndefined(global.process)) {
83
- return function() {
84
- return deprecate(fn, msg).apply(this, arguments);
85
- };
86
- }
87
-
88
- var warned = false;
89
- function deprecated() {
90
- if (!warned) {
91
- {
92
- console.error(msg);
93
- }
94
- warned = true;
95
- }
96
- return fn.apply(this, arguments);
97
- }
98
-
99
- return deprecated;
100
- }
101
-
102
- var debugs = {};
103
- var debugEnviron;
104
- function debuglog(set) {
105
- if (isUndefined(debugEnviron))
106
- debugEnviron = '';
107
- set = set.toUpperCase();
108
- if (!debugs[set]) {
109
- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
110
- var pid = 0;
111
- debugs[set] = function() {
112
- var msg = format.apply(null, arguments);
113
- console.error('%s %d: %s', set, pid, msg);
114
- };
115
- } else {
116
- debugs[set] = function() {};
117
- }
118
- }
119
- return debugs[set];
120
- }
121
-
122
- /**
123
- * Echos the value of a value. Trys to print the value out
124
- * in the best way possible given the different types.
125
- *
126
- * @param {Object} obj The object to print out.
127
- * @param {Object} opts Optional options object that alters the output.
128
- */
129
- /* legacy: obj, showHidden, depth, colors*/
130
- function inspect(obj, opts) {
131
- // default options
132
- var ctx = {
133
- seen: [],
134
- stylize: stylizeNoColor
135
- };
136
- // legacy...
137
- if (arguments.length >= 3) ctx.depth = arguments[2];
138
- if (arguments.length >= 4) ctx.colors = arguments[3];
139
- if (isBoolean(opts)) {
140
- // legacy...
141
- ctx.showHidden = opts;
142
- } else if (opts) {
143
- // got an "options" object
144
- _extend(ctx, opts);
145
- }
146
- // set default options
147
- if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
148
- if (isUndefined(ctx.depth)) ctx.depth = 2;
149
- if (isUndefined(ctx.colors)) ctx.colors = false;
150
- if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
151
- if (ctx.colors) ctx.stylize = stylizeWithColor;
152
- return formatValue(ctx, obj, ctx.depth);
153
- }
154
-
155
- // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
156
- inspect.colors = {
157
- 'bold' : [1, 22],
158
- 'italic' : [3, 23],
159
- 'underline' : [4, 24],
160
- 'inverse' : [7, 27],
161
- 'white' : [37, 39],
162
- 'grey' : [90, 39],
163
- 'black' : [30, 39],
164
- 'blue' : [34, 39],
165
- 'cyan' : [36, 39],
166
- 'green' : [32, 39],
167
- 'magenta' : [35, 39],
168
- 'red' : [31, 39],
169
- 'yellow' : [33, 39]
170
- };
171
-
172
- // Don't use 'blue' not visible on cmd.exe
173
- inspect.styles = {
174
- 'special': 'cyan',
175
- 'number': 'yellow',
176
- 'boolean': 'yellow',
177
- 'undefined': 'grey',
178
- 'null': 'bold',
179
- 'string': 'green',
180
- 'date': 'magenta',
181
- // "name": intentionally not styling
182
- 'regexp': 'red'
183
- };
184
-
185
-
186
- function stylizeWithColor(str, styleType) {
187
- var style = inspect.styles[styleType];
188
-
189
- if (style) {
190
- return '\u001b[' + inspect.colors[style][0] + 'm' + str +
191
- '\u001b[' + inspect.colors[style][1] + 'm';
192
- } else {
193
- return str;
194
- }
195
- }
196
-
197
-
198
- function stylizeNoColor(str, styleType) {
199
- return str;
200
- }
201
-
202
-
203
- function arrayToHash(array) {
204
- var hash = {};
205
-
206
- array.forEach(function(val, idx) {
207
- hash[val] = true;
208
- });
209
-
210
- return hash;
211
- }
212
-
213
-
214
- function formatValue(ctx, value, recurseTimes) {
215
- // Provide a hook for user-specified inspect functions.
216
- // Check that value is an object with an inspect function on it
217
- if (ctx.customInspect &&
218
- value &&
219
- isFunction(value.inspect) &&
220
- // Filter out the util module, it's inspect function is special
221
- value.inspect !== inspect &&
222
- // Also filter out any prototype objects using the circular check.
223
- !(value.constructor && value.constructor.prototype === value)) {
224
- var ret = value.inspect(recurseTimes, ctx);
225
- if (!isString(ret)) {
226
- ret = formatValue(ctx, ret, recurseTimes);
227
- }
228
- return ret;
229
- }
230
-
231
- // Primitive types cannot have properties
232
- var primitive = formatPrimitive(ctx, value);
233
- if (primitive) {
234
- return primitive;
235
- }
236
-
237
- // Look up the keys of the object.
238
- var keys = Object.keys(value);
239
- var visibleKeys = arrayToHash(keys);
240
-
241
- if (ctx.showHidden) {
242
- keys = Object.getOwnPropertyNames(value);
243
- }
244
-
245
- // IE doesn't make error fields non-enumerable
246
- // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
247
- if (isError(value)
248
- && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
249
- return formatError(value);
250
- }
251
-
252
- // Some type of object without properties can be shortcutted.
253
- if (keys.length === 0) {
254
- if (isFunction(value)) {
255
- var name = value.name ? ': ' + value.name : '';
256
- return ctx.stylize('[Function' + name + ']', 'special');
257
- }
258
- if (isRegExp(value)) {
259
- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
260
- }
261
- if (isDate(value)) {
262
- return ctx.stylize(Date.prototype.toString.call(value), 'date');
263
- }
264
- if (isError(value)) {
265
- return formatError(value);
266
- }
267
- }
268
-
269
- var base = '', array = false, braces = ['{', '}'];
270
-
271
- // Make Array say that they are Array
272
- if (isArray(value)) {
273
- array = true;
274
- braces = ['[', ']'];
275
- }
276
-
277
- // Make functions say that they are functions
278
- if (isFunction(value)) {
279
- var n = value.name ? ': ' + value.name : '';
280
- base = ' [Function' + n + ']';
281
- }
282
-
283
- // Make RegExps say that they are RegExps
284
- if (isRegExp(value)) {
285
- base = ' ' + RegExp.prototype.toString.call(value);
286
- }
287
-
288
- // Make dates with properties first say the date
289
- if (isDate(value)) {
290
- base = ' ' + Date.prototype.toUTCString.call(value);
291
- }
292
-
293
- // Make error with message first say the error
294
- if (isError(value)) {
295
- base = ' ' + formatError(value);
296
- }
297
-
298
- if (keys.length === 0 && (!array || value.length == 0)) {
299
- return braces[0] + base + braces[1];
300
- }
301
-
302
- if (recurseTimes < 0) {
303
- if (isRegExp(value)) {
304
- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
305
- } else {
306
- return ctx.stylize('[Object]', 'special');
307
- }
308
- }
309
-
310
- ctx.seen.push(value);
311
-
312
- var output;
313
- if (array) {
314
- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
315
- } else {
316
- output = keys.map(function(key) {
317
- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
318
- });
319
- }
320
-
321
- ctx.seen.pop();
322
-
323
- return reduceToSingleString(output, base, braces);
324
- }
325
-
326
-
327
- function formatPrimitive(ctx, value) {
328
- if (isUndefined(value))
329
- return ctx.stylize('undefined', 'undefined');
330
- if (isString(value)) {
331
- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
332
- .replace(/'/g, "\\'")
333
- .replace(/\\"/g, '"') + '\'';
334
- return ctx.stylize(simple, 'string');
335
- }
336
- if (isNumber(value))
337
- return ctx.stylize('' + value, 'number');
338
- if (isBoolean(value))
339
- return ctx.stylize('' + value, 'boolean');
340
- // For some reason typeof null is "object", so special case here.
341
- if (isNull(value))
342
- return ctx.stylize('null', 'null');
343
- }
344
-
345
-
346
- function formatError(value) {
347
- return '[' + Error.prototype.toString.call(value) + ']';
348
- }
349
-
350
-
351
- function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
352
- var output = [];
353
- for (var i = 0, l = value.length; i < l; ++i) {
354
- if (hasOwnProperty(value, String(i))) {
355
- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
356
- String(i), true));
357
- } else {
358
- output.push('');
359
- }
360
- }
361
- keys.forEach(function(key) {
362
- if (!key.match(/^\d+$/)) {
363
- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
364
- key, true));
365
- }
366
- });
367
- return output;
368
- }
369
-
370
-
371
- function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
372
- var name, str, desc;
373
- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
374
- if (desc.get) {
375
- if (desc.set) {
376
- str = ctx.stylize('[Getter/Setter]', 'special');
377
- } else {
378
- str = ctx.stylize('[Getter]', 'special');
379
- }
380
- } else {
381
- if (desc.set) {
382
- str = ctx.stylize('[Setter]', 'special');
383
- }
384
- }
385
- if (!hasOwnProperty(visibleKeys, key)) {
386
- name = '[' + key + ']';
387
- }
388
- if (!str) {
389
- if (ctx.seen.indexOf(desc.value) < 0) {
390
- if (isNull(recurseTimes)) {
391
- str = formatValue(ctx, desc.value, null);
392
- } else {
393
- str = formatValue(ctx, desc.value, recurseTimes - 1);
394
- }
395
- if (str.indexOf('\n') > -1) {
396
- if (array) {
397
- str = str.split('\n').map(function(line) {
398
- return ' ' + line;
399
- }).join('\n').substr(2);
400
- } else {
401
- str = '\n' + str.split('\n').map(function(line) {
402
- return ' ' + line;
403
- }).join('\n');
404
- }
405
- }
406
- } else {
407
- str = ctx.stylize('[Circular]', 'special');
408
- }
409
- }
410
- if (isUndefined(name)) {
411
- if (array && key.match(/^\d+$/)) {
412
- return str;
413
- }
414
- name = JSON.stringify('' + key);
415
- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
416
- name = name.substr(1, name.length - 2);
417
- name = ctx.stylize(name, 'name');
418
- } else {
419
- name = name.replace(/'/g, "\\'")
420
- .replace(/\\"/g, '"')
421
- .replace(/(^"|"$)/g, "'");
422
- name = ctx.stylize(name, 'string');
423
- }
424
- }
425
-
426
- return name + ': ' + str;
427
- }
428
-
429
-
430
- function reduceToSingleString(output, base, braces) {
431
- var length = output.reduce(function(prev, cur) {
432
- if (cur.indexOf('\n') >= 0) ;
433
- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
434
- }, 0);
435
-
436
- if (length > 60) {
437
- return braces[0] +
438
- (base === '' ? '' : base + '\n ') +
439
- ' ' +
440
- output.join(',\n ') +
441
- ' ' +
442
- braces[1];
443
- }
444
-
445
- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
446
- }
447
-
448
-
449
- // NOTE: These type checking functions intentionally don't use `instanceof`
450
- // because it is fragile and can be easily faked with `Object.create()`.
451
- function isArray(ar) {
452
- return Array.isArray(ar);
453
- }
454
-
455
- function isBoolean(arg) {
456
- return typeof arg === 'boolean';
457
- }
458
-
459
- function isNull(arg) {
460
- return arg === null;
461
- }
462
-
463
- function isNullOrUndefined(arg) {
464
- return arg == null;
465
- }
466
-
467
- function isNumber(arg) {
468
- return typeof arg === 'number';
469
- }
470
-
471
- function isString(arg) {
472
- return typeof arg === 'string';
473
- }
474
-
475
- function isSymbol(arg) {
476
- return typeof arg === 'symbol';
477
- }
478
-
479
- function isUndefined(arg) {
480
- return arg === void 0;
481
- }
482
-
483
- function isRegExp(re) {
484
- return isObject(re) && objectToString(re) === '[object RegExp]';
485
- }
486
-
487
- function isObject(arg) {
488
- return typeof arg === 'object' && arg !== null;
489
- }
490
-
491
- function isDate(d) {
492
- return isObject(d) && objectToString(d) === '[object Date]';
493
- }
494
-
495
- function isError(e) {
496
- return isObject(e) &&
497
- (objectToString(e) === '[object Error]' || e instanceof Error);
498
- }
499
-
500
- function isFunction(arg) {
501
- return typeof arg === 'function';
502
- }
503
-
504
- function isPrimitive(arg) {
505
- return arg === null ||
506
- typeof arg === 'boolean' ||
507
- typeof arg === 'number' ||
508
- typeof arg === 'string' ||
509
- typeof arg === 'symbol' || // ES6 symbol
510
- typeof arg === 'undefined';
511
- }
512
-
513
- function isBuffer(maybeBuf) {
514
- return Buffer.isBuffer(maybeBuf);
515
- }
516
-
517
- function objectToString(o) {
518
- return Object.prototype.toString.call(o);
519
- }
520
-
521
-
522
- function pad(n) {
523
- return n < 10 ? '0' + n.toString(10) : n.toString(10);
524
- }
525
-
526
-
527
- var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
528
- 'Oct', 'Nov', 'Dec'];
529
-
530
- // 26 Feb 16:19:34
531
- function timestamp() {
532
- var d = new Date();
533
- var time = [pad(d.getHours()),
534
- pad(d.getMinutes()),
535
- pad(d.getSeconds())].join(':');
536
- return [d.getDate(), months[d.getMonth()], time].join(' ');
537
- }
538
-
539
-
540
- // log is just a thin wrapper to console.log that prepends a timestamp
541
- function log() {
542
- console.log('%s - %s', timestamp(), format.apply(null, arguments));
543
- }
544
-
545
- function _extend(origin, add) {
546
- // Don't do anything if add isn't an object
547
- if (!add || !isObject(add)) return origin;
548
-
549
- var keys = Object.keys(add);
550
- var i = keys.length;
551
- while (i--) {
552
- origin[keys[i]] = add[keys[i]];
553
- }
554
- return origin;
555
- }
556
- function hasOwnProperty(obj, prop) {
557
- return Object.prototype.hasOwnProperty.call(obj, prop);
558
- }
559
-
560
- var util = {
561
- inherits: inherits$1,
562
- _extend: _extend,
563
- log: log,
564
- isBuffer: isBuffer,
565
- isPrimitive: isPrimitive,
566
- isFunction: isFunction,
567
- isError: isError,
568
- isDate: isDate,
569
- isObject: isObject,
570
- isRegExp: isRegExp,
571
- isUndefined: isUndefined,
572
- isSymbol: isSymbol,
573
- isString: isString,
574
- isNumber: isNumber,
575
- isNullOrUndefined: isNullOrUndefined,
576
- isNull: isNull,
577
- isBoolean: isBoolean,
578
- isArray: isArray,
579
- inspect: inspect,
580
- deprecate: deprecate,
581
- format: format,
582
- debuglog: debuglog
583
- };
584
-
585
- export { util as u };