express-ext 0.2.2 → 0.2.4

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.
@@ -33,7 +33,6 @@ var GenericController = (function (_super) {
33
33
  }
34
34
  }
35
35
  _this.create = _this.create.bind(_this);
36
- _this.insert = _this.insert.bind(_this);
37
36
  _this.update = _this.update.bind(_this);
38
37
  _this.patch = _this.patch.bind(_this);
39
38
  _this.delete = _this.delete.bind(_this);
@@ -44,10 +43,7 @@ var GenericController = (function (_super) {
44
43
  return _this;
45
44
  }
46
45
  GenericController.prototype.create = function (req, res) {
47
- return this.insert(req, res);
48
- };
49
- GenericController.prototype.insert = function (req, res) {
50
- validateAndCreate(req, res, this.service.insert, this.log, this.validate, this.build);
46
+ validateAndCreate(req, res, this.service.create, this.log, this.validate, this.build);
51
47
  };
52
48
  GenericController.prototype.update = function (req, res) {
53
49
  var id = buildAndCheckIdWithBody(req, res, this.keys, this.service.update);
@@ -1,22 +1,32 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- var GenericController_1 = require("./GenericController");
17
- var http_1 = require("./http");
18
- var search_1 = require("./search");
19
- var search_func_1 = require("./search_func");
1
+ 'use strict';
2
+ var __extends =
3
+ (this && this.__extends) ||
4
+ (function () {
5
+ var extendStatics = function (d, b) {
6
+ extendStatics =
7
+ Object.setPrototypeOf ||
8
+ ({ __proto__: [] } instanceof Array &&
9
+ function (d, b) {
10
+ d.__proto__ = b;
11
+ }) ||
12
+ function (d, b) {
13
+ for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
14
+ };
15
+ return extendStatics(d, b);
16
+ };
17
+ return function (d, b) {
18
+ extendStatics(d, b);
19
+ function __() {
20
+ this.constructor = d;
21
+ }
22
+ d.prototype = b === null ? Object.create(b) : ((__.prototype = b.prototype), new __());
23
+ };
24
+ })();
25
+ Object.defineProperty(exports, '__esModule', { value: true });
26
+ var GenericController_1 = require('./GenericController');
27
+ var http_1 = require('./http');
28
+ var search_1 = require('./search');
29
+ var search_func_1 = require('./search_func');
20
30
  var GenericSearchController = (function (_super) {
21
31
  __extends(GenericSearchController, _super);
22
32
  function GenericSearchController(log, find, service, config, build, validate, dates, numbers) {
@@ -44,10 +54,14 @@ var GenericSearchController = (function (_super) {
44
54
  var s = search_1.fromRequest(req, search_1.buildArray(this.array, this.fields, this.excluding));
45
55
  var l = search_1.getParameters(s, this.config);
46
56
  var s2 = search_1.format(s, this.dates, this.numbers);
47
- this.find(s2, l.limit, l.skipOrRefId, l.fields)
48
- .then(function (result) { return search_1.jsonResult(res, result, _this.csv, l.fields, _this.config); })
49
- .catch(function (err) { return http_1.handleError(err, res, _this.log); });
57
+ this.find(s2, l.limit, l.offsetOrNextPageToken, l.fields)
58
+ .then(function (result) {
59
+ return search_1.jsonResult(res, result, _this.csv, l.fields, _this.config);
60
+ })
61
+ .catch(function (err) {
62
+ return http_1.handleError(err, res, _this.log);
63
+ });
50
64
  };
51
65
  return GenericSearchController;
52
- }(GenericController_1.GenericController));
66
+ })(GenericController_1.GenericController);
53
67
  exports.GenericSearchController = GenericSearchController;
@@ -1,22 +1,32 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- var http_1 = require("./http");
17
- var LoadController_1 = require("./LoadController");
18
- var search_1 = require("./search");
19
- var search_func_1 = require("./search_func");
1
+ 'use strict';
2
+ var __extends =
3
+ (this && this.__extends) ||
4
+ (function () {
5
+ var extendStatics = function (d, b) {
6
+ extendStatics =
7
+ Object.setPrototypeOf ||
8
+ ({ __proto__: [] } instanceof Array &&
9
+ function (d, b) {
10
+ d.__proto__ = b;
11
+ }) ||
12
+ function (d, b) {
13
+ for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
14
+ };
15
+ return extendStatics(d, b);
16
+ };
17
+ return function (d, b) {
18
+ extendStatics(d, b);
19
+ function __() {
20
+ this.constructor = d;
21
+ }
22
+ d.prototype = b === null ? Object.create(b) : ((__.prototype = b.prototype), new __());
23
+ };
24
+ })();
25
+ Object.defineProperty(exports, '__esModule', { value: true });
26
+ var http_1 = require('./http');
27
+ var LoadController_1 = require('./LoadController');
28
+ var search_1 = require('./search');
29
+ var search_func_1 = require('./search_func');
20
30
  function useSearchController(log, find, viewService, array, dates, numbers, keys, config) {
21
31
  var c = new LoadSearchController(log, find, viewService, keys, config, dates, numbers);
22
32
  c.array = array;
@@ -35,8 +45,7 @@ var LoadSearchController = (function (_super) {
35
45
  if (config) {
36
46
  if (typeof config === 'boolean') {
37
47
  _this.csv = config;
38
- }
39
- else {
48
+ } else {
40
49
  _this.config = search_1.initializeConfig(config);
41
50
  if (_this.config) {
42
51
  _this.csv = _this.config.csv;
@@ -60,12 +69,16 @@ var LoadSearchController = (function (_super) {
60
69
  var s = search_1.fromRequest(req, search_1.buildArray(this.array, this.fields, this.excluding));
61
70
  var l = search_1.getParameters(s, this.config);
62
71
  var s2 = search_1.format(s, this.dates, this.numbers);
63
- this.find(s2, l.limit, l.skipOrRefId, l.fields)
64
- .then(function (result) { return search_1.jsonResult(res, result, _this.csv, l.fields, _this.config); })
65
- .catch(function (err) { return http_1.handleError(err, res, _this.log); });
72
+ this.find(s2, l.limit, l.offsetOrNextPageToken, l.fields)
73
+ .then(function (result) {
74
+ return search_1.jsonResult(res, result, _this.csv, l.fields, _this.config);
75
+ })
76
+ .catch(function (err) {
77
+ return http_1.handleError(err, res, _this.log);
78
+ });
66
79
  };
67
80
  return LoadSearchController;
68
- }(LoadController_1.LoadController));
81
+ })(LoadController_1.LoadController);
69
82
  exports.LoadSearchController = LoadSearchController;
70
83
  var QueryController = (function (_super) {
71
84
  __extends(QueryController, _super);
@@ -77,8 +90,7 @@ var QueryController = (function (_super) {
77
90
  if (config) {
78
91
  if (typeof config === 'boolean') {
79
92
  _this.csv = config;
80
- }
81
- else {
93
+ } else {
82
94
  _this.config = search_1.initializeConfig(config);
83
95
  if (_this.config) {
84
96
  _this.csv = _this.config.csv;
@@ -102,11 +114,16 @@ var QueryController = (function (_super) {
102
114
  var s = search_1.fromRequest(req, search_1.buildArray(this.array, this.fields, this.excluding));
103
115
  var l = search_1.getParameters(s, this.config);
104
116
  var s2 = search_1.format(s, this.dates, this.numbers);
105
- this.query.search(s2, l.limit, l.skipOrRefId, l.fields)
106
- .then(function (result) { return search_1.jsonResult(res, result, _this.csv, l.fields, _this.config); })
107
- .catch(function (err) { return http_1.handleError(err, res, _this.log); });
117
+ this.query
118
+ .search(s2, l.limit, l.offsetOrNextPageToken, l.fields)
119
+ .then(function (result) {
120
+ return search_1.jsonResult(res, result, _this.csv, l.fields, _this.config);
121
+ })
122
+ .catch(function (err) {
123
+ return http_1.handleError(err, res, _this.log);
124
+ });
108
125
  };
109
126
  return QueryController;
110
- }(LoadController_1.LoadController));
127
+ })(LoadController_1.LoadController);
111
128
  exports.QueryController = QueryController;
112
129
  exports.QueryHandler = QueryController;
@@ -1,22 +1,32 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- var GenericController_1 = require("./GenericController");
17
- var http_1 = require("./http");
18
- var search_1 = require("./search");
19
- var search_func_1 = require("./search_func");
1
+ 'use strict';
2
+ var __extends =
3
+ (this && this.__extends) ||
4
+ (function () {
5
+ var extendStatics = function (d, b) {
6
+ extendStatics =
7
+ Object.setPrototypeOf ||
8
+ ({ __proto__: [] } instanceof Array &&
9
+ function (d, b) {
10
+ d.__proto__ = b;
11
+ }) ||
12
+ function (d, b) {
13
+ for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
14
+ };
15
+ return extendStatics(d, b);
16
+ };
17
+ return function (d, b) {
18
+ extendStatics(d, b);
19
+ function __() {
20
+ this.constructor = d;
21
+ }
22
+ d.prototype = b === null ? Object.create(b) : ((__.prototype = b.prototype), new __());
23
+ };
24
+ })();
25
+ Object.defineProperty(exports, '__esModule', { value: true });
26
+ var GenericController_1 = require('./GenericController');
27
+ var http_1 = require('./http');
28
+ var search_1 = require('./search');
29
+ var search_func_1 = require('./search_func');
20
30
  var LowcodeController = (function (_super) {
21
31
  __extends(LowcodeController, _super);
22
32
  function LowcodeController(log, lowCodeService, config, build, validate, dates, numbers) {
@@ -44,12 +54,17 @@ var LowcodeController = (function (_super) {
44
54
  var s = search_1.fromRequest(req, search_1.buildArray(this.array, this.fields, this.excluding));
45
55
  var l = search_1.getParameters(s, this.config);
46
56
  var s2 = search_1.format(s, this.dates, this.numbers);
47
- this.lowCodeService.search(s2, l.limit, l.skipOrRefId, l.fields)
48
- .then(function (result) { return search_1.jsonResult(res, result, _this.csv, l.fields, _this.config); })
49
- .catch(function (err) { return http_1.handleError(err, res, _this.log); });
57
+ this.lowCodeService
58
+ .search(s2, l.limit, l.offsetOrNextPageToken, l.fields)
59
+ .then(function (result) {
60
+ return search_1.jsonResult(res, result, _this.csv, l.fields, _this.config);
61
+ })
62
+ .catch(function (err) {
63
+ return http_1.handleError(err, res, _this.log);
64
+ });
50
65
  };
51
66
  return LowcodeController;
52
- }(GenericController_1.GenericController));
67
+ })(GenericController_1.GenericController);
53
68
  exports.LowcodeController = LowcodeController;
54
69
  exports.LowcodeHandler = LowcodeController;
55
70
  var Controller = (function (_super) {
@@ -79,10 +94,15 @@ var Controller = (function (_super) {
79
94
  var s = search_1.fromRequest(req, search_1.buildArray(this.array, this.fields, this.excluding));
80
95
  var l = search_1.getParameters(s, this.config);
81
96
  var s2 = search_1.format(s, this.dates, this.numbers);
82
- this.lowCodeService.search(s2, l.limit, l.skipOrRefId, l.fields)
83
- .then(function (result) { return search_1.jsonResult(res, result, _this.csv, l.fields, _this.config); })
84
- .catch(function (err) { return http_1.handleError(err, res, _this.log); });
97
+ this.lowCodeService
98
+ .search(s2, l.limit, l.offsetOrNextPageToken, l.fields)
99
+ .then(function (result) {
100
+ return search_1.jsonResult(res, result, _this.csv, l.fields, _this.config);
101
+ })
102
+ .catch(function (err) {
103
+ return http_1.handleError(err, res, _this.log);
104
+ });
85
105
  };
86
106
  return Controller;
87
- }(GenericController_1.GenericController));
107
+ })(GenericController_1.GenericController);
88
108
  exports.Controller = Controller;
@@ -1,7 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var http_1 = require("./http");
4
- var search_1 = require("./search");
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ var http_1 = require('./http');
4
+ var search_1 = require('./search');
5
5
  var SearchController = (function () {
6
6
  function SearchController(log, find, config, dates, numbers) {
7
7
  this.log = log;
@@ -12,8 +12,7 @@ var SearchController = (function () {
12
12
  if (config) {
13
13
  if (typeof config === 'boolean') {
14
14
  this.csv = config;
15
- }
16
- else {
15
+ } else {
17
16
  this.config = search_1.initializeConfig(config);
18
17
  if (this.config) {
19
18
  this.csv = this.config.csv;
@@ -31,10 +30,14 @@ var SearchController = (function () {
31
30
  var s = search_1.fromRequest(req, search_1.buildArray(this.array, this.fields, this.excluding));
32
31
  var l = search_1.getParameters(s, this.config);
33
32
  var s2 = search_1.format(s, this.dates, this.numbers);
34
- this.find(s2, l.limit, l.skipOrRefId, l.fields)
35
- .then(function (result) { return search_1.jsonResult(res, result, _this.csv, l.fields, _this.config); })
36
- .catch(function (err) { return http_1.handleError(err, res, _this.log); });
33
+ this.find(s2, l.limit, l.offsetOrNextPageToken, l.fields)
34
+ .then(function (result) {
35
+ return search_1.jsonResult(res, result, _this.csv, l.fields, _this.config);
36
+ })
37
+ .catch(function (err) {
38
+ return http_1.handleError(err, res, _this.log);
39
+ });
37
40
  };
38
41
  return SearchController;
39
- }());
42
+ })();
40
43
  exports.SearchController = SearchController;
package/lib/client.js CHANGED
@@ -1,69 +1,90 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var http = require("http");
4
- var https = require("https");
5
- function getHealthSecure(url, timeout) {
6
- return new Promise(function (resolve) {
7
- https.get(url, { rejectUnauthorized: false }, function (res) {
8
- var data = '';
9
- res.on('data', function (d) {
10
- data += d;
11
- });
12
- res.on('end', function () {
13
- resolve({ statusCode: res.statusCode, data: data, statusMessage: res.statusMessage });
14
- });
15
- }).on('error', function (e) {
16
- return { statusCode: 500, statusMessage: e };
17
- });
18
- setTimeout(function () { return resolve({ statusCode: 408, statusMessage: 'Time out' }); }, timeout);
19
- });
20
- }
21
- function getHealth(url, timeout) {
22
- return new Promise(function (resolve) {
23
- http.get(url, function (res) {
24
- var data = '';
25
- res.on('data', function (d) {
26
- data += d;
27
- });
28
- res.on('end', function () {
29
- resolve({ statusCode: res.statusCode, data: data, statusMessage: res.statusMessage });
30
- });
31
- }).on('error', function (e) {
32
- return { statusCode: 500, statusMessage: e };
33
- });
34
- setTimeout(function () { return resolve({ statusCode: 408, statusMessage: 'Time out' }); }, timeout);
35
- });
36
- }
37
- var ClientChecker = (function () {
38
- function ClientChecker(service, url, timeout) {
39
- this.service = service;
40
- this.url = url;
41
- this.timeout = (timeout ? timeout : 4200);
42
- this.check = this.check.bind(this);
43
- this.name = this.name.bind(this);
44
- this.build = this.build.bind(this);
3
+ var http_1 = require("./http");
4
+ function checkId(obj, id, keys) {
5
+ var n = (keys && keys.length === 1 && keys[0].name ? keys[0].name : 'id');
6
+ var o = obj;
7
+ var i = id;
8
+ if (!keys || keys.length === 1) {
9
+ var v = o[n];
10
+ if (!v) {
11
+ o[n] = i;
12
+ return true;
13
+ }
14
+ if (v != i) {
15
+ return false;
16
+ }
17
+ return true;
18
+ }
19
+ var ks = Object.keys(i);
20
+ for (var _i = 0, ks_1 = ks; _i < ks_1.length; _i++) {
21
+ var k = ks_1[_i];
22
+ var v = o[k];
23
+ if (!v) {
24
+ o[k] = i[k];
25
+ }
26
+ else {
27
+ if (v != i[k]) {
28
+ return false;
29
+ }
30
+ }
31
+ o[k] = i[k];
45
32
  }
46
- ClientChecker.prototype.check = function () {
47
- var obj = {};
48
- if (this.url.startsWith('https://')) {
49
- return getHealthSecure(this.url, this.timeout).then(function (r) { return obj = r; });
33
+ return true;
34
+ }
35
+ exports.checkId = checkId;
36
+ function create(res, obj, insert, log, returnNumber) {
37
+ insert(obj).then(function (result) {
38
+ if (typeof result === 'number') {
39
+ if (result >= 1) {
40
+ res.status(201).json(returnNumber ? result : obj).end();
41
+ }
42
+ else {
43
+ res.status(409).json(result).end();
44
+ }
45
+ }
46
+ else if (Array.isArray(result)) {
47
+ res.status(422).json(result).end();
50
48
  }
51
49
  else {
52
- return getHealth(this.url, this.timeout).then(function (r) { return obj = r; });
50
+ res.status(201).json(result).end();
53
51
  }
54
- };
55
- ClientChecker.prototype.name = function () {
56
- return this.service;
57
- };
58
- ClientChecker.prototype.build = function (data, err) {
59
- if (err) {
60
- if (!data) {
61
- data = {};
52
+ }).catch(function (err) { return http_1.handleError(err, res, log); });
53
+ }
54
+ exports.create = create;
55
+ function update(res, obj, save, log, returnNumber) {
56
+ save(obj).then(function (result) {
57
+ if (typeof result === 'number') {
58
+ if (result >= 1) {
59
+ res.status(200).json(returnNumber ? result : obj).end();
60
+ }
61
+ else if (result === 0) {
62
+ res.status(404).json(result).end();
62
63
  }
63
- data['error'] = err;
64
+ else {
65
+ res.status(409).json(result).end();
66
+ }
67
+ }
68
+ else if (Array.isArray(result)) {
69
+ res.status(422).json(result).end();
70
+ }
71
+ else {
72
+ res.status(200).json(result).end();
73
+ }
74
+ }).catch(function (err) { return http_1.handleError(err, res, log); });
75
+ }
76
+ exports.update = update;
77
+ function isTypeError(errs) {
78
+ if (!errs) {
79
+ return false;
80
+ }
81
+ for (var _i = 0, errs_1 = errs; _i < errs_1.length; _i++) {
82
+ var err = errs_1[_i];
83
+ var c = err.code;
84
+ if (c === 'string' || c === 'number' || c === 'date' || c === 'boolean') {
85
+ return true;
64
86
  }
65
- return data;
66
- };
67
- return ClientChecker;
68
- }());
69
- exports.ClientChecker = ClientChecker;
87
+ }
88
+ return false;
89
+ }
90
+ exports.isTypeError = isTypeError;
package/lib/edit.js CHANGED
@@ -43,11 +43,8 @@ function create(res, obj, insert, log, returnNumber) {
43
43
  res.status(409).json(result).end();
44
44
  }
45
45
  }
46
- else if (Array.isArray(result)) {
47
- res.status(422).json(result).end();
48
- }
49
46
  else {
50
- res.status(201).json(result).end();
47
+ res.status(422).json(result).end();
51
48
  }
52
49
  }).catch(function (err) { return http_1.handleError(err, res, log); });
53
50
  }
@@ -65,11 +62,8 @@ function update(res, obj, save, log, returnNumber) {
65
62
  res.status(409).json(result).end();
66
63
  }
67
64
  }
68
- else if (Array.isArray(result)) {
69
- res.status(422).json(result).end();
70
- }
71
65
  else {
72
- res.status(200).json(result).end();
66
+ res.status(422).json(result).end();
73
67
  }
74
68
  }).catch(function (err) { return http_1.handleError(err, res, log); });
75
69
  }
package/lib/http.js CHANGED
@@ -1,5 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
3
  Object.defineProperty(Error.prototype, 'toJSON', {
4
4
  value: function () {
5
5
  var alt = {};
@@ -9,14 +9,13 @@ Object.defineProperty(Error.prototype, 'toJSON', {
9
9
  return alt;
10
10
  },
11
11
  configurable: true,
12
- writable: true
12
+ writable: true,
13
13
  });
14
14
  function handleError(err, res, log) {
15
15
  if (log) {
16
16
  log(toString(err));
17
17
  res.status(500).end('Internal Server Error');
18
- }
19
- else {
18
+ } else {
20
19
  res.status(500).end(toString(err));
21
20
  }
22
21
  }
@@ -25,8 +24,7 @@ exports.error = handleError;
25
24
  function toString(v) {
26
25
  if (typeof v === 'string') {
27
26
  return v;
28
- }
29
- else {
27
+ } else {
30
28
  return JSON.stringify(v);
31
29
  }
32
30
  }
@@ -48,8 +46,7 @@ exports.attrs = attrs;
48
46
  function respondModel(obj, res) {
49
47
  if (obj) {
50
48
  res.status(200).json(obj).end();
51
- }
52
- else {
49
+ } else {
53
50
  res.status(404).json(null).end();
54
51
  }
55
52
  }
@@ -91,14 +88,12 @@ function queryParam(req, res, name) {
91
88
  if (!v) {
92
89
  res.status(400).end("'" + name + "' cannot be empty");
93
90
  return undefined;
94
- }
95
- else {
91
+ } else {
96
92
  var v1 = v.toString();
97
93
  if (v1.length === 0) {
98
94
  res.status(400).end("'" + name + "' cannot be empty");
99
95
  return undefined;
100
- }
101
- else {
96
+ } else {
102
97
  return v1;
103
98
  }
104
99
  }
@@ -287,8 +282,7 @@ function minimize(obj) {
287
282
  var v = obj[key];
288
283
  if (v == null) {
289
284
  delete obj[key];
290
- }
291
- else if (Array.isArray(v) && v.length > 0) {
285
+ } else if (Array.isArray(v) && v.length > 0) {
292
286
  var v1 = v[0];
293
287
  if (typeof v1 === o && !(v1 instanceof Date)) {
294
288
  for (var _a = 0, v_1 = v; _a < v_1.length; _a++) {