type
hero BETA
Explore
Tracks
Advent of TS
New
Explore
Tracks
Advent of TS
New
Theme
Login
Support Us
Login

    Hard

    Simple Vue

    HARD
    0
    9
    @typehero
    6 months ago

    Implement a simpiled version of a Vue-like typing support.

    By providing a function name `SimpleVu

    Currying 1

    HARD
    0
    7
    @typehero
    6 months ago

    TypeScript 4.0 is recommended in this challenge

    [Currying](https://en.wikipedia.org/wiki/Curryi

    Union to Intersection

    HARD
    0
    6
    @typehero
    6 months ago

    Implement the advanced util type UnionToIntersection<U>

    For example

    type I = UnionToInte

    Get Required

    HARD
    0
    1
    @typehero
    6 months ago

    Implement the advanced util type GetRequired<T>, which remains all the required fields

    For exam

    Get Optional

    HARD
    0
    2
    @typehero
    6 months ago

    Implement the advanced util type GetOptional<T>, which remains all the optional fields

    For exam

    Required Keys

    HARD
    0
    1
    @typehero
    6 months ago

    Implement the advanced util type RequiredKeys<T>, which picks all the required keys into a union

    Optional Keys

    HARD
    0
    1
    @typehero
    6 months ago

    Implement the advanced util type OptionalKeys<T>, which picks all the optional keys into a union

    Capitalize Words

    HARD
    0
    1
    @typehero
    6 months ago

    Implement CapitalizeWords<T> which converts the first letter of each word of a string to upp

    CamelCase

    HARD
    0
    0
    @typehero
    6 months ago

    Implement CamelCase<T> which converts snake_case string to camelCase.

    For example

    ty

    C-printf Parser

    HARD
    0
    1
    @typehero
    6 months ago

    There is a function in C language: printf. This function allows us to print something with forma

    Vue Basic Props

    HARD
    0
    2
    @typehero
    6 months ago

    **This challenge continues from 6 - Simple Vue, you should finish that one firs

    IsAny

    HARD
    0
    1
    @typehero
    6 months ago

    Sometimes it's useful to detect if you have a value with any type. This is especially helpful wh

    Typed Get

    HARD
    0
    2
    @typehero
    6 months ago

    The get function in lodash is a quite convenient helper f

    String to Number

    HARD
    0
    3
    @typehero
    6 months ago

    Convert a string literal to a number, which behaves like Number.parseInt.

    Tuple Filter

    HARD
    0
    1
    @typehero
    6 months ago

    Implement a type FilterOut<T, F> that filters out items of the given type F from the tuple T

    Tuple to Enum Object

    HARD
    0
    1
    @typehero
    6 months ago

    The enum is an original syntax of TypeScript (it does not exist in JavaScript). So it is converted

    printf

    HARD
    0
    1
    @typehero
    6 months ago

    Implement Format<T extends string> generic.

    For example,

    type FormatCase1 = Format<"%sab

    Deep object to unique

    HARD
    0
    0
    @typehero
    6 months ago

    TypeScript has structural type system, but sometimes you want a function to accept only some previ

    Length of String 2

    HARD
    0
    0
    @typehero
    6 months ago

    Implement a type LengthOfString<S> that calculates the length of the template string (as in [298

    Union to Tuple

    HARD
    1
    3
    @typehero
    6 months ago

    Implement a type, UnionToTuple, that converts a union to a tuple.

    As we know, union is an unord

    String Join

    HARD
    0
    1
    @typehero
    6 months ago

    Create a type-safe string join utility which can be used like so:

    const hyphenJoiner = join

    DeepPick

    HARD
    0
    1
    @typehero
    6 months ago

    Implement a type DeepPick, that extends Utility types Pick. A type takes two arguments.

    For ex

    Pinia

    HARD
    0
    1
    @typehero
    6 months ago

    Create a type-level function whose types is similar to Pinia lib

    Camelize

    HARD
    0
    1
    @typehero
    6 months ago

    Implement Camelize which converts object from snake_case to to camelCase

    Camelize<{ some_

    Drop String

    HARD
    0
    2
    @typehero
    6 months ago

    Drop the specified chars from a string.

    For example:

    type Butterfly = DropString<'foobar!'

    Split

    HARD
    0
    1
    @typehero
    6 months ago

    The well known split() method splits a string into an array of substrings by looking for a separ

    ClassPublicKeys

    HARD
    0
    1
    @typehero
    6 months ago

    Implement the generic ClassPublicKeys<T> which returns all public keys of a class.

    For example:

    IsRequiredKey

    HARD
    0
    1
    @typehero
    6 months ago

    Implement a generic IsRequiredKey<T, K> that return whether K are required keys of ``

    ObjectFromEntries

    HARD
    0
    1
    @typehero
    6 months ago

    Implement the type version of Object.fromEntries

    For example:

    interface Mode

    InorderTraversal

    HARD
    0
    0
    @typehero
    6 months ago

    Implement the type version of binary tree inorder traversal.

    For example:

    const tr

    IsPalindrome

    HARD
    0
    3
    @typehero
    6 months ago

    Implement type IsPalindrome<T> to check whether a string or number is palindrome.

    For exam

    Mutable Keys

    HARD
    0
    2
    @typehero
    6 months ago

    Implement the advanced util type MutableKeys, which picks all the mutable (not readonly) keys i

    Intersection

    HARD
    0
    2
    @typehero
    6 months ago

    Implement the type version of Lodash.intersection with a little difference. Intersection takes

    Binary to Decimal

    HARD
    0
    3
    @typehero
    6 months ago

    Implement BinaryToDecimal<S> which takes an exact string type S consisting 0 and 1 and returns

    Object Key Paths

    HARD
    0
    2
    @typehero
    6 months ago

    Get all possible paths that could be called by _.get (a lod

    Two Sum

    HARD
    0
    1
    @typehero
    6 months ago

    Given an array of integers nums and an integer target, return true if two numbers such that th

    ValidDate

    HARD
    1
    1
    @typehero
    6 months ago

    Implement a type ValidDate, which takes an input type T and returns whether T is a valid date.

    Assign

    HARD
    0
    3
    @typehero
    6 months ago

    You have a target object and a source array of objects. You need to copy property from source to t

    Maximum

    HARD
    0
    3
    @typehero
    6 months ago

    Description

    Implement the type Maximum, which takes an input type T, and returns the

    Capitalize Nest Object Keys

    HARD
    0
    1
    @typehero
    6 months ago

    Capitalize the key of the object, and if the value is an array, iterate through the objects in the

    Replace Union

    HARD
    1
    2
    @typehero
    6 months ago

    Given an union of types and array of type pairs to replace ([[string, number], [Date, null]]

    FizzBuzz

    HARD
    0
    2
    @typehero
    6 months ago

    The FizzBuzz problem is a classic test given in coding interviews. The task is simple:

    Print in

    Run-length encoding

    HARD
    0
    2
    @typehero
    6 months ago

    Given a string sequence of a letters f.e. AAABCCXXXXXXY. Return run-length encoded string `3AB

    Tree path array

    HARD
    0
    2
    @typehero
    6 months ago

    Create a type Path that represents validates a possible path of a tree under the form of an ar

    SnakeCase

    HARD
    0
    1
    @typehero
    6 months ago

    Create a SnakeCase<T> generic that turns a string formatted in camelCase into a string forma

    IsNegativeNumber

    HARD
    0
    1
    @typehero
    6 months ago

    Sometimes when working with numeric literals, we need to rule out (or enforce) that the provided n

    OptionalUndefined

    HARD
    0
    1
    @typehero
    6 months ago

    Implement the util type OptionalUndefined<T, Props> that turns all the properties of T that ca

    BitwiseXOR

    HARD
    0
    3
    @typehero
    6 months ago

    Implement BitwiseXOR<S1,S2> which takes two binary string literal type and returns a binary

    Unique Items

    HARD
    0
    1
    @typehero
    6 months ago

    Some concepts in TypeScript can not be described by types, but can be expressed through type const

    Sudoku

    HARD
    2
    2
    @typehero
    6 months ago

    Write a type that verifies Sudoku game is solved. This is

    Length of String 3

    HARD
    0
    1
    @typehero
    6 months ago

    Implement a type LengthOfString<S> just like Array#length:

    Differing to two previous challeng

    Unbox

    HARD
    0
    1
    @typehero
    6 months ago

    How can we build a type that "unboxes" arrays, functions, promises, and tuples?

    Example:

    Binary Addition

    HARD
    0
    1
    @typehero
    6 months ago

    Implement BinaryAdd to add two binary numbers together. The numbers should not be translated out

    Take Elements

    HARD
    0
    1
    @typehero
    6 months ago

    Implement a type Take<N, Arr> that returns the first N elements from an array Arr. If N is

    Union to Object from key

    HARD
    0
    1
    @Type Challenges
    6 months ago

    Find the object containing the key in the union type by the key. It takes two parameters: a union

    Valid Sudoku

    HARD
    0
    1
    @Type Challenges
    6 months ago

    Sudoku is a famous paper and pencil game. The goal of Sudoku is to fill a 9x9 grid with numbers so