New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@kakasoo/sortable

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kakasoo/sortable - npm Package Compare versions

Comparing version

to
1.0.4

4

dist/index.d.ts
import { StringType } from "@kakasoo/proto-typescript";
import { StringToDeepObject } from "./types";
export declare function getSortable<Key extends string, Direction extends "asc" | "desc">(key: Key, direction: Direction): StringToDeepObject<StringType.Split<Key, ".">, Direction>;
type Split<U extends string> = U extends infer K extends string ? StringType.Split<K, "."> : never;
export declare function getSortable<Key extends string, Direction extends "asc" | "desc">(key: Key, direction: Direction): StringToDeepObject<Split<Key>, Direction>;
export {};
{
"name": "@kakasoo/sortable",
"version": "1.0.2",
"version": "1.0.4",
"main": "dist/index.js",

@@ -11,3 +11,3 @@ "types": "dist/index.d.ts",

"scripts": {
"build": "tsc"
"build": "rimraf ./dist && tsc"
},

@@ -19,2 +19,3 @@ "keywords": [],

"devDependencies": {
"rimraf": "^6.0.1",
"typescript": "^5.7.2"

@@ -21,0 +22,0 @@ },

import { StringPrototype, StringType } from "@kakasoo/proto-typescript";
import { StringToDeepObject } from "./types";
type Split<U extends string> = U extends infer K extends string
? StringType.Split<K, ".">
: never;
export function getSortable<
Key extends string,
Direction extends "asc" | "desc"
>(
key: Key,
direction: Direction
): StringToDeepObject<StringType.Split<Key, ".">, Direction> {
>(key: Key, direction: Direction): StringToDeepObject<Split<Key>, Direction> {
const sortable: any = {};

@@ -12,0 +13,0 @@ const keys = StringPrototype.split(key, ".");