@peerbit/indexer-interface
Advanced tools
Comparing version 2.0.2 to 2.0.3-a4ac71a
@@ -25,2 +25,7 @@ import { IntegerValue } from "./id.js"; | ||
} | ||
export type SortLike = string | { | ||
key: string[] | string; | ||
direction?: SortDirection | "asc" | "desc"; | ||
}; | ||
export declare const toSort: (sort?: SortLike | SortLike[]) => Sort[]; | ||
export declare abstract class LogicalQuery extends Query { | ||
@@ -27,0 +32,0 @@ } |
@@ -88,2 +88,19 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
export { Sort }; | ||
export const toSort = (sort) => { | ||
if (!sort) { | ||
return []; | ||
} | ||
if (typeof sort === "string") { | ||
return [new Sort({ key: sort })]; | ||
} | ||
if (Array.isArray(sort)) { | ||
return sort.map((x) => { | ||
if (typeof x === "string") { | ||
return new Sort({ key: x }); | ||
} | ||
return new Sort({ key: x.key, direction: x.direction }); | ||
}); | ||
} | ||
return [new Sort({ key: sort.key, direction: sort.direction })]; | ||
}; | ||
let LogicalQuery = class LogicalQuery extends Query { | ||
@@ -90,0 +107,0 @@ }; |
126
package.json
{ | ||
"name": "@peerbit/indexer-interface", | ||
"version": "2.0.2", | ||
"description": "Indexer store interface", | ||
"sideEffects": false, | ||
"type": "module", | ||
"types": "./dist/src/index.d.ts", | ||
"typesVersions": { | ||
"*": { | ||
"*": [ | ||
"*", | ||
"dist/*", | ||
"dist/src/*", | ||
"dist/src/*/index" | ||
], | ||
"src/*": [ | ||
"*", | ||
"dist/*", | ||
"dist/src/*", | ||
"dist/src/*/index" | ||
] | ||
} | ||
}, | ||
"files": [ | ||
"src", | ||
"dist", | ||
"!dist/e2e", | ||
"!dist/test", | ||
"!**/*.tsbuildinfo" | ||
], | ||
"exports": { | ||
".": { | ||
"types": "./dist/src/index.d.ts", | ||
"import": "./dist/src/index.js" | ||
} | ||
}, | ||
"eslintConfig": { | ||
"extends": "peerbit", | ||
"parserOptions": { | ||
"project": true, | ||
"sourceType": "module" | ||
}, | ||
"ignorePatterns": [ | ||
"!.aegir.js", | ||
"test/ts-use", | ||
"*.d.ts" | ||
] | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"clean": "aegir clean", | ||
"build": "aegir build --no-bundle", | ||
"test": "aegir test", | ||
"lint": "aegir lint" | ||
}, | ||
"author": "dao.xyz", | ||
"license": "MIT", | ||
"dependencies": { | ||
"uuid": "^10.0.0", | ||
"@dao-xyz/borsh": "^5.2.3", | ||
"@peerbit/crypto": "^2.3.2" | ||
} | ||
"name": "@peerbit/indexer-interface", | ||
"version": "2.0.3-a4ac71a", | ||
"description": "Indexer store interface", | ||
"sideEffects": false, | ||
"type": "module", | ||
"types": "./dist/src/index.d.ts", | ||
"typesVersions": { | ||
"*": { | ||
"*": [ | ||
"*", | ||
"dist/*", | ||
"dist/src/*", | ||
"dist/src/*/index" | ||
], | ||
"src/*": [ | ||
"*", | ||
"dist/*", | ||
"dist/src/*", | ||
"dist/src/*/index" | ||
] | ||
} | ||
}, | ||
"files": [ | ||
"src", | ||
"dist", | ||
"!dist/e2e", | ||
"!dist/test", | ||
"!**/*.tsbuildinfo" | ||
], | ||
"exports": { | ||
".": { | ||
"types": "./dist/src/index.d.ts", | ||
"import": "./dist/src/index.js" | ||
} | ||
}, | ||
"eslintConfig": { | ||
"extends": "peerbit", | ||
"parserOptions": { | ||
"project": true, | ||
"sourceType": "module" | ||
}, | ||
"ignorePatterns": [ | ||
"!.aegir.js", | ||
"test/ts-use", | ||
"*.d.ts" | ||
] | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"clean": "aegir clean", | ||
"build": "aegir build --no-bundle", | ||
"test": "aegir test", | ||
"lint": "aegir lint" | ||
}, | ||
"author": "dao.xyz", | ||
"license": "MIT", | ||
"dependencies": { | ||
"uuid": "^10.0.0", | ||
"@dao-xyz/borsh": "^5.2.3", | ||
"@peerbit/crypto": "2.3.3-a4ac71a" | ||
} | ||
} |
@@ -83,2 +83,23 @@ import { deserialize, field, serialize, variant, vec } from "@dao-xyz/borsh"; | ||
export type SortLike = | ||
| string | ||
| { key: string[] | string; direction?: SortDirection | "asc" | "desc" }; | ||
export const toSort = (sort?: SortLike | SortLike[]): Sort[] => { | ||
if (!sort) { | ||
return []; | ||
} | ||
if (typeof sort === "string") { | ||
return [new Sort({ key: sort })]; | ||
} | ||
if (Array.isArray(sort)) { | ||
return sort.map((x) => { | ||
if (typeof x === "string") { | ||
return new Sort({ key: x }); | ||
} | ||
return new Sort({ key: x.key, direction: x.direction }); | ||
}); | ||
} | ||
return [new Sort({ key: sort.key, direction: sort.direction })]; | ||
}; | ||
@variant(1) | ||
@@ -85,0 +106,0 @@ export abstract class LogicalQuery extends Query {} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
84410
1844
2
+ Added@peerbit/cache@2.1.1-a4ac71a(transitive)
+ Added@peerbit/crypto@2.3.3-a4ac71a(transitive)
- Removed@peerbit/cache@2.1.2(transitive)
- Removed@peerbit/crypto@2.3.5(transitive)