@k3000/store 0.5.0 → 0.6.0

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/generator.mjs CHANGED
@@ -236,6 +236,13 @@ export const Uint = size => new class Uint extends Type {
236
236
  return super.step(SCOPE, step > 0 ? step : 1);
237
237
  }
238
238
 
239
+ length(length) {
240
+
241
+ length = Number.parseInt(length) || TypeLen.int
242
+
243
+ return super.length(SCOPE, length > 0 && length < TypeLen.int ? length : TypeLen.int);
244
+ }
245
+
239
246
  }()
240
247
 
241
248
  /**
@@ -287,6 +294,13 @@ export const Int = size => new class Int extends Type {
287
294
  return super.step(SCOPE, step === 0 ? 1 : step);
288
295
  }
289
296
 
297
+ length(length) {
298
+
299
+ length = Number.parseInt(length) || TypeLen.int
300
+
301
+ return super.length(SCOPE, length > 0 && length < TypeLen.int ? length : TypeLen.int);
302
+ }
303
+
290
304
  }()
291
305
 
292
306
  export const BigUint = remark => new class BigUint extends Type {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k3000/store",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "storage",
5
5
  "main": "generator.mjs",
6
6
  "scripts": {
package/test/0/index.mjs CHANGED
@@ -8,7 +8,7 @@ export const remark = Symbol('remark')
8
8
 
9
9
  export const close = () => storage.close()
10
10
 
11
- export const getStruct = () => struct(storage, remark)
11
+ export const getStruct = name => struct(storage, remark, name)
12
12
 
13
13
  export default new class extends Store {
14
14
 
package/test/1/index CHANGED
Binary file
package/test/1/index.mjs CHANGED
@@ -387,7 +387,7 @@ export const remark = Symbol('remark')
387
387
 
388
388
  export const close = () => storage.close()
389
389
 
390
- export const getStruct = () => struct(storage, remark)
390
+ export const getStruct = name => struct(storage, remark, name)
391
391
 
392
392
  /**
393
393
  * @type {import('./type').Storage}
package/test/2/index CHANGED
Binary file
package/test/3/index CHANGED
Binary file
package/test/4/index CHANGED
Binary file
package/test/5/index CHANGED
Binary file
package/test/6/index CHANGED
Binary file
package/test/7/index CHANGED
Binary file