@mjhls/mjh-framework 1.0.673-article-series-v4 → 1.0.673

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 (212) hide show
  1. package/dist/cjs/AD.js +9 -10
  2. package/dist/cjs/AD300x250.js +9 -10
  3. package/dist/cjs/AD300x250x600.js +9 -10
  4. package/dist/cjs/AD728x90.js +10 -11
  5. package/dist/cjs/ADFloatingFooter.js +11 -12
  6. package/dist/cjs/ADFooter.js +8 -9
  7. package/dist/cjs/ADGutter.js +11 -12
  8. package/dist/cjs/{ADInfeed-bc591de7.js → ADInfeed-9735aff2.js} +9 -11
  9. package/dist/cjs/ADSkyscraper.js +11 -12
  10. package/dist/cjs/ADSponsoredResources.js +11 -12
  11. package/dist/cjs/ADWebcast.js +11 -12
  12. package/dist/cjs/ADWelcome.js +15 -16
  13. package/dist/cjs/{ADlgInfeed-4b713637.js → ADlgInfeed-6bd11848.js} +6 -7
  14. package/dist/cjs/AccordionPanel.js +22 -24
  15. package/dist/cjs/AdSlot.js +13 -14
  16. package/dist/cjs/AdSlotsProvider.js +5 -6
  17. package/dist/cjs/AlphabeticList.js +15 -16
  18. package/dist/cjs/ArticleCarousel.js +8 -9
  19. package/dist/cjs/ArticleSeriesListing.js +37 -38
  20. package/dist/cjs/Auth.js +593 -430
  21. package/dist/cjs/{AuthorComponent-ac8972ce.js → AuthorComponent-bb831b74.js} +12 -13
  22. package/dist/cjs/{BlockContent-8b494587.js → BlockContent-88f69acd.js} +24 -25
  23. package/dist/cjs/Breadcrumbs.js +21 -23
  24. package/dist/cjs/CMEDeck.js +61 -61
  25. package/dist/cjs/Column1.js +11 -14
  26. package/dist/cjs/Column2.js +19 -22
  27. package/dist/cjs/Column3.js +32 -35
  28. package/dist/cjs/ConferenceArticleCard.js +18 -19
  29. package/dist/cjs/ConferenceBanner-4a16fddc.js +23 -0
  30. package/dist/cjs/DeckContent.js +73 -77
  31. package/dist/cjs/DeckQueue.js +69 -73
  32. package/dist/cjs/{Dfp-fa2c6aad.js → Dfp-b2bc3b97.js} +20 -21
  33. package/dist/cjs/EventsDeck.js +116 -123
  34. package/dist/cjs/ExternalResources.js +43 -44
  35. package/dist/cjs/Feature.js +24 -26
  36. package/dist/cjs/ForbesHero.js +33 -34
  37. package/dist/cjs/GridContent.js +149 -153
  38. package/dist/cjs/GridHero.js +34 -35
  39. package/dist/cjs/GroupDeck.js +39 -40
  40. package/dist/cjs/HamMagazine.js +114 -119
  41. package/dist/cjs/Header.js +11 -13
  42. package/dist/cjs/Hero.js +10 -11
  43. package/dist/cjs/HighlightenVideo.js +16 -17
  44. package/dist/cjs/HorizontalHero.js +24 -25
  45. package/dist/cjs/IssueContentDeck.js +64 -69
  46. package/dist/cjs/IssueDeck.js +59 -64
  47. package/dist/cjs/IssueLanding.js +17 -18
  48. package/dist/cjs/LeftNav.js +20 -22
  49. package/dist/cjs/MasterDeck.js +49 -50
  50. package/dist/cjs/NavDvm.js +63 -68
  51. package/dist/cjs/{NavFooter-3dcd99a8.js → NavFooter-76c913e3.js} +14 -15
  52. package/dist/cjs/NavMagazine.js +116 -121
  53. package/dist/cjs/NavNative.js +95 -103
  54. package/dist/cjs/NavNormal.js +36 -41
  55. package/dist/cjs/OncliveHero.js +18 -18
  56. package/dist/cjs/OncliveLargeHero.js +58 -59
  57. package/dist/cjs/PageFilter.js +8 -9
  58. package/dist/cjs/PartnerDetailListing.js +71 -1269
  59. package/dist/cjs/PdfDownload.js +8 -9
  60. package/dist/cjs/PopUpModal.js +13 -15
  61. package/dist/cjs/PublicationDeck.js +58 -63
  62. package/dist/cjs/PublicationLanding.js +48 -52
  63. package/dist/cjs/QueueDeckExpanded.js +219 -219
  64. package/dist/cjs/RecentNews.js +22 -23
  65. package/dist/cjs/RelatedContent.js +21 -22
  66. package/dist/cjs/RelatedTopicsDropdown.js +19 -22
  67. package/dist/cjs/RolesDeck.js +27 -32
  68. package/dist/cjs/Search.js +12 -16
  69. package/dist/cjs/SideFooter.js +23 -24
  70. package/dist/cjs/SocialIcons.js +9 -10
  71. package/dist/cjs/{SocialSearchComponent-fde6c921.js → SocialSearchComponent-962b1344.js} +32 -36
  72. package/dist/cjs/SocialShare.js +29 -31
  73. package/dist/cjs/TaxonomyCard.js +54 -59
  74. package/dist/cjs/TemplateNormal.js +35 -36
  75. package/dist/cjs/ThumbnailCard.js +17 -19
  76. package/dist/cjs/Ustream.js +20 -21
  77. package/dist/cjs/VerticalHero.js +16 -17
  78. package/dist/cjs/VideoSeriesCard.js +24 -25
  79. package/dist/cjs/VideoSeriesFilter.js +9 -9
  80. package/dist/cjs/VideoSeriesListing.js +51 -52
  81. package/dist/cjs/View.js +180 -184
  82. package/dist/cjs/YahooHero.js +29 -30
  83. package/dist/cjs/YoutubeGroup.js +52 -53
  84. package/dist/cjs/{brightcove-react-player-loader.es-5c98aec7.js → brightcove-react-player-loader.es-156bd4d6.js} +8 -10
  85. package/dist/cjs/getRelatedArticle.js +5 -354
  86. package/dist/cjs/getSerializers.js +9 -9
  87. package/dist/cjs/iconBase-68959171.js +3 -0
  88. package/dist/cjs/{index-44481153.js → index-2d0a4911.js} +8 -9
  89. package/dist/cjs/{index-6367b7bf.js → index-5be2866f.js} +17 -16
  90. package/dist/cjs/{index-14681913.js → index-c190d704.js} +350 -360
  91. package/dist/cjs/{index-8a3fb0bc.js → index-da796b8c.js} +10 -12
  92. package/dist/cjs/{index.es-f3e47207.js → index.es-ab3f2690.js} +11 -28
  93. package/dist/cjs/{index.esm-3b9b8952.js → index.esm-66ffa47a.js} +9 -4
  94. package/dist/cjs/{index.esm-61650d1a.js → index.esm-876ca9ff.js} +12 -5
  95. package/dist/cjs/{index.esm-dd489d02.js → index.esm-fe549f9c.js} +20 -20
  96. package/dist/cjs/{index.esm-05850a2f.js → index.esm-ff47db6f.js} +12 -5
  97. package/dist/cjs/index.js +32 -31
  98. package/dist/cjs/{inherits-87492b40.js → inherits-513d81cd.js} +4 -4
  99. package/dist/cjs/{lodash-7fd85bcf.js → lodash-fc2922d0.js} +22 -71
  100. package/dist/cjs/{main-9499b3ef.js → main-b6c96c8d.js} +43 -48
  101. package/dist/cjs/{moment-ca3bd9fb.js → moment-66a6a284.js} +8 -10
  102. package/dist/cjs/{react-social-icons-07939b41.js → react-social-icons-f7f48f71.js} +11 -12
  103. package/dist/cjs/{typeof-9d7f610f.js → typeof-725500bc.js} +1 -1
  104. package/dist/cjs/urlFor.js +2 -2
  105. package/dist/cjs/{visibility-sensor-8b54af99.js → visibility-sensor-0c45a583.js} +5 -7
  106. package/dist/esm/AD.js +7 -7
  107. package/dist/esm/AD300x250.js +7 -7
  108. package/dist/esm/AD300x250x600.js +7 -7
  109. package/dist/esm/AD728x90.js +8 -8
  110. package/dist/esm/ADFloatingFooter.js +9 -9
  111. package/dist/esm/ADFooter.js +6 -6
  112. package/dist/esm/ADGutter.js +9 -9
  113. package/dist/esm/{ADInfeed-d1777980.js → ADInfeed-9140aa7d.js} +5 -5
  114. package/dist/esm/ADSkyscraper.js +9 -9
  115. package/dist/esm/ADSponsoredResources.js +9 -9
  116. package/dist/esm/ADWebcast.js +9 -9
  117. package/dist/esm/ADWelcome.js +13 -13
  118. package/dist/esm/{ADlgInfeed-84282fe8.js → ADlgInfeed-7656ecd1.js} +4 -4
  119. package/dist/esm/AccordionPanel.js +17 -17
  120. package/dist/esm/AdSlot.js +5 -5
  121. package/dist/esm/AdSlotsProvider.js +3 -3
  122. package/dist/esm/AlphabeticList.js +13 -13
  123. package/dist/esm/ArticleCarousel.js +6 -6
  124. package/dist/esm/ArticleSeriesListing.js +32 -32
  125. package/dist/esm/Auth.js +578 -411
  126. package/dist/esm/{AuthorComponent-23afa074.js → AuthorComponent-00f13201.js} +10 -10
  127. package/dist/esm/{BlockContent-d05b5b23.js → BlockContent-a614acdf.js} +3 -3
  128. package/dist/esm/Breadcrumbs.js +11 -11
  129. package/dist/esm/CMEDeck.js +58 -58
  130. package/dist/esm/Column1.js +5 -5
  131. package/dist/esm/Column2.js +12 -12
  132. package/dist/esm/Column3.js +24 -24
  133. package/dist/esm/ConferenceArticleCard.js +13 -13
  134. package/dist/esm/{ConferenceBanner-9162d0ca.js → ConferenceBanner-8792ebd2.js} +4 -4
  135. package/dist/esm/DeckContent.js +53 -53
  136. package/dist/esm/DeckQueue.js +46 -46
  137. package/dist/esm/{Dfp-939e8fcf.js → Dfp-8a8fca18.js} +10 -10
  138. package/dist/esm/EventsDeck.js +66 -66
  139. package/dist/esm/ExternalResources.js +37 -37
  140. package/dist/esm/Feature.js +16 -16
  141. package/dist/esm/ForbesHero.js +27 -27
  142. package/dist/esm/GridContent.js +110 -110
  143. package/dist/esm/GridHero.js +28 -28
  144. package/dist/esm/GroupDeck.js +35 -35
  145. package/dist/esm/HamMagazine.js +86 -86
  146. package/dist/esm/Header.js +7 -7
  147. package/dist/esm/Hero.js +6 -6
  148. package/dist/esm/HighlightenVideo.js +14 -14
  149. package/dist/esm/HorizontalHero.js +20 -20
  150. package/dist/esm/IssueContentDeck.js +40 -40
  151. package/dist/esm/IssueDeck.js +33 -33
  152. package/dist/esm/IssueLanding.js +15 -15
  153. package/dist/esm/LeftNav.js +16 -16
  154. package/dist/esm/MasterDeck.js +43 -43
  155. package/dist/esm/NavDvm.js +43 -43
  156. package/dist/esm/{NavFooter-c29526b7.js → NavFooter-e27bd93b.js} +12 -12
  157. package/dist/esm/NavMagazine.js +90 -90
  158. package/dist/esm/NavNative.js +70 -70
  159. package/dist/esm/NavNormal.js +21 -21
  160. package/dist/esm/OncliveHero.js +14 -13
  161. package/dist/esm/OncliveLargeHero.js +51 -51
  162. package/dist/esm/PageFilter.js +6 -6
  163. package/dist/esm/PartnerDetailListing.js +67 -1263
  164. package/dist/esm/PdfDownload.js +6 -6
  165. package/dist/esm/PopUpModal.js +8 -8
  166. package/dist/esm/PublicationDeck.js +34 -34
  167. package/dist/esm/PublicationLanding.js +28 -28
  168. package/dist/esm/QueueDeckExpanded.js +199 -199
  169. package/dist/esm/RecentNews.js +18 -18
  170. package/dist/esm/RelatedContent.js +16 -16
  171. package/dist/esm/RelatedTopicsDropdown.js +11 -11
  172. package/dist/esm/RolesDeck.js +13 -13
  173. package/dist/esm/Search.js +5 -5
  174. package/dist/esm/SideFooter.js +19 -19
  175. package/dist/esm/SocialIcons.js +7 -7
  176. package/dist/esm/{SocialSearchComponent-a13fc98b.js → SocialSearchComponent-75527dfe.js} +23 -23
  177. package/dist/esm/SocialShare.js +25 -25
  178. package/dist/esm/TaxonomyCard.js +35 -35
  179. package/dist/esm/TemplateNormal.js +29 -29
  180. package/dist/esm/ThumbnailCard.js +9 -9
  181. package/dist/esm/Ustream.js +18 -18
  182. package/dist/esm/VerticalHero.js +12 -12
  183. package/dist/esm/VideoSeriesCard.js +16 -16
  184. package/dist/esm/VideoSeriesFilter.js +6 -6
  185. package/dist/esm/VideoSeriesListing.js +45 -45
  186. package/dist/esm/View.js +166 -166
  187. package/dist/esm/YahooHero.js +24 -24
  188. package/dist/esm/YoutubeGroup.js +38 -38
  189. package/dist/esm/{brightcove-react-player-loader.es-4abff0b1.js → brightcove-react-player-loader.es-83f53e4e.js} +6 -7
  190. package/dist/esm/getRelatedArticle.js +5 -354
  191. package/dist/esm/getSerializers.js +9 -9
  192. package/dist/esm/{index-c5fd0af5.js → index-5f9f807a.js} +4 -4
  193. package/dist/esm/{index-1819118a.js → index-93ec3c59.js} +3 -3
  194. package/dist/esm/{index-609b2da6.js → index-983cedab.js} +298 -302
  195. package/dist/esm/{index-c00b0bbb.js → index-d2f90501.js} +17 -16
  196. package/dist/esm/{index.es-c6222053.js → index.es-938a3a58.js} +9 -25
  197. package/dist/esm/{index.esm-902766e0.js → index.esm-73e847d2.js} +18 -17
  198. package/dist/esm/{index.esm-79385203.js → index.esm-85cb09e6.js} +12 -5
  199. package/dist/esm/{index.esm-d6f88d94.js → index.esm-b08f4b04.js} +9 -4
  200. package/dist/esm/{index.esm-a8ff922c.js → index.esm-cf08bf18.js} +12 -5
  201. package/dist/esm/index.js +27 -26
  202. package/dist/esm/{inherits-596840e8.js → inherits-7ee3e0c1.js} +1 -1
  203. package/dist/esm/{lodash-ec8c6b48.js → lodash-17fdfebb.js} +22 -71
  204. package/dist/esm/{main-edbd70ac.js → main-0465b2a0.js} +44 -48
  205. package/dist/esm/{moment-b6f49411.js → moment-12415288.js} +8 -10
  206. package/dist/esm/{react-social-icons-3822f1ce.js → react-social-icons-a7d5c5c7.js} +5 -5
  207. package/dist/esm/{typeof-ee095d0c.js → typeof-08f2c380.js} +1 -1
  208. package/dist/esm/{visibility-sensor-082c757b.js → visibility-sensor-0baa4eea.js} +2 -2
  209. package/package.json +1 -1
  210. package/dist/cjs/ConferenceBanner-6c9e718a.js +0 -24
  211. package/dist/cjs/index-bd6c9f56.js +0 -211
  212. package/dist/esm/index-db3bb315.js +0 -207
@@ -1,5 +1,5 @@
1
1
  import { c as createCommonjsModule, u as unwrapExports } from './_commonjsHelpers-0c4b6f40.js';
2
- import React from 'react';
2
+ import React__default from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
 
5
5
  var styles = createCommonjsModule(function (module, exports) {
@@ -71,7 +71,7 @@ Object.defineProperty(exports, "__esModule", {
71
71
  });
72
72
  exports.default = void 0;
73
73
 
74
- var _react = _interopRequireDefault(React);
74
+ var _react = _interopRequireDefault(React__default);
75
75
 
76
76
 
77
77
 
@@ -392,7 +392,7 @@ exports.default = void 0;
392
392
 
393
393
  var _propTypes = _interopRequireDefault(PropTypes);
394
394
 
395
- var _react = _interopRequireDefault(React);
395
+ var _react = _interopRequireDefault(React__default);
396
396
 
397
397
 
398
398
 
@@ -452,7 +452,7 @@ exports.default = void 0;
452
452
 
453
453
  var _propTypes = _interopRequireDefault(PropTypes);
454
454
 
455
- var _react = _interopRequireDefault(React);
455
+ var _react = _interopRequireDefault(React__default);
456
456
 
457
457
 
458
458
 
@@ -513,7 +513,7 @@ exports.default = void 0;
513
513
 
514
514
  var _propTypes = _interopRequireDefault(PropTypes);
515
515
 
516
- var _react = _interopRequireDefault(React);
516
+ var _react = _interopRequireDefault(React__default);
517
517
 
518
518
  var _background = _interopRequireDefault(background);
519
519
 
@@ -248,7 +248,7 @@ if (!USE_NATIVE) {
248
248
  _objectGops.f = $getOwnPropertySymbols;
249
249
 
250
250
  if (_descriptors && !_library) {
251
- _redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable);
251
+ _redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
252
252
  }
253
253
 
254
254
  _wksExt.f = function (name) {
@@ -1,10 +1,10 @@
1
1
  import { c as createCommonjsModule, a as commonjsGlobal, u as unwrapExports } from './_commonjsHelpers-0c4b6f40.js';
2
- import React from 'react';
2
+ import React__default from 'react';
3
3
  import reactDom from 'react-dom';
4
4
 
5
5
  var visibilitySensor = createCommonjsModule(function (module, exports) {
6
6
  (function webpackUniversalModuleDefinition(root, factory) {
7
- module.exports = factory(React, reactDom);
7
+ module.exports = factory(React__default, reactDom);
8
8
  })(commonjsGlobal, function(__WEBPACK_EXTERNAL_MODULE__1__, __WEBPACK_EXTERNAL_MODULE__2__) {
9
9
  return /******/ (function(modules) { // webpackBootstrap
10
10
  /******/ // The module cache
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.673-article-series-v4",
3
+ "version": "1.0.673",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",
@@ -1,24 +0,0 @@
1
- 'use strict';
2
-
3
- var React = require('react');
4
-
5
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
6
-
7
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
8
-
9
- var ConferenceBanner = function ConferenceBanner(props) {
10
- var website = props.website;
11
-
12
-
13
- return React__default['default'].createElement(
14
- "div",
15
- { className: "conf-img" },
16
- React__default['default'].createElement(
17
- "a",
18
- { href: website.conferenceBannerContent.href },
19
- React__default['default'].createElement("img", { src: website.conferenceBannerContent.src, alt: website.conferenceBannerContent.alt })
20
- )
21
- );
22
- };
23
-
24
- exports.ConferenceBanner = ConferenceBanner;
@@ -1,211 +0,0 @@
1
- 'use strict';
2
-
3
- /*!
4
- * cookie
5
- * Copyright(c) 2012-2014 Roman Shtylman
6
- * Copyright(c) 2015 Douglas Christopher Wilson
7
- * MIT Licensed
8
- */
9
-
10
- /**
11
- * Module exports.
12
- * @public
13
- */
14
-
15
- var parse_1 = parse;
16
- var serialize_1 = serialize;
17
-
18
- /**
19
- * Module variables.
20
- * @private
21
- */
22
-
23
- var decode = decodeURIComponent;
24
- var encode = encodeURIComponent;
25
- var pairSplitRegExp = /; */;
26
-
27
- /**
28
- * RegExp to match field-content in RFC 7230 sec 3.2
29
- *
30
- * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
31
- * field-vchar = VCHAR / obs-text
32
- * obs-text = %x80-FF
33
- */
34
-
35
- var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
36
-
37
- /**
38
- * Parse a cookie header.
39
- *
40
- * Parse the given cookie header string into an object
41
- * The object has the various cookies as keys(names) => values
42
- *
43
- * @param {string} str
44
- * @param {object} [options]
45
- * @return {object}
46
- * @public
47
- */
48
-
49
- function parse(str, options) {
50
- if (typeof str !== 'string') {
51
- throw new TypeError('argument str must be a string');
52
- }
53
-
54
- var obj = {};
55
- var opt = options || {};
56
- var pairs = str.split(pairSplitRegExp);
57
- var dec = opt.decode || decode;
58
-
59
- for (var i = 0; i < pairs.length; i++) {
60
- var pair = pairs[i];
61
- var eq_idx = pair.indexOf('=');
62
-
63
- // skip things that don't look like key=value
64
- if (eq_idx < 0) {
65
- continue;
66
- }
67
-
68
- var key = pair.substr(0, eq_idx).trim();
69
- var val = pair.substr(++eq_idx, pair.length).trim();
70
-
71
- // quoted values
72
- if ('"' == val[0]) {
73
- val = val.slice(1, -1);
74
- }
75
-
76
- // only assign once
77
- if (undefined == obj[key]) {
78
- obj[key] = tryDecode(val, dec);
79
- }
80
- }
81
-
82
- return obj;
83
- }
84
-
85
- /**
86
- * Serialize data into a cookie header.
87
- *
88
- * Serialize the a name value pair into a cookie string suitable for
89
- * http headers. An optional options object specified cookie parameters.
90
- *
91
- * serialize('foo', 'bar', { httpOnly: true })
92
- * => "foo=bar; httpOnly"
93
- *
94
- * @param {string} name
95
- * @param {string} val
96
- * @param {object} [options]
97
- * @return {string}
98
- * @public
99
- */
100
-
101
- function serialize(name, val, options) {
102
- var opt = options || {};
103
- var enc = opt.encode || encode;
104
-
105
- if (typeof enc !== 'function') {
106
- throw new TypeError('option encode is invalid');
107
- }
108
-
109
- if (!fieldContentRegExp.test(name)) {
110
- throw new TypeError('argument name is invalid');
111
- }
112
-
113
- var value = enc(val);
114
-
115
- if (value && !fieldContentRegExp.test(value)) {
116
- throw new TypeError('argument val is invalid');
117
- }
118
-
119
- var str = name + '=' + value;
120
-
121
- if (null != opt.maxAge) {
122
- var maxAge = opt.maxAge - 0;
123
-
124
- if (isNaN(maxAge) || !isFinite(maxAge)) {
125
- throw new TypeError('option maxAge is invalid')
126
- }
127
-
128
- str += '; Max-Age=' + Math.floor(maxAge);
129
- }
130
-
131
- if (opt.domain) {
132
- if (!fieldContentRegExp.test(opt.domain)) {
133
- throw new TypeError('option domain is invalid');
134
- }
135
-
136
- str += '; Domain=' + opt.domain;
137
- }
138
-
139
- if (opt.path) {
140
- if (!fieldContentRegExp.test(opt.path)) {
141
- throw new TypeError('option path is invalid');
142
- }
143
-
144
- str += '; Path=' + opt.path;
145
- }
146
-
147
- if (opt.expires) {
148
- if (typeof opt.expires.toUTCString !== 'function') {
149
- throw new TypeError('option expires is invalid');
150
- }
151
-
152
- str += '; Expires=' + opt.expires.toUTCString();
153
- }
154
-
155
- if (opt.httpOnly) {
156
- str += '; HttpOnly';
157
- }
158
-
159
- if (opt.secure) {
160
- str += '; Secure';
161
- }
162
-
163
- if (opt.sameSite) {
164
- var sameSite = typeof opt.sameSite === 'string'
165
- ? opt.sameSite.toLowerCase() : opt.sameSite;
166
-
167
- switch (sameSite) {
168
- case true:
169
- str += '; SameSite=Strict';
170
- break;
171
- case 'lax':
172
- str += '; SameSite=Lax';
173
- break;
174
- case 'strict':
175
- str += '; SameSite=Strict';
176
- break;
177
- case 'none':
178
- str += '; SameSite=None';
179
- break;
180
- default:
181
- throw new TypeError('option sameSite is invalid');
182
- }
183
- }
184
-
185
- return str;
186
- }
187
-
188
- /**
189
- * Try decoding a string using a decoding function.
190
- *
191
- * @param {string} str
192
- * @param {function} decode
193
- * @private
194
- */
195
-
196
- function tryDecode(str, decode) {
197
- try {
198
- return decode(str);
199
- } catch (e) {
200
- return str;
201
- }
202
- }
203
-
204
- var cookie = {
205
- parse: parse_1,
206
- serialize: serialize_1
207
- };
208
-
209
- exports.cookie = cookie;
210
- exports.parse_1 = parse_1;
211
- exports.serialize_1 = serialize_1;
@@ -1,207 +0,0 @@
1
- /*!
2
- * cookie
3
- * Copyright(c) 2012-2014 Roman Shtylman
4
- * Copyright(c) 2015 Douglas Christopher Wilson
5
- * MIT Licensed
6
- */
7
-
8
- /**
9
- * Module exports.
10
- * @public
11
- */
12
-
13
- var parse_1 = parse;
14
- var serialize_1 = serialize;
15
-
16
- /**
17
- * Module variables.
18
- * @private
19
- */
20
-
21
- var decode = decodeURIComponent;
22
- var encode = encodeURIComponent;
23
- var pairSplitRegExp = /; */;
24
-
25
- /**
26
- * RegExp to match field-content in RFC 7230 sec 3.2
27
- *
28
- * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
29
- * field-vchar = VCHAR / obs-text
30
- * obs-text = %x80-FF
31
- */
32
-
33
- var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
34
-
35
- /**
36
- * Parse a cookie header.
37
- *
38
- * Parse the given cookie header string into an object
39
- * The object has the various cookies as keys(names) => values
40
- *
41
- * @param {string} str
42
- * @param {object} [options]
43
- * @return {object}
44
- * @public
45
- */
46
-
47
- function parse(str, options) {
48
- if (typeof str !== 'string') {
49
- throw new TypeError('argument str must be a string');
50
- }
51
-
52
- var obj = {};
53
- var opt = options || {};
54
- var pairs = str.split(pairSplitRegExp);
55
- var dec = opt.decode || decode;
56
-
57
- for (var i = 0; i < pairs.length; i++) {
58
- var pair = pairs[i];
59
- var eq_idx = pair.indexOf('=');
60
-
61
- // skip things that don't look like key=value
62
- if (eq_idx < 0) {
63
- continue;
64
- }
65
-
66
- var key = pair.substr(0, eq_idx).trim();
67
- var val = pair.substr(++eq_idx, pair.length).trim();
68
-
69
- // quoted values
70
- if ('"' == val[0]) {
71
- val = val.slice(1, -1);
72
- }
73
-
74
- // only assign once
75
- if (undefined == obj[key]) {
76
- obj[key] = tryDecode(val, dec);
77
- }
78
- }
79
-
80
- return obj;
81
- }
82
-
83
- /**
84
- * Serialize data into a cookie header.
85
- *
86
- * Serialize the a name value pair into a cookie string suitable for
87
- * http headers. An optional options object specified cookie parameters.
88
- *
89
- * serialize('foo', 'bar', { httpOnly: true })
90
- * => "foo=bar; httpOnly"
91
- *
92
- * @param {string} name
93
- * @param {string} val
94
- * @param {object} [options]
95
- * @return {string}
96
- * @public
97
- */
98
-
99
- function serialize(name, val, options) {
100
- var opt = options || {};
101
- var enc = opt.encode || encode;
102
-
103
- if (typeof enc !== 'function') {
104
- throw new TypeError('option encode is invalid');
105
- }
106
-
107
- if (!fieldContentRegExp.test(name)) {
108
- throw new TypeError('argument name is invalid');
109
- }
110
-
111
- var value = enc(val);
112
-
113
- if (value && !fieldContentRegExp.test(value)) {
114
- throw new TypeError('argument val is invalid');
115
- }
116
-
117
- var str = name + '=' + value;
118
-
119
- if (null != opt.maxAge) {
120
- var maxAge = opt.maxAge - 0;
121
-
122
- if (isNaN(maxAge) || !isFinite(maxAge)) {
123
- throw new TypeError('option maxAge is invalid')
124
- }
125
-
126
- str += '; Max-Age=' + Math.floor(maxAge);
127
- }
128
-
129
- if (opt.domain) {
130
- if (!fieldContentRegExp.test(opt.domain)) {
131
- throw new TypeError('option domain is invalid');
132
- }
133
-
134
- str += '; Domain=' + opt.domain;
135
- }
136
-
137
- if (opt.path) {
138
- if (!fieldContentRegExp.test(opt.path)) {
139
- throw new TypeError('option path is invalid');
140
- }
141
-
142
- str += '; Path=' + opt.path;
143
- }
144
-
145
- if (opt.expires) {
146
- if (typeof opt.expires.toUTCString !== 'function') {
147
- throw new TypeError('option expires is invalid');
148
- }
149
-
150
- str += '; Expires=' + opt.expires.toUTCString();
151
- }
152
-
153
- if (opt.httpOnly) {
154
- str += '; HttpOnly';
155
- }
156
-
157
- if (opt.secure) {
158
- str += '; Secure';
159
- }
160
-
161
- if (opt.sameSite) {
162
- var sameSite = typeof opt.sameSite === 'string'
163
- ? opt.sameSite.toLowerCase() : opt.sameSite;
164
-
165
- switch (sameSite) {
166
- case true:
167
- str += '; SameSite=Strict';
168
- break;
169
- case 'lax':
170
- str += '; SameSite=Lax';
171
- break;
172
- case 'strict':
173
- str += '; SameSite=Strict';
174
- break;
175
- case 'none':
176
- str += '; SameSite=None';
177
- break;
178
- default:
179
- throw new TypeError('option sameSite is invalid');
180
- }
181
- }
182
-
183
- return str;
184
- }
185
-
186
- /**
187
- * Try decoding a string using a decoding function.
188
- *
189
- * @param {string} str
190
- * @param {function} decode
191
- * @private
192
- */
193
-
194
- function tryDecode(str, decode) {
195
- try {
196
- return decode(str);
197
- } catch (e) {
198
- return str;
199
- }
200
- }
201
-
202
- var cookie = {
203
- parse: parse_1,
204
- serialize: serialize_1
205
- };
206
-
207
- export { cookie as c, parse_1 as p, serialize_1 as s };