@bigfootai/bigfoot-types 5.0.16 → 5.0.17

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.
Files changed (3) hide show
  1. package/model.js +10 -7
  2. package/model.ts +9 -7
  3. package/package.json +1 -1
package/model.js CHANGED
@@ -464,16 +464,19 @@ class SharedPrimitive extends Primitive {
464
464
  this._sharingTagIds = [];
465
465
  this._tagIds = [];
466
466
  // Add sharing tags to the internal array
467
+ // Add sharing tags to the internal array
467
468
  if (sharingTags && sharingTags.length > 0) {
468
- for (const sharingTag of sharingTags) {
469
- if (sharingTag.shared == true) {
470
- this._sharingTagIds.push(sharingTag.tagId);
471
- }
472
- }
473
- }
474
- if (sharingTags && sharingTags.length > 0) {
469
+ this._sharingTagIds = sharingTags
470
+ .filter((sharingTag) => {
471
+ return sharingTag.shared == true;
472
+ })
473
+ .map((sharingTag) => sharingTag.tagId);
475
474
  this._tagIds = sharingTags.map((sharingTag) => sharingTag.tagId);
476
475
  }
476
+ else {
477
+ this._tagIds = [];
478
+ this._sharingTagIds = [];
479
+ }
477
480
  }
478
481
  }
479
482
  exports.SharedPrimitive = SharedPrimitive;
package/model.ts CHANGED
@@ -662,16 +662,18 @@ export class SharedPrimitive extends Primitive {
662
662
  this._sharingTagIds = [];
663
663
  this._tagIds = [];
664
664
 
665
+ // Add sharing tags to the internal array
665
666
  // Add sharing tags to the internal array
666
667
  if (sharingTags && sharingTags.length > 0) {
667
- for (const sharingTag of sharingTags) {
668
- if (sharingTag.shared == true) {
669
- this._sharingTagIds.push(sharingTag.tagId);
670
- }
671
- }
672
- }
673
- if (sharingTags && sharingTags.length > 0) {
668
+ this._sharingTagIds = sharingTags
669
+ .filter((sharingTag) => {
670
+ return sharingTag.shared == true;
671
+ })
672
+ .map((sharingTag) => sharingTag.tagId);
674
673
  this._tagIds = sharingTags.map((sharingTag) => sharingTag.tagId);
674
+ } else {
675
+ this._tagIds = [];
676
+ this._sharingTagIds = [];
675
677
  }
676
678
  }
677
679
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Bigfoot",
3
3
  "name": "@bigfootai/bigfoot-types",
4
- "version": "5.0.16",
4
+ "version": "5.0.17",
5
5
  "description": "The internal library for the types used in the Bigfoot platform",
6
6
  "main": "model.js",
7
7
  "license": "ISC",