
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
A library of composable functions for the type-level! Transform your TypeScript types in any way you want using functions you already know.
A library of composable functions for the type level!
Transform your TypeScript types in any way you want using functions you already know.
Tuples.Map
, Tuples.Filter
, Objects.MapValues
, etc).Match
.Numbers.Add
, Numbers.Sub
, Numbers.Mul
, Numbers.Div
, etc).🚧 work in progress 🚧
You can find HotScript on npm:
npm install -D hotscript
HotScript is a work-in-progress library, so expect breaking changes in its API.
Run this as a TypeScript Playground
import { Pipe, Tuples, Strings, Numbers } from "hotscript";
type res1 = Pipe<
// ^? 62
[1, 2, 3, 4],
[
Tuples.Map<Numbers.Add<3>>, // [4, 5, 6, 7]
Tuples.Join<".">, // "4.5.6.7"
Strings.Split<".">, // ["4", "5", "6", "7"]
Tuples.Map<Strings.Prepend<"1">>, // ["14", "15", "16", "17"]
Tuples.Map<Strings.ToNumber>, // [14, 15, 16, 17]
Tuples.Sum // 62
]
>;
Run this as a TypeScript Playground
import { Call, Fn, Tuples } from "hotscript";
// This is a type-level "lambda"!
interface Duplicate extends Fn {
return: [this["arg0"], this["arg0"]];
}
type result1 = Call<Tuples.Map<Duplicate>, [1, 2, 3, 4]>;
// ^? [[1, 1], [2, 2], [3, 3], [4, 4]]
type result2 = Call<Tuples.FlatMap<Duplicate>, [1, 2, 3, 4]>;
// ^? [1, 1, 2, 2, 3, 3, 4, 4]
Run this as a TypeScript Playground
import { Pipe, Objects, Booleans } from "hotscript";
// Let's compose some functions to transform an object type:
type ToAPIPayload<T> = Pipe<
T,
[
Objects.OmitBy<Booleans.Equals<symbol>>,
Objects.Assign<{ metadata: { newUser: true } }>,
Objects.SnakeCaseDeep,
Objects.Assign<{ id: string }>
]
>;
type T = ToAPIPayload<{
id: symbol;
firstName: string;
lastName: string;
}>;
// Returns:
type T = {
id: string;
metadata: { new_user: true };
first_name: string;
last_name: string;
};
Run this as a TypeScript Playground
https://user-images.githubusercontent.com/2315749/222081717-96217cd2-ac89-4e06-a942-17fbda717cd2.mp4
import { Pipe, Objects, Strings, ComposeLeft, Tuples, Match } from "hotscript";
type res5 = Pipe<
// ^? { id: string, index: number }
"/users/<id:string>/posts/<index:number>",
[
Strings.Split<"/">,
Tuples.Filter<Strings.StartsWith<"<">>,
Tuples.Map<ComposeLeft<[Strings.Trim<"<" | ">">, Strings.Split<":">]>>,
Tuples.ToUnion,
Objects.FromEntries,
Objects.MapValues<
Match<[Match.With<"string", string>, Match.With<"number", number>]>
>
]
>;
Pipe<Input, Fn[]>
PipeRight<Fn[], Input>
Call<Fn, ...Arg>
Apply<Fn, Arg[]>
PartialApply<Fn, Arg[]>
Compose<Fn[]>
ComposeLeft<Fn[]>
ReturnType<Fn>
Parameters<Fn>
Parameter<N, Fn>
Create<X> -> [X]
Partition<Tuple>
IsEmpty<Tuple>
Zip<...Tuple[]>
ZipWith<Fn, ...Tuple[]>
Sort<Tuple>
Head<Tuple>
Tail<Tuple>
At<N, Tuple>
Last<Tuple>
FlatMap<Fn, Tuple>
Find<Fn, Tuple>
Drop<N, Tuple>
Take<N, Tuple>
TakeWhile<Fn, Tuple>
GroupBy<Fn, Tuple>
Join<Str, Tuple>
Map<Fn, Tuple>
Filter<Fn, Tuple>
Reduce<Fn, Init, Tuple>
ReduceRight<Fn, Init, Tuple>
Reverse<Tuple>
Every<Fn, Tuple>
Some<Fn, Tuple>
SplitAt<N, Tuple>
ToUnion<Tuple>
ToIntersection<Tuple>
Prepend<X, Tuple>
Append<X, Tuple>
Concat<T1, T2>
Min<Tuple>
Max<Tuple>
Sum<Tuple>
Readonly<Obj>
Mutable<Obj>
Required<Obj>
Partial<Obj>
ReadonlyDeep<Obj>
MutableDeep<Obj>
RequiredDeep<Obj>
PartialDeep<Obj>
Update<Path, Fn | V, Obj>
Record<Key, Value>
Keys<Obj>
Values<Obj>
AllPaths<Obj>
Create<Pattern, X>
Get<Path, Obj>
FromEntries<[Key, Value]>
Entries<Obj>
MapValues<Fn, Obj>
MapKeys<Fn, Obj>
Assign<...Obj>
Pick<Key, Obj>
PickBy<Fn, Obj>
Omit<Key, Obj>
OmitBy<Fn, Obj>
CamelCase<Obj>
CamelCaseDeep<Obj>
SnakeCase<Obj>
SnakeCaseDeep<Obj>
KebabCase<Obj>
KebabCaseDeep<Obj>
Map<Fn, U>
Extract<T, U>
ExtractBy<Fn, U>
Exclude<T, U>
ExcludeBy<Fn, U>
NonNullable<U>
ToTuple<U>
ToIntersection<U>
Length<Str>
TrimLeft<Str>
TrimRight<Str>
Trim<Str>
Join<Sep, Str>
Replace<From, To, Str>
Slice<Start, End, Str>
Split<Sep, Str>
Repeat<N, Str>
StartsWith<S, Str>
EndsWith<E, Str>
ToTuple<Str>
ToNumber<Str>
ToString<Str>
Prepend<Start, Str>
Append<End, Str>
Uppercase<Str>
Lowercase<Str>
Capitalize<Str>
Uncapitalize<Str>
SnakeCase<Str>
CamelCase<Str>
KebabCase<Str>
Compare<Str, Str>
Equal<Str, Str>
NotEqual<Str, Str>
LessThan<Str, Str>
LessThanOrEqual<Str, Str>
GreaterThan<Str, Str>
GreaterThanOrEqual<Str, Str>
Add<N, M>
Multiply<N, M>
Subtract<N, M>
Negate<N>
Power<N, M>
Div<N, M>
Mod<N, M>
Abs<N>
Compare<N, M>
GreaterThan<N, M>
GreaterThanOrEqual<N, M>
LessThan<N, M>
LessThanOrEqual<N, M>
And<Bool, Bool>
Or<Bool, Bool>
XOr<Bool, Bool>
Not<Bool>
Extends<A, B>
Equals<A, B>
DoesNotExtend<A, B>
FAQs
A library of composable functions for the type-level! Transform your TypeScript types in any way you want using functions you already know.
The npm package hotscript receives a total of 0 weekly downloads. As such, hotscript popularity was classified as not popular.
We found that hotscript demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.