@lingk/sync 2.2.6 → 2.2.8

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.
@@ -5413,19 +5413,39 @@ module.exports =
5413
5413
  }
5414
5414
  if (json) {
5415
5415
  var fields = [];
5416
- json.forEach(function (row) {
5417
- Object.keys(row).forEach(function (col) {
5418
- if (!fields.find(function (f) {
5419
- return f.label === col;
5420
- })) {
5421
- fields.push({
5422
- label: col,
5423
- name: col,
5424
- type: row[col] && _typeof(row[col])
5416
+ try {
5417
+ var isArray = Array.isArray(json);
5418
+ if (isArray) {
5419
+ json.forEach(function (row) {
5420
+ Object.keys(row).forEach(function (col) {
5421
+ if (!fields.find(function (f) {
5422
+ return f.label === col;
5423
+ })) {
5424
+ fields.push({
5425
+ label: col,
5426
+ name: col,
5427
+ type: row[col] && _typeof(row[col])
5428
+ });
5429
+ }
5425
5430
  });
5426
- }
5427
- });
5428
- });
5431
+ });
5432
+ } else {
5433
+ Object.keys(json).forEach(function (col) {
5434
+ if (!fields.find(function (f) {
5435
+ return f.label === col;
5436
+ })) {
5437
+ fields.push({
5438
+ label: col,
5439
+ name: col,
5440
+ type: json[col] && _typeof(json[col])
5441
+ });
5442
+ }
5443
+ });
5444
+ }
5445
+ } catch (e) {
5446
+ _this.setState({ dropError: e });
5447
+ }
5448
+
5429
5449
  var meta = {
5430
5450
  name: file.name,
5431
5451
  type: file.name.substr(0, file.name.lastIndexOf(".")).split(" ").join(""),
@@ -5641,7 +5661,6 @@ module.exports =
5641
5661
  var Spinner = inputs.Spinner;
5642
5662
  var Modal = inputs.Modal;
5643
5663
  var hasFile = meta && meta.length > 0;
5644
-
5645
5664
  var fileSchema = [];
5646
5665
  var fileSchemaNames = [];
5647
5666
  this.props.fileSchema && this.props.fileSchema.forEach(function (f) {
@@ -7359,7 +7378,7 @@ module.exports =
7359
7378
  _react2.default.createElement(
7360
7379
  "div",
7361
7380
  { style: { fontSize: 16 } },
7362
- "1.Generate Websocket Certificates"
7381
+ "Generate Websocket Certificates"
7363
7382
  ),
7364
7383
  _react2.default.createElement(
7365
7384
  "div",