@k3000/store 0.2.0 → 0.3.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/architect.mjs CHANGED
@@ -441,7 +441,7 @@ export class Entities extends Array {
441
441
 
442
442
  #assign(position, item) {
443
443
 
444
- Object.assign(new this.#classify(position, this.#index, this.#lengthSet, this.#positionSet),
444
+ return Object.assign(new this.#classify(position, this.#index, this.#lengthSet, this.#positionSet),
445
445
  this.#classify.create(item))
446
446
  }
447
447
 
@@ -452,6 +452,8 @@ export class Entities extends Array {
452
452
  this.#storage.needSave = true
453
453
  }
454
454
 
455
+ const result = []
456
+
455
457
  for (const item of items) {
456
458
 
457
459
  let position
@@ -469,10 +471,10 @@ export class Entities extends Array {
469
471
 
470
472
  this.#record.push(position)
471
473
 
472
- this.#assign(position, item)
474
+ result.push(this.#assign(position, item))
473
475
  }
474
476
 
475
- return items.length
477
+ return result
476
478
  }
477
479
 
478
480
  pop() {
@@ -1405,4 +1407,4 @@ export const cloneObjByKey = (obj, ...keys) => {
1405
1407
  }
1406
1408
 
1407
1409
  return result
1408
- }
1410
+ }
package/generator.mjs CHANGED
@@ -416,13 +416,26 @@ export const Float = remark => new class Float extends Type {
416
416
 
417
417
  }()
418
418
 
419
- export const String = remark => new class String extends Type {
419
+ /**
420
+ * @param {number | string} size
421
+ * @constructor
422
+ */
423
+ export const String = size => new class String extends Type {
420
424
 
421
425
  constructor() {
422
426
 
423
- super(typeMap.string, remark);
427
+ if (Number.isInteger(size)) {
428
+
429
+ super(typeMap.string);
430
+
431
+ super.length(SCOPE, size)
424
432
 
425
- super.length(SCOPE, TypeLen.string)
433
+ } else {
434
+
435
+ super(typeMap.string, size);
436
+
437
+ super.length(SCOPE, TypeLen.string)
438
+ }
426
439
  }
427
440
 
428
441
  index(support = true) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k3000/store",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "storage",
5
5
  "main": "generator.mjs",
6
6
  "scripts": {
package/test/1/data CHANGED
Binary file
package/test/1/index CHANGED
Binary file
package/test/2/data CHANGED
Binary file
package/test/2/index CHANGED
Binary file
package/test/3/data CHANGED
Binary file
package/test/3/index CHANGED
Binary file
package/test/4/data CHANGED
Binary file
package/test/4/index CHANGED
Binary file
package/test/5/data CHANGED
Binary file
package/test/5/index CHANGED
Binary file
package/test/6/data CHANGED
Binary file
package/test/6/index CHANGED
Binary file
package/test/7/data CHANGED
Binary file
package/test/7/index CHANGED
Binary file