puvox-library 1.0.31 → 1.0.32
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/library_standard.js +14 -11
- package/package.json +1 -1
package/library_standard.js
CHANGED
@@ -934,8 +934,12 @@ const puvox_library =
|
|
934
934
|
msGoneAfter(date){
|
935
935
|
return (new Date()-date);
|
936
936
|
},
|
937
|
-
getYMDHISFfromDate(dt){
|
938
|
-
|
937
|
+
getYMDHISFfromDate(dt, utc=true){
|
938
|
+
if (utc) {
|
939
|
+
return [dt.getUTCFullYear(), dt.getUTCMonth()+1, dt.getUTCDate(), dt.getUTCHours(), dt.getUTCMinutes(), dt.getUTCSeconds(), dt.getUTCMilliseconds()];
|
940
|
+
} else {
|
941
|
+
return [1900 + dt.getYear(), dt.getMonth()+1, dt.getDate(), dt.getHours(), dt.getMinutes(), dt.getSeconds(), dt.getMilliseconds()];
|
942
|
+
}
|
939
943
|
},
|
940
944
|
prefixWithZero(num, digits){
|
941
945
|
return (digits===1 ? num : (digits===2 ? (num < 10 ? "0"+num : num ) : (digits===3 ? (num < 10 ? "00"+num : (num < 100 ? "0"+num : num ) ) : num ) ) ).toString();
|
@@ -2754,15 +2758,14 @@ const puvox_library =
|
|
2754
2758
|
// if(setHashInAddress) { window.location.hash = id_or_Name; }
|
2755
2759
|
|
2756
2760
|
|
2757
|
-
async downloadFile(url, path){
|
2758
|
-
|
2759
|
-
|
2760
|
-
|
2761
|
-
|
2762
|
-
|
2763
|
-
|
2764
|
-
|
2765
|
-
},
|
2761
|
+
// async downloadFile(url, path){
|
2762
|
+
// const { Readable } = require('stream');
|
2763
|
+
// const { finished } = require('stream/promises');
|
2764
|
+
// const response = await fetch(url);
|
2765
|
+
// const body = Readable.fromWeb(response.body);
|
2766
|
+
// const download_write_stream = this.file.fs().createWriteStream(filepath);
|
2767
|
+
// await finished(body.pipe(download_write_stream));
|
2768
|
+
// },
|
2766
2769
|
|
2767
2770
|
unTrailingSlash(str){
|
2768
2771
|
while (str.endsWith('/') || str.endsWith('\\')) {
|