Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hotscript

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hotscript

Type-level madness

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Higher-Order TypeScript (HOTScript)

A lodash-like library for types, with support for type-level lambda functions.

🚧 work in progress 🚧

// prettier-ignore
type result = Pipe<
  //  ^? 78
  [1, 2, 3, 4, 3, 4],
  [
    T.Map<Add<3>>,
    S.Join<'.'>,
    S.Split<'.'>,
    T.Map<S.ToNumber>,
    T.Map<N.Add<10>>,
    T.Sum
  ]
>;

// This is a type-level "lambda"!
interface Duplicate extends Fn {
  output: [this["args"][0], this["args"][0]];
}

type result = Call<T.FlatMap<Duplicate>, [1, 2, 3, 4]>;
//     ^? [1, 1, 2, 2, 3, 3, 4, 4]

TODO

  • Function
    • Pipe
    • PipeRight
    • Call
    • Apply
    • ApplyPartial
    • Compose
    • ComposeLeft
  • Tuples
    • Zip
    • Partition
    • Head
    • Tail
    • Last
    • FlatMap
    • Find
    • Sum
    • Drop n
    • Take n
    • TakeWhile
    • Join separator
    • Map
    • Filter
    • Reduce
    • ReduceRight
  • Object
    • FromEntries
    • Entries
    • MapValues
    • MapKeys
    • GroupBy
    • Assign
    • Pick
    • PickBy
    • Omit
    • OmitBy
    • CamelizeKeys
    • CamelizeKeysDeep
    • SnakizeKeys
    • SnakizeKeysDeep
    • KebabizeKeys
    • KebabizeKeysDeep
  • Union
    • Map
    • Extract
    • ExtractBy
    • Exclude
    • ExcludeBy
  • String
    • ToString
    • ToNumber
    • Append
    • Prepend
    • Uppercase
    • Lowercase
    • Capitalize
    • Uncapitalize
    • SnakeCase
    • CamelCase
    • KebabCase
    • Split separator
    • Words
  • Number
    • Add
    • Multiply
    • Subtract
    • GreaterThan
    • GreaterThanOrEqual
    • LessThan
    • LessThanOrEqual
  • Boolean
    • And
    • Or
    • Not
    • Extends
    • Equals
    • DoesNotExtends

FAQs

Package last updated on 13 Feb 2023

Did you know?

Socket

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.

Install

Related posts

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