From da6b0b43c96d6a79a704185676986d9903c8b765 Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Thu, 12 Dec 2024 07:06:37 +0100 Subject: [PATCH] Updates --- index.d.ts | 14 ++++++++++++-- index.js | 9 +++++++-- package-shared/utils/index.d.ts | 13 ------------- 3 files changed, 19 insertions(+), 17 deletions(-) delete mode 100644 package-shared/utils/index.d.ts diff --git a/index.d.ts b/index.d.ts index c5d070d..4ced7b1 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,2 +1,12 @@ -export const dsqlUtils: typeof import("./package-shared/utils"); -export { datasquirel }; +export namespace dsqlUtils { + export { serializeQuery }; + export { serializeCookies }; + export { EJSON }; + export { numberfy }; + export { slugify }; +} +import serializeQuery = require("./package-shared/utils/serialize-query"); +import serializeCookies = require("./package-shared/utils/serialize-cookies"); +import EJSON = require("./package-shared/utils/ejson"); +import numberfy = require("./package-shared/utils/numberfy"); +import slugify = require("./package-shared/utils/slugify"); diff --git a/index.js b/index.js index f6d57c7..1e496da 100644 --- a/index.js +++ b/index.js @@ -102,6 +102,11 @@ const datasquirel = { }, }; -exports.dsqlUtils = require("./package-shared/utils"); -exports.datasquirel = datasquirel; module.exports = datasquirel; +exports.dsqlUtils = { + serializeQuery, + serializeCookies, + EJSON, + numberfy, + slugify, +}; diff --git a/package-shared/utils/index.d.ts b/package-shared/utils/index.d.ts deleted file mode 100644 index 39510e6..0000000 --- a/package-shared/utils/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export const numberfy: (num: any, decimals?: number) => number; -export const slugify: (str: string) => string; -export const serializeCookies: typeof import("./serialize-cookies"); -export const serializeQuery: typeof import("./serialize-query"); -export const trimSql: typeof import("./trim-sql"); -export const EJSON: { - parse: (string: string | null | number, reviver?: (this: any, key: string, value: any) => any) => { - [x: string]: any; - } | { - [x: string]: any; - }[] | undefined; - stringify: (value: any, replacer?: ((this: any, key: string, value: any) => any) | null, space?: string | number) => string | undefined; -};