@jd-data-limited/easy-fm 3.0.9 → 3.0.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jd-data-limited/easy-fm",
3
- "version": "3.0.9",
3
+ "version": "3.0.10",
4
4
  "dependencies": {
5
5
  "@types/btoa": "^1.2.3",
6
6
  "@types/events": "^3.0.0",
package/src/index.js CHANGED
@@ -1663,7 +1663,10 @@ export class Field {
1663
1663
  && !(content instanceof Date) && !!content) {
1664
1664
  throw "Value was not an instance of Date: " + content;
1665
1665
  }
1666
- this._value = content;
1666
+ if (!content)
1667
+ this._value = "";
1668
+ else
1669
+ this._value = content;
1667
1670
  this.edited = true;
1668
1671
  }
1669
1672
  get metadata() {
package/src/index.ts CHANGED
@@ -1856,7 +1856,7 @@ export class Field {
1856
1856
  this.edited = false
1857
1857
  }
1858
1858
 
1859
- set(content: string | number | Date) {
1859
+ set(content: string | number | Date | undefined | null) {
1860
1860
  if (this.metadata.result === "container") throw "Cannot set container value using set(). Use upload() instead."
1861
1861
  if (
1862
1862
  (this.metadata.result === "timeStamp" ||
@@ -1866,7 +1866,8 @@ export class Field {
1866
1866
  ) {
1867
1867
  throw "Value was not an instance of Date: " + content
1868
1868
  }
1869
- this._value = content
1869
+ if (!content) this._value = ""
1870
+ else this._value = content
1870
1871
  this.edited = true
1871
1872
  }
1872
1873