flamerest 1.0.62 → 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.d.ts +1 -1
- package/REST.js +16 -1
- package/package.json +1 -1
package/REST.d.ts
CHANGED
|
@@ -149,4 +149,4 @@ export function prepare(values: any): Promise<any>;
|
|
|
149
149
|
* @param object Заполняемый объект
|
|
150
150
|
* @param values Аналогичный объект-источник данных
|
|
151
151
|
*/
|
|
152
|
-
export function fillObject(object:
|
|
152
|
+
export function fillObject<T>(object: T, values: any): T;
|
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)
|
|
@@ -580,8 +581,22 @@ class FLAMEREST {
|
|
|
580
581
|
object[prop] = values[prop];
|
|
581
582
|
|
|
582
583
|
}
|
|
584
|
+
return object;
|
|
583
585
|
}
|
|
584
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
|
+
|
|
585
600
|
}
|
|
586
601
|
|
|
587
602
|
|