flamerest 1.0.63 → 1.0.64
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/REST.js +15 -1
- package/package.json +1 -1
package/REST.js
CHANGED
|
@@ -528,7 +528,8 @@ class FLAMEREST {
|
|
|
528
528
|
for (let file in value) {
|
|
529
529
|
newValues.push({
|
|
530
530
|
'name': value[file].name,
|
|
531
|
-
'data': await this.readFileAsync(value[file])
|
|
531
|
+
'data': await this.readFileAsync(value[file]),
|
|
532
|
+
'id': this.generateID(32)
|
|
532
533
|
});
|
|
533
534
|
}
|
|
534
535
|
if (isRef)
|
|
@@ -583,6 +584,19 @@ class FLAMEREST {
|
|
|
583
584
|
return object;
|
|
584
585
|
}
|
|
585
586
|
|
|
587
|
+
generateID(length) {
|
|
588
|
+
let result = '';
|
|
589
|
+
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
590
|
+
const charactersLength = characters.length;
|
|
591
|
+
let counter = 0;
|
|
592
|
+
while (counter < length) {
|
|
593
|
+
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
594
|
+
counter += 1;
|
|
595
|
+
}
|
|
596
|
+
return result;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
|
|
586
600
|
}
|
|
587
601
|
|
|
588
602
|
|