@graffy/common 0.15.25 → 0.16.0-alpha.2

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graffy/common",
3
3
  "description": "Common libraries that used by various Graffy modules.",
4
4
  "author": "aravind (https://github.com/aravindet)",
5
- "version": "0.15.25",
5
+ "version": "0.16.0-alpha.2",
6
6
  "main": "./index.cjs",
7
7
  "exports": {
8
8
  "import": "./index.mjs",
@@ -18,6 +18,6 @@
18
18
  "dependencies": {
19
19
  "lodash": "^4.17.19",
20
20
  "merge-async-iterators": "^0.2.1",
21
- "@graffy/stream": "0.15.25"
21
+ "@graffy/stream": "0.16.0-alpha.2"
22
22
  }
23
23
  }
@@ -1,5 +1,5 @@
1
1
  export function splitArgs(arg: any): {}[];
2
2
  export function encode(arg: any): {
3
- key: string;
3
+ key: Uint8Array;
4
4
  };
5
5
  export function decode(node: any): any;
@@ -1,2 +1,2 @@
1
1
  export function encode(u8Arr: any): string;
2
- export function decode(string: any, start?: number): Uint8Array;
2
+ export function decode(string: any, start?: number): any;
@@ -3,7 +3,6 @@ export { default as decorate } from "./decorate.js";
3
3
  export * from "./serialize.js";
4
4
  export * from "./encodeTree.js";
5
5
  export * from "./decodeTree.js";
6
- export { encode as encodeUrl, decode as decodeUrl } from "./url.js";
7
6
  export { encode as encodeValue, decode as decodeValue } from "./struct.js";
8
7
  export { encode as encodeArgs, decode as decodeArgs, splitArgs } from "./args.js";
9
8
  export { encode as encodePath, decode as decodePath, splitRef } from "./path.js";
@@ -1,3 +1,3 @@
1
- export function encode(path: any): string[];
1
+ export function encode(path: any): any;
2
2
  export function decode(path: any): any[];
3
3
  export function splitRef($ref: any): {}[];
@@ -1,2 +1,2 @@
1
- export function serialize(obj: any): string;
1
+ export function serialize(payload: any): string;
2
2
  export function deserialize(str: any): any;
@@ -1,5 +1,5 @@
1
- export function encode(value: any): string;
2
- export function decode(key: any): any;
1
+ export function encode(value: any): Uint8Array;
2
+ export function decode(buffer: any): any;
3
3
  export const END: 0;
4
4
  export const NULL: 1;
5
5
  export const FALSE: 2;
@@ -8,3 +8,4 @@ export const NUM: 4;
8
8
  export const STR: 5;
9
9
  export const ARR: 6;
10
10
  export const OBJ: 7;
11
+ export const EOK: 127;
@@ -2,6 +2,5 @@ export function isRange(node: any): boolean;
2
2
  export function isBranch(node: any): boolean;
3
3
  export function isPrefix(node: any): any;
4
4
  export function isLink(node: any): boolean;
5
- export function isEncoded(node: any): boolean;
6
5
  export function isOlder(node: any, version: any): boolean;
7
6
  export function isNewer(node: any, version: any): boolean;
@@ -1,5 +1,5 @@
1
1
  export default function finalize(graph: any, query: any, version?: number): {
2
- key: string;
3
- end: string;
2
+ key: Uint8Array;
3
+ end: Uint8Array;
4
4
  version: number;
5
5
  }[];
package/types/util.d.ts CHANGED
@@ -1,9 +1,14 @@
1
+ export function isMinKey(key: any): boolean;
2
+ export function isMaxKey(key: any): boolean;
1
3
  export function err(message: any, { cause, ...args }?: {
2
- cause: any;
4
+ cause?: any;
3
5
  }): void;
4
6
  export function errIf(message: any, condition: any, args: any): void;
5
7
  export function isEmpty(object: any): boolean;
6
8
  export function isDef(value: any): boolean;
7
9
  export function isPlainObject(arg: any): boolean;
8
- export function isEncodedKey(str: any): boolean;
10
+ export function cmp(a: any, b: any): 1 | -1 | 0;
9
11
  export function find(items: any, compare: any, first?: number, last?: any): number;
12
+ export function addStringify(buffer: any): any;
13
+ export const MIN_KEY: Uint8Array;
14
+ export const MAX_KEY: Uint8Array;
@@ -1,2 +0,0 @@
1
- export function encode(query: any): string;
2
- export function decode(fields: any): any;