s3db.js 3.1.0 → 3.2.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/dist/s3db.iife.js CHANGED
@@ -1358,7 +1358,7 @@ ${JSON.stringify(validation, null, 2)}`
1358
1358
  this.reversedMap = lodashEs.invert(map);
1359
1359
  } else {
1360
1360
  const flatAttrs = flat.flatten(this.attributes, { safe: true });
1361
- this.reversedMap = { ...Object.keys(flatAttrs).filter((k) => !k.includes("$$type")) };
1361
+ this.reversedMap = { ...Object.keys(flatAttrs).filter((k) => !k.includes("$$")) };
1362
1362
  this.map = lodashEs.invert(this.reversedMap);
1363
1363
  }
1364
1364
  }
@@ -1671,6 +1671,16 @@ ${JSON.stringify(validation, null, 2)}`
1671
1671
  this.emit("get", data);
1672
1672
  return data;
1673
1673
  }
1674
+ async exists(id) {
1675
+ try {
1676
+ await this.client.headObject(
1677
+ join(`resource=${this.name}`, `id=${id}`)
1678
+ );
1679
+ return true;
1680
+ } catch (error) {
1681
+ return false;
1682
+ }
1683
+ }
1674
1684
  async update(id, attributes) {
1675
1685
  const live = await this.get(id);
1676
1686
  const attrs = lodashEs.merge(live, attributes);