summaryrefslogtreecommitdiff
path: root/packages/taler-util/src/helpers.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-11-17 10:23:22 +0100
committerFlorian Dold <florian@dold.me>2021-11-17 10:23:30 +0100
commit9f0429cb2f8ad9cb2e98a787139602d913c1aefa (patch)
treecda55e2d07a291dd2ff6f243bb423121ecf220b3 /packages/taler-util/src/helpers.ts
parenta994009d2f094c4d9c12da68dac3abb28bdef4b3 (diff)
downloadwallet-core-9f0429cb2f8ad9cb2e98a787139602d913c1aefa.tar.gz
wallet-core-9f0429cb2f8ad9cb2e98a787139602d913c1aefa.tar.bz2
wallet-core-9f0429cb2f8ad9cb2e98a787139602d913c1aefa.zip
wallet: implement exchange protocol v9
Diffstat (limited to 'packages/taler-util/src/helpers.ts')
-rw-r--r--packages/taler-util/src/helpers.ts11
1 files changed, 5 insertions, 6 deletions
diff --git a/packages/taler-util/src/helpers.ts b/packages/taler-util/src/helpers.ts
index 089602c9d..6c836c482 100644
--- a/packages/taler-util/src/helpers.ts
+++ b/packages/taler-util/src/helpers.ts
@@ -94,7 +94,7 @@ export function canonicalJson(obj: any): string {
/**
* Lexically compare two strings.
*/
-export function strcmp(s1: string, s2: string): number {
+export function strcmp(s1: string, s2: string): -1 | 0 | 1 {
if (s1 < s2) {
return -1;
}
@@ -113,15 +113,14 @@ export function j2s(x: any): string {
/**
* Use this to filter null or undefined from an array in a type-safe fashion
- *
+ *
* example:
* const array: Array<T | undefined> = [undefined, null]
* const filtered: Array<T> = array.filter(notEmpty)
- *
- * @param value
- * @returns
+ *
+ * @param value
+ * @returns
*/
export function notEmpty<T>(value: T | null | undefined): value is T {
return value !== null && value !== undefined;
}
-