From d6a053b301ce4e248e3f3c3b8f1a519a55339b77 Mon Sep 17 00:00:00 2001 From: Kasun Vithanage Date: Tue, 2 Feb 2021 12:38:24 +0530 Subject: [PATCH] export utils --- src/index.ts | 1 + src/utils/hash.ts | 10 ++++++++-- src/utils/index.ts | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 src/utils/index.ts diff --git a/src/index.ts b/src/index.ts index b5c422b..4f5e6b8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,3 +3,4 @@ export * from './errors'; export * from './payment'; export * from './paynow'; export * from './responses'; +export * from './utils'; diff --git a/src/utils/hash.ts b/src/utils/hash.ts index 00bb8b7..b4ee33b 100644 --- a/src/utils/hash.ts +++ b/src/utils/hash.ts @@ -1,7 +1,13 @@ import crypto from 'crypto'; - -export function jsonStringify (obj: unknown) { +/** + * Stringify an object with 4 spaces + * + * @export + * @param {object} obj + * @returns + */ +export function jsonStringify (obj: object) { return JSON.stringify(obj, null, 4) } diff --git a/src/utils/index.ts b/src/utils/index.ts new file mode 100644 index 0000000..6719163 --- /dev/null +++ b/src/utils/index.ts @@ -0,0 +1 @@ +export * from './hash';