chore: Cleanup utils package (#9238)

Fixes: FRMW-2712

Old PR: https://github.com/medusajs/medusa/pull/9234 Closed because of incorrect branch naming

Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
This commit is contained in:
Harminder Virk
2024-09-23 16:07:58 +05:30
committed by GitHub
parent 79e3578932
commit 97e003ef4f
17 changed files with 138 additions and 75 deletions

View File

@@ -1,4 +1,4 @@
import { partitionArray } from "../../../dist"
import { partitionArray } from "../../index"
describe("partitionArray", function () {
it("should split array according to predicate", function () {

View File

@@ -2,7 +2,6 @@
import { objectFromStringPath } from "./object-from-string-path"
type Order = {
[key: string]: "ASC" | "DESC" | Order
}
@@ -42,7 +41,7 @@ function buildRelationsOrSelect(collection: string[]): Selects | Relations {
* }
* @param orderBy
*/
export function buildOrder<T>(orderBy: { [k: string]: "ASC" | "DESC" }): Order {
export function buildOrder(orderBy: { [k: string]: "ASC" | "DESC" }): Order {
const output: Order = {}
const orderKeys = Object.keys(orderBy)

View File

@@ -3,5 +3,5 @@ export function toCamelCase(str: string): string {
? str
: str
.toLowerCase()
.replace(/[^a-zA-Z0-9]+(.)/g, (m, chr) => chr.toUpperCase())
.replace(/[^a-zA-Z0-9]+(.)/g, (_, chr) => chr.toUpperCase())
}