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