@loro-dev/flock 2.0.0 → 2.0.1
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/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/_moon_flock.ts +454 -437
- package/src/index.ts +11 -0
package/src/index.ts
CHANGED
|
@@ -592,6 +592,12 @@ export class Flock {
|
|
|
592
592
|
);
|
|
593
593
|
}
|
|
594
594
|
|
|
595
|
+
/**
|
|
596
|
+
* Put a value into the flock. If the given entry already exists, this insert will be skipped.
|
|
597
|
+
* @param key
|
|
598
|
+
* @param value
|
|
599
|
+
* @param now
|
|
600
|
+
*/
|
|
595
601
|
put(key: KeyPart[], value: Value, now?: number): void {
|
|
596
602
|
put_json_ffi(this.inner, key, value, now);
|
|
597
603
|
}
|
|
@@ -608,6 +614,11 @@ export class Flock {
|
|
|
608
614
|
this.put(key, value, now);
|
|
609
615
|
}
|
|
610
616
|
|
|
617
|
+
/**
|
|
618
|
+
* Delete a value from the flock. If the given entry does not exist, this delete will be skipped.
|
|
619
|
+
* @param key
|
|
620
|
+
* @param now
|
|
621
|
+
*/
|
|
611
622
|
delete(key: KeyPart[], now?: number): void {
|
|
612
623
|
delete_ffi(this.inner, key, now);
|
|
613
624
|
}
|