Huge News!Announcing our $40M Series B led by Abstract Ventures.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 1.0.0 to 1.0.1

src/types.ts

2

package.json
{
"name": "@kakasoo/sortable",
"version": "1.0.0",
"version": "1.0.1",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "private": false,

@@ -1,9 +0,12 @@

import { DeepStrictObjectKeys } from "@kakasoo/deep-strict-types";
import { StringPrototype } from "@kakasoo/proto-typescript";
import { StringPrototype, StringType } from "@kakasoo/proto-typescript";
import { StringToDeepObject } from "./types";
export function getSortable<T extends object>(
key: DeepStrictObjectKeys<T>,
direction: "asc" | "desc"
) {
const sortable: Record<string, any> = {};
export function getSortable<
Key extends string,
Direction extends "asc" | "desc"
>(
key: Key,
direction: Direction
): StringToDeepObject<StringType.Split<Key, ".">, Direction> {
const sortable: any = {};
const keys = StringPrototype.split(key, ".");

@@ -10,0 +13,0 @@ keys.reduce((acc, key, index, arr) => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc