bireader 3.1.4 → 3.1.5
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/README.md +18 -5
- package/dist/aliases/BinaryAliasWriter.d.ts +73 -73
- package/dist/core/BiBase.d.ts +8 -0
- package/dist/core/BiBaseStream.d.ts +20 -0
- package/dist/index.browser.d.ts +61 -37
- package/dist/index.browser.js +49 -19
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs.d.ts +100 -72
- package/dist/index.cjs.js +58 -18
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +100 -72
- package/dist/index.esm.d.ts +100 -72
- package/dist/index.esm.js +58 -18
- package/dist/index.esm.js.map +1 -1
- package/dist/indexBrowser.d.ts +16 -0
- package/package.json +10 -8
package/dist/index.esm.js
CHANGED
|
@@ -1813,6 +1813,16 @@ class BiBase {
|
|
|
1813
1813
|
this.insert(data, consume, start);
|
|
1814
1814
|
return data.length;
|
|
1815
1815
|
}
|
|
1816
|
+
/**
|
|
1817
|
+
* Dummy function, not needed on Non-Stream
|
|
1818
|
+
*/
|
|
1819
|
+
renameFile() {
|
|
1820
|
+
}
|
|
1821
|
+
/**
|
|
1822
|
+
* Dummy function, not needed on Non-Stream
|
|
1823
|
+
*/
|
|
1824
|
+
deleteFile() {
|
|
1825
|
+
}
|
|
1816
1826
|
/**
|
|
1817
1827
|
* Dummy function, not needed on Non-Stream
|
|
1818
1828
|
*/
|
|
@@ -10059,7 +10069,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10059
10069
|
/**
|
|
10060
10070
|
* Write 64 bit integer.
|
|
10061
10071
|
*
|
|
10062
|
-
* @param {
|
|
10072
|
+
* @param {BigValue} value - value as int
|
|
10063
10073
|
*/
|
|
10064
10074
|
set int64(value) {
|
|
10065
10075
|
this.writeInt64(value);
|
|
@@ -10067,7 +10077,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10067
10077
|
/**
|
|
10068
10078
|
* Write 64 bit integer.
|
|
10069
10079
|
*
|
|
10070
|
-
* @param {
|
|
10080
|
+
* @param {BigValue} value - value as int
|
|
10071
10081
|
*/
|
|
10072
10082
|
set quad(value) {
|
|
10073
10083
|
this.writeInt64(value);
|
|
@@ -10075,7 +10085,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10075
10085
|
/**
|
|
10076
10086
|
* Write 64 bit integer.
|
|
10077
10087
|
*
|
|
10078
|
-
* @param {
|
|
10088
|
+
* @param {BigValue} value - value as int
|
|
10079
10089
|
*/
|
|
10080
10090
|
set bigint(value) {
|
|
10081
10091
|
this.writeInt64(value);
|
|
@@ -10083,7 +10093,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10083
10093
|
/**
|
|
10084
10094
|
* Write unsigned 64 bit integer.
|
|
10085
10095
|
*
|
|
10086
|
-
* @param {
|
|
10096
|
+
* @param {BigValue} value - value as int
|
|
10087
10097
|
*/
|
|
10088
10098
|
set uint64(value) {
|
|
10089
10099
|
this.writeInt64(value, true);
|
|
@@ -10091,7 +10101,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10091
10101
|
/**
|
|
10092
10102
|
* Write unsigned 64 bit integer.
|
|
10093
10103
|
*
|
|
10094
|
-
* @param {
|
|
10104
|
+
* @param {BigValue} value - value as int
|
|
10095
10105
|
*/
|
|
10096
10106
|
set ubigint(value) {
|
|
10097
10107
|
this.writeInt64(value, true);
|
|
@@ -10099,7 +10109,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10099
10109
|
/**
|
|
10100
10110
|
* Write unsigned 64 bit integer.
|
|
10101
10111
|
*
|
|
10102
|
-
* @param {
|
|
10112
|
+
* @param {BigValue} value - value as int
|
|
10103
10113
|
*/
|
|
10104
10114
|
set uquad(value) {
|
|
10105
10115
|
this.writeInt64(value, true);
|
|
@@ -10107,7 +10117,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10107
10117
|
/**
|
|
10108
10118
|
* Write signed 64 bit integer.
|
|
10109
10119
|
*
|
|
10110
|
-
* @param {
|
|
10120
|
+
* @param {BigValue} value - value as int
|
|
10111
10121
|
*/
|
|
10112
10122
|
set int64le(value) {
|
|
10113
10123
|
this.writeInt64(value, false, "little");
|
|
@@ -10115,7 +10125,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10115
10125
|
/**
|
|
10116
10126
|
* Write signed 64 bit integer.
|
|
10117
10127
|
*
|
|
10118
|
-
* @param {
|
|
10128
|
+
* @param {BigValue} value - value as int
|
|
10119
10129
|
*/
|
|
10120
10130
|
set bigintle(value) {
|
|
10121
10131
|
this.writeInt64(value, false, "little");
|
|
@@ -10123,7 +10133,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10123
10133
|
/**
|
|
10124
10134
|
* Write signed 64 bit integer.
|
|
10125
10135
|
*
|
|
10126
|
-
* @param {
|
|
10136
|
+
* @param {BigValue} value - value as int
|
|
10127
10137
|
*/
|
|
10128
10138
|
set quadle(value) {
|
|
10129
10139
|
this.writeInt64(value, false, "little");
|
|
@@ -10131,7 +10141,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10131
10141
|
/**
|
|
10132
10142
|
* Write unsigned 64 bit integer.
|
|
10133
10143
|
*
|
|
10134
|
-
* @param {
|
|
10144
|
+
* @param {BigValue} value - value as int
|
|
10135
10145
|
*/
|
|
10136
10146
|
set uint64le(value) {
|
|
10137
10147
|
this.writeInt64(value, true, "little");
|
|
@@ -10139,7 +10149,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10139
10149
|
/**
|
|
10140
10150
|
* Write unsigned 64 bit integer.
|
|
10141
10151
|
*
|
|
10142
|
-
* @param {
|
|
10152
|
+
* @param {BigValue} value - value as int
|
|
10143
10153
|
*/
|
|
10144
10154
|
set ubigintle(value) {
|
|
10145
10155
|
this.writeInt64(value, true, "little");
|
|
@@ -10147,7 +10157,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10147
10157
|
/**
|
|
10148
10158
|
* Write unsigned 64 bit integer.
|
|
10149
10159
|
*
|
|
10150
|
-
* @param {
|
|
10160
|
+
* @param {BigValue} value - value as int
|
|
10151
10161
|
*/
|
|
10152
10162
|
set uquadle(value) {
|
|
10153
10163
|
this.writeInt64(value, true, "little");
|
|
@@ -10155,7 +10165,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10155
10165
|
/**
|
|
10156
10166
|
* Write signed 64 bit integer.
|
|
10157
10167
|
*
|
|
10158
|
-
* @param {
|
|
10168
|
+
* @param {BigValue} value - value as int
|
|
10159
10169
|
*/
|
|
10160
10170
|
set int64be(value) {
|
|
10161
10171
|
this.writeInt64(value, false, "big");
|
|
@@ -10163,7 +10173,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10163
10173
|
/**
|
|
10164
10174
|
* Write signed 64 bit integer.
|
|
10165
10175
|
*
|
|
10166
|
-
* @param {
|
|
10176
|
+
* @param {BigValue} value - value as int
|
|
10167
10177
|
*/
|
|
10168
10178
|
set bigintbe(value) {
|
|
10169
10179
|
this.writeInt64(value, false, "big");
|
|
@@ -10171,7 +10181,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10171
10181
|
/**
|
|
10172
10182
|
* Write signed 64 bit integer.
|
|
10173
10183
|
*
|
|
10174
|
-
* @param {
|
|
10184
|
+
* @param {BigValue} value - value as int
|
|
10175
10185
|
*/
|
|
10176
10186
|
set quadbe(value) {
|
|
10177
10187
|
this.writeInt64(value, false, "big");
|
|
@@ -10179,7 +10189,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10179
10189
|
/**
|
|
10180
10190
|
* Write unsigned 64 bit integer.
|
|
10181
10191
|
*
|
|
10182
|
-
* @param {
|
|
10192
|
+
* @param {BigValue} value - value as int
|
|
10183
10193
|
*/
|
|
10184
10194
|
set uint64be(value) {
|
|
10185
10195
|
this.writeInt64(value, true, "big");
|
|
@@ -10187,7 +10197,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10187
10197
|
/**
|
|
10188
10198
|
* Write unsigned 64 bit integer.
|
|
10189
10199
|
*
|
|
10190
|
-
* @param {
|
|
10200
|
+
* @param {BigValue} value - value as int
|
|
10191
10201
|
*/
|
|
10192
10202
|
set ubigintbe(value) {
|
|
10193
10203
|
this.writeInt64(value, true, "big");
|
|
@@ -10195,7 +10205,7 @@ function applyBinaryAliasWriter(Base) {
|
|
|
10195
10205
|
/**
|
|
10196
10206
|
* Write unsigned 64 bit integer.
|
|
10197
10207
|
*
|
|
10198
|
-
* @param {
|
|
10208
|
+
* @param {BigValue} value - value as int
|
|
10199
10209
|
*/
|
|
10200
10210
|
set uquadbe(value) {
|
|
10201
10211
|
this.writeInt64(value, true, "big");
|
|
@@ -13582,6 +13592,36 @@ class BiBaseStreamer {
|
|
|
13582
13592
|
}
|
|
13583
13593
|
return this.write(this.offset, this.data, consume);
|
|
13584
13594
|
}
|
|
13595
|
+
/**
|
|
13596
|
+
* Renames the file you are working on.
|
|
13597
|
+
*
|
|
13598
|
+
* Must be full file path and file name.
|
|
13599
|
+
*
|
|
13600
|
+
* Keeps write / read position.
|
|
13601
|
+
*
|
|
13602
|
+
* Note: This is permanent and can't be undone.
|
|
13603
|
+
*
|
|
13604
|
+
* @param {string} newFilePath - New full file path and name.
|
|
13605
|
+
*/
|
|
13606
|
+
renameFile(newFilePath) {
|
|
13607
|
+
fs.closeSync(this.fd);
|
|
13608
|
+
this.fd = null;
|
|
13609
|
+
fs.renameSync(this.filePath, newFilePath);
|
|
13610
|
+
this.filePath = newFilePath;
|
|
13611
|
+
this.open();
|
|
13612
|
+
}
|
|
13613
|
+
/**
|
|
13614
|
+
* Deletes the working file.
|
|
13615
|
+
*
|
|
13616
|
+
* Note: This is permanentand can't be undone.
|
|
13617
|
+
*
|
|
13618
|
+
* It doesn't send the file to the recycling bin for recovery.
|
|
13619
|
+
*/
|
|
13620
|
+
deleteFile() {
|
|
13621
|
+
fs.closeSync(this.fd);
|
|
13622
|
+
this.fd = null;
|
|
13623
|
+
fs.unlinkSync(this.filePath);
|
|
13624
|
+
}
|
|
13585
13625
|
/**
|
|
13586
13626
|
* internal extend
|
|
13587
13627
|
*
|