diff --git a/client/index.d.ts b/client/index.d.ts index 9e6bb4c..555947d 100644 --- a/client/index.d.ts +++ b/client/index.d.ts @@ -33,6 +33,6 @@ import { fetchApi } from "./fetch"; import clientFetch = require("./fetch"); import serializeQuery = require("../package-shared/utils/serialize-query"); import serializeCookies = require("../package-shared/utils/serialize-cookies"); -import { EJSON } from "../package-shared/utils"; -import { numberfy } from "../package-shared/utils"; -import { slugify } from "../package-shared/utils"; +import EJSON = require("../package-shared/utils/ejson"); +import numberfy = require("../package-shared/utils/numberfy"); +import slugify = require("../package-shared/utils/slugify"); diff --git a/client/index.js b/client/index.js index b46b1bd..368bf61 100644 --- a/client/index.js +++ b/client/index.js @@ -13,9 +13,9 @@ const { fetchApi } = require("./fetch"); const clientFetch = require("./fetch"); const serializeQuery = require("../package-shared/utils/serialize-query"); const serializeCookies = require("../package-shared/utils/serialize-cookies"); -const { EJSON } = require("../package-shared/utils"); -const { numberfy } = require("../package-shared/utils"); -const { slugify } = require("../package-shared/utils"); +const EJSON = require("../package-shared/utils/ejson"); +const numberfy = require("../package-shared/utils/numberfy"); +const slugify = require("../package-shared/utils/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; -}; diff --git a/package-shared/utils/index.js b/package-shared/utils/index.js deleted file mode 100644 index 53e292c..0000000 --- a/package-shared/utils/index.js +++ /dev/null @@ -1,8 +0,0 @@ -// @ts-check - -exports.numberfy = require("./numberfy"); -exports.slugify = require("./slugify"); -exports.serializeCookies = require("./serialize-cookies"); -exports.serializeQuery = require("./serialize-query"); -exports.trimSql = require("./trim-sql"); -exports.EJSON = require("./ejson"); diff --git a/package-shared/utils/slugify.js b/package-shared/utils/slugify.js index 8c5bc15..df5c734 100644 --- a/package-shared/utils/slugify.js +++ b/package-shared/utils/slugify.js @@ -16,8 +16,8 @@ module.exports = function slugify(str) { .toLowerCase() .replace(/ {2,}/g, " ") .replace(/ /g, "-") - .replace(/[^a-z0-9]/, "-") - .replace(/-{2,}/, "-") + .replace(/[^a-z0-9]/g, "-") + .replace(/-{2,}/g, "-") .replace(/^-/, "") .replace(/-$/, ""); } catch (/** @type {any} */ error) { diff --git a/package.json b/package.json index 9b9b8c3..c60453a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moduletrace/datasquirel", - "version": "3.0.6", + "version": "3.0.7", "description": "Cloud-based SQL data management tool", "main": "index.js", "bin": {