chefcookie 2.8.8 → 2.9.0

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.
package/_build/_helper.js CHANGED
@@ -1,49 +1,37 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.default = void 0;
8
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var helper = /*#__PURE__*/function () {
11
- function helper() {
12
- (0, _classCallCheck2.default)(this, helper);
13
- }
14
- (0, _createClass2.default)(helper, null, [{
15
- key: "getParam",
16
- value: function getParam(variable) {
17
- var url = window.location.search;
18
- if (url == '') {
19
- return null;
20
- }
21
- var query = url.substring(1),
22
- vars = query.split('&');
23
- for (var i = 0; i < vars.length; i++) {
24
- var pair = vars[i].split('=');
25
- if (pair[0] == variable && pair[1] != '') {
26
- return pair[1];
27
- }
28
- }
7
+ class helper {
8
+ static getParam(variable) {
9
+ let url = window.location.search;
10
+ if (url == '') {
29
11
  return null;
30
12
  }
31
- }, {
32
- key: "urlHostTopLevel",
33
- value: function urlHostTopLevel() {
34
- var host = window.location.hostname;
35
- // ipv4
36
- if (host.match(/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/)) {
37
- return host;
38
- }
39
- host = host.split('.');
40
- while (host.length > 2) {
41
- host.shift();
13
+ let query = url.substring(1),
14
+ vars = query.split('&');
15
+ for (var i = 0; i < vars.length; i++) {
16
+ var pair = vars[i].split('=');
17
+ if (pair[0] == variable && pair[1] != '') {
18
+ return pair[1];
42
19
  }
43
- host = host.join('.');
20
+ }
21
+ return null;
22
+ }
23
+ static urlHostTopLevel() {
24
+ let host = window.location.hostname;
25
+ // ipv4
26
+ if (host.match(/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/)) {
44
27
  return host;
45
28
  }
46
- }]);
47
- return helper;
48
- }();
29
+ host = host.split('.');
30
+ while (host.length > 2) {
31
+ host.shift();
32
+ }
33
+ host = host.join('.');
34
+ return host;
35
+ }
36
+ }
49
37
  exports.default = helper;