@corpsmap/corpsmap 3.2.44 → 3.2.45

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/lib/dev.js CHANGED
@@ -153,6 +153,9 @@ function _possibleConstructorReturn(t, e) {
153
153
  if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
154
154
  return _assertThisInitialized(t);
155
155
  }
156
+ function _readOnlyError(r) {
157
+ throw new TypeError('"' + r + '" is read-only');
158
+ }
156
159
  function _setPrototypeOf(t, e) {
157
160
  return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
158
161
  return t.__proto__ = e, t;
@@ -106655,7 +106658,7 @@ var config = {
106655
106658
  };
106656
106659
 
106657
106660
  var name = "@corpsmap/corpsmap";
106658
- var version$1 = "3.2.44";
106661
+ var version$1 = "3.2.45";
106659
106662
  var description = "CorpsMap as React Components";
106660
106663
  var main = "index.js";
106661
106664
  var scripts = {
@@ -135858,6 +135861,9 @@ var formatArcgisrest = function formatArcgisrest(attributes) {
135858
135861
  key = _Object$entries$_i[0],
135859
135862
  value = _Object$entries$_i[1];
135860
135863
  var result = String(value).includes("https:") || String(value).includes("http:") ? value : null;
135864
+ if (String(value).includes("<a href")) {
135865
+ _readOnlyError("result");
135866
+ }
135861
135867
  if (result) {
135862
135868
  attributes[key] = "<a href=\"".concat(value, "\" target=\"_new\" > ").concat(value, " </a>");
135863
135869
  }
@@ -135871,17 +135877,12 @@ var formatArcgisVector = function formatArcgisVector(results) {
135871
135877
  key = _Object$entries2$_i[0],
135872
135878
  value = _Object$entries2$_i[1];
135873
135879
  var result = String(value).includes("https:") || String(value).includes("http:") ? value : null;
135880
+ if (String(value).includes("<a href")) {
135881
+ result = null;
135882
+ }
135874
135883
  if (result) {
135875
135884
  feat.properties[key] = "<a href=\"".concat(value, "\" target=\"_new\" > ").concat(value, " </a>");
135876
135885
  }
135877
- // Format UNIX Date
135878
-
135879
- // if ((key === "fromdate" || key === "todate" || key === "referencedate") && Number.isInteger(feat.properties[key])) {
135880
- // const unixTimestamp = feat.properties[key];
135881
- // const milliseconds = unixTimestamp // * 1000 in some cases.
135882
- // const dateObject = new Date(milliseconds);
135883
- // feat.properties[key] = dateObject.toLocaleString();
135884
- // }
135885
135886
  }
135886
135887
  });
135887
135888
  return results;
@@ -135987,6 +135988,11 @@ var formatColumns = function formatColumns(value, formatType) {
135987
135988
  var dateObject = new Date(milliseconds);
135988
135989
  value = dateObject.toLocaleString();
135989
135990
  }
135991
+ if (formatType === "ICEJAM") {
135992
+ var url = "https://icejam.sec.usace.army.mil/ords/f?p=1001:2:::::IR_INDEX_NUMBER:".concat(value);
135993
+ var result = "<span><a href=\"".concat(url, "\" target=\"_blank\"> ").concat(value, " </a></span>");
135994
+ return result;
135995
+ }
135990
135996
  return value;
135991
135997
  };
135992
135998
 
package/lib/prod.js CHANGED
@@ -153,6 +153,9 @@ function _possibleConstructorReturn(t, e) {
153
153
  if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
154
154
  return _assertThisInitialized(t);
155
155
  }
156
+ function _readOnlyError(r) {
157
+ throw new TypeError('"' + r + '" is read-only');
158
+ }
156
159
  function _setPrototypeOf(t, e) {
157
160
  return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
158
161
  return t.__proto__ = e, t;
@@ -106569,7 +106572,7 @@ var config = {
106569
106572
  };
106570
106573
 
106571
106574
  var name = "@corpsmap/corpsmap";
106572
- var version$1 = "3.2.44";
106575
+ var version$1 = "3.2.45";
106573
106576
  var description = "CorpsMap as React Components";
106574
106577
  var main = "index.js";
106575
106578
  var scripts = {
@@ -135772,6 +135775,9 @@ var formatArcgisrest = function formatArcgisrest(attributes) {
135772
135775
  key = _Object$entries$_i[0],
135773
135776
  value = _Object$entries$_i[1];
135774
135777
  var result = String(value).includes("https:") || String(value).includes("http:") ? value : null;
135778
+ if (String(value).includes("<a href")) {
135779
+ _readOnlyError("result");
135780
+ }
135775
135781
  if (result) {
135776
135782
  attributes[key] = "<a href=\"".concat(value, "\" target=\"_new\" > ").concat(value, " </a>");
135777
135783
  }
@@ -135785,17 +135791,12 @@ var formatArcgisVector = function formatArcgisVector(results) {
135785
135791
  key = _Object$entries2$_i[0],
135786
135792
  value = _Object$entries2$_i[1];
135787
135793
  var result = String(value).includes("https:") || String(value).includes("http:") ? value : null;
135794
+ if (String(value).includes("<a href")) {
135795
+ result = null;
135796
+ }
135788
135797
  if (result) {
135789
135798
  feat.properties[key] = "<a href=\"".concat(value, "\" target=\"_new\" > ").concat(value, " </a>");
135790
135799
  }
135791
- // Format UNIX Date
135792
-
135793
- // if ((key === "fromdate" || key === "todate" || key === "referencedate") && Number.isInteger(feat.properties[key])) {
135794
- // const unixTimestamp = feat.properties[key];
135795
- // const milliseconds = unixTimestamp // * 1000 in some cases.
135796
- // const dateObject = new Date(milliseconds);
135797
- // feat.properties[key] = dateObject.toLocaleString();
135798
- // }
135799
135800
  }
135800
135801
  });
135801
135802
  return results;
@@ -135901,6 +135902,11 @@ var formatColumns = function formatColumns(value, formatType) {
135901
135902
  var dateObject = new Date(milliseconds);
135902
135903
  value = dateObject.toLocaleString();
135903
135904
  }
135905
+ if (formatType === "ICEJAM") {
135906
+ var url = "https://icejam.sec.usace.army.mil/ords/f?p=1001:2:::::IR_INDEX_NUMBER:".concat(value);
135907
+ var result = "<span><a href=\"".concat(url, "\" target=\"_blank\"> ").concat(value, " </a></span>");
135908
+ return result;
135909
+ }
135904
135910
  return value;
135905
135911
  };
135906
135912
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corpsmap/corpsmap",
3
- "version": "3.2.44",
3
+ "version": "3.2.45",
4
4
  "description": "CorpsMap as React Components",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -5,9 +5,13 @@ const formatArcgisrest = function (attributes) {
5
5
  ? value
6
6
  : null;
7
7
 
8
- if (result) {
9
- attributes[key] = `<a href="${value}" target="_new" > ${value} </a>`;
10
- }
8
+ if(String(value).includes("<a href")) {
9
+ result = null;
10
+ }
11
+
12
+ if (result) {
13
+ attributes[key] = `<a href="${value}" target="_new" > ${value} </a>`;
14
+ }
11
15
  }
12
16
  return attributes;
13
17
  };
@@ -15,24 +19,20 @@ const formatArcgisrest = function (attributes) {
15
19
  const formatArcgisVector = function (results) {
16
20
  results.map((feat) => {
17
21
  for (const [key, value] of Object.entries(feat.properties)) {
18
- const result =
22
+ let result =
19
23
  String(value).includes("https:") || String(value).includes("http:")
20
24
  ? value
21
25
  : null;
22
26
 
27
+ if(String(value).includes("<a href")) {
28
+ result = null;
29
+ }
30
+
23
31
  if (result) {
24
32
  feat.properties[
25
33
  key
26
34
  ] = `<a href="${value}" target="_new" > ${value} </a>`;
27
35
  }
28
- // Format UNIX Date
29
-
30
- // if ((key === "fromdate" || key === "todate" || key === "referencedate") && Number.isInteger(feat.properties[key])) {
31
- // const unixTimestamp = feat.properties[key];
32
- // const milliseconds = unixTimestamp // * 1000 in some cases.
33
- // const dateObject = new Date(milliseconds);
34
- // feat.properties[key] = dateObject.toLocaleString();
35
- // }
36
36
 
37
37
  }
38
38
  });
@@ -136,6 +136,12 @@ const formatColumns = function (value, formatType) {
136
136
  const dateObject = new Date(milliseconds);
137
137
  value = dateObject.toLocaleString();
138
138
  }
139
+ if (formatType === "ICEJAM") {
140
+ let url = `https://icejam.sec.usace.army.mil/ords/f?p=1001:2:::::IR_INDEX_NUMBER:${value}`;
141
+ let result = `<span><a href="${url}" target="_blank"> ${value} </a></span>`;
142
+ return result;
143
+ }
144
+
139
145
  return value;
140
146
  };
141
147