@startinblox/boilerplate 6.0.6 → 6.0.7

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/index.js CHANGED
@@ -745,10 +745,10 @@ class _ extends lt {
745
745
  l !== void 0 && (o[a.value] = l);
746
746
  return await this._responseAdaptator(o);
747
747
  }
748
- async _hasCherryPickedProperties(t) {
749
- const e = await t.properties;
750
- for (const i of this.cherryPickedProperties)
751
- if (e?.includes(i.key))
748
+ async _hasCherryPickedProperties(t, e = this.cherryPickedProperties) {
749
+ const i = await t.properties;
750
+ for (const r of e)
751
+ if (i?.includes(r.key))
752
752
  return !0;
753
753
  return !1;
754
754
  }
@@ -759,7 +759,7 @@ class _ extends lt {
759
759
  if (typeof t == "string" ? r = await window.sibStore.getData(t, wt) : t.isFullResource && !t.isFullResource?.() && (r = await window.sibStore.getData(t["@id"], wt)), !r) return { _originalResource: r };
760
760
  if (typeof r != "object" || r === null) return;
761
761
  if (r.isContainer?.() && r["ldp:contains"]) {
762
- if (await this._hasCherryPickedProperties(r))
762
+ if (await this._hasCherryPickedProperties(r, i))
763
763
  return await this._getProperties(r, e, i);
764
764
  const o = this._normalizeLdpContains(await r["ldp:contains"]);
765
765
  return await this._expandContainer(o, e, i);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startinblox/boilerplate",
3
- "version": "6.0.6",
3
+ "version": "6.0.7",
4
4
  "description": "Startin'blox Boilerplate",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -215,10 +215,13 @@ export default class extends ComponentObjectsHandler {
215
215
  return await this._responseAdaptator(response);
216
216
  }
217
217
 
218
- async _hasCherryPickedProperties(resource: Resource) {
218
+ async _hasCherryPickedProperties(
219
+ resource: Resource,
220
+ targetProperties = this.cherryPickedProperties,
221
+ ) {
219
222
  const properties = await resource.properties;
220
223
 
221
- for (const prop of this.cherryPickedProperties) {
224
+ for (const prop of targetProperties) {
222
225
  if (properties?.includes(prop.key)) {
223
226
  return true;
224
227
  }
@@ -251,7 +254,7 @@ export default class extends ComponentObjectsHandler {
251
254
  if (typeof target !== "object" || target === null) return;
252
255
 
253
256
  if (target.isContainer?.() && target["ldp:contains"]) {
254
- if (await this._hasCherryPickedProperties(target)) {
257
+ if (await this._hasCherryPickedProperties(target, targetProperties)) {
255
258
  return await this._getProperties(target, recursive, targetProperties);
256
259
  }
257
260