holosphere 1.1.17 → 1.1.18
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/content.js +41 -2
- package/holosphere-bundle.esm.js +48 -7
- package/holosphere-bundle.js +48 -7
- package/holosphere-bundle.min.js +14 -14
- package/holosphere.js +25 -3
- package/package.json +1 -1
package/holosphere.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module holosphere
|
|
3
|
-
* @version 1.1.
|
|
3
|
+
* @version 1.1.18
|
|
4
4
|
* @description Holonic Geospatial Communication Infrastructure
|
|
5
5
|
* @author Roberto Valenti
|
|
6
6
|
* @license GPL-3.0-or-later
|
|
@@ -20,7 +20,7 @@ import * as ComputeOps from './compute.js';
|
|
|
20
20
|
import * as Utils from './utils.js';
|
|
21
21
|
|
|
22
22
|
// Define the version constant
|
|
23
|
-
const HOLOSPHERE_VERSION = '1.1.
|
|
23
|
+
const HOLOSPHERE_VERSION = '1.1.18';
|
|
24
24
|
|
|
25
25
|
class HoloSphere {
|
|
26
26
|
/**
|
|
@@ -44,7 +44,8 @@ class HoloSphere {
|
|
|
44
44
|
// Define default Gun options
|
|
45
45
|
const defaultGunOptions = {
|
|
46
46
|
peers: ['https://gun.holons.io/gun','https://59.src.eco/gun'],
|
|
47
|
-
axe: false
|
|
47
|
+
axe: false,
|
|
48
|
+
localStorage: false
|
|
48
49
|
// Add other potential defaults here if needed
|
|
49
50
|
};
|
|
50
51
|
|
|
@@ -165,6 +166,27 @@ class HoloSphere {
|
|
|
165
166
|
return ContentOps.parse(this, rawData);
|
|
166
167
|
}
|
|
167
168
|
|
|
169
|
+
/**
|
|
170
|
+
* Filters an array of data, removing raw GunDB nodes and invalid entries.
|
|
171
|
+
* @param {Array} dataArray - Array of data that might contain raw GunDB nodes
|
|
172
|
+
* @returns {Promise<Array>} - Filtered array with only valid data
|
|
173
|
+
*/
|
|
174
|
+
async filterValidData(dataArray) {
|
|
175
|
+
if (!Array.isArray(dataArray)) {
|
|
176
|
+
return [];
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const validData = [];
|
|
180
|
+
for (const item of dataArray) {
|
|
181
|
+
const parsed = await this.parse(item);
|
|
182
|
+
if (parsed !== null) {
|
|
183
|
+
validData.push(parsed);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return validData;
|
|
188
|
+
}
|
|
189
|
+
|
|
168
190
|
/**
|
|
169
191
|
* Deletes a specific key from a given holon and lens.
|
|
170
192
|
* @param {string} holon - The holon identifier.
|