RSSAmplifier

Blog

Alexey Berezin blog

Hi I'm Alexey Berezin, who loves London 🏴󠁧󠁢󠁥󠁮󠁧󠁿, players ⏯ and TypeScript 🦺.

blog.beraliv.devRSS feed ↗51 posts

Latest posts

How I Earned the UK Global Talent Visa (Exceptional Talent)

A breakdown of the key projects, open-source work, and professional achievements that helped me secure the UK Global Talent visa in tech. This post highlights the impact and leadership demonstrated through real-world engineering initiatives.

A story of an unknown low-tier device and its MSE issues / London Video Tech 2023 notes

To highlight specifics of working with low-tier devices, to demonstrate its MSE issues and to show how to mitigate them.

With or without enums in TypeScript

Pros and cons of enums in TypeScript

Transform string literal type into camelCase in TypeScript

Given a string in any case, returns a string in camel case

Advanced types / Holy.js 2021 notes

The power of TypeScript will be revealed by the example of several tasks from type-challenges of the hard level.

Extract object type with optional fields in TypeScript

Given an object, returns object with all optional fields

Convert string literal type into number literal type in TypeScript

Given a number as string literal type, returns a number as number literal type

Split string literal type in TypeScript

Given a string and a separator, returns an array or a tuple with the substrings between the separator

Filter tuple type in TypeScript

Given a tuple and a filter, returns the tuple without elements that are part of the filter

TypeScript spread operator for 2 object types

Given two objects, returns the object which is formed as a spread of two objects in TypeScript

Math.abs for string literal type in TypeScript

Given a number as a string, return its absolute value as a string too

Transform string literal type into union of characters in TypeScript

Given a string, return a union of all characters from the string

Append key-value pair to object type in TypeScript

We have spread on objects in JavaScript so we can add value by the specified key, let's find out how to do that in TypeScript.

Flatten tuple type of tuples in TypeScript

Given the tuple, make it flatten as Array.prototype.flat when pass Infinity

Infer string length in TypeScript

Given the string, calculate its length. Also try to find the maximum computable string length having a limit of recursive calls

Calculate all permutations of union type in TypeScript

Given a union, return a union of tuples with all possible permutations (all possible positions of elements without repetition)

Append argument type into function type in TypeScript

Given the function and the type, include the type as the following argument in the list of function arguments

Replace all occurrences in string literal type in TypeScript

Given the string, replace all string occurrences with specified string

Replace occurrence in string literal type in TypeScript

Given the string, replace first string occurrence with specified string

Intrinsic string manipulation types in TypeScript

Uppercase, Lowercase, Capitalize and Uncapitalize since TypeScript 4.1

Trim string literal type in TypeScript

Given the string, remove whitespaces from the beginning and the end

Trim left part of string literal type in TypeScript

Given the string, remove whitespaces from the beginning

Opaque Types in TypeScript

Structural type system, workaround in TypeScript, unique symbol and code examples

Extract under the hood in TypeScript

Given a union of several types, remove those types which doesn't extend the specified structure

Promise.all types under the hood in TypeScript

Given the tuple with Promise elements, return Promise of tuple

Manipulation with elements of tuple type in TypeScript

Given the tuple, implement Pop, Shift, Push and Unshift methods like Array.prototype has

Infer last element of tuple type in TypeScript

Given the tuple, return its last element

Chainable options type in TypeScript

Given API, collect the object with keys and values after each call

Transform tuple type into a union in TypeScript

Given the tuple, return a union of tuple elements

Recursive readonly object type in TypeScript

Given the object, return object where all properties on all levels are readonly

Conditionally readonly object type in TypeScript

Given the object and a union of properties, return object where those properties are readonly

Omit type under the hood in TypeScript

Given the object and a union of properties, return the object but without those properties

ReturnType under the hood in TypeScript

Given the function, we need to extract what it returns

Includes type in TypeScript

Given the tuple and the type, return true if the type is an element of the tuple. Otherwise, return false

TypeScript spread operator for 2 tuple types

Given two tuples, put the elements of both of them into the resulting tuple

If statement type in TypeScript

Given the boolean, in case of true return first type, otherwise second one

Awaited type under the hood in TypeScript

Given the promise, return the value after applying await recursively

Exclude type under the hood in TypeScript

Given two unions, remove all the elements of the second one from the first union

Infer tuple length in TypeScript

Given the tuple, return its length

Infer first element of tuple type in TypeScript

Given the tuple, return its first element

Transform tuple type into object type with same key and value in TypeScript

Given the tuple, we need to get object where key and value equals to the elements of the tuple

Readonly type under the hood in TypeScript

Given the object, we need to make properties on the first level readonly

Pick type under the hood in TypeScript

Given existing type or interface, we need to extract part of properties

List of Type Challenges problems and solutions

Easy, medium, hard and extreme step by step solutions to type challenges in TypeScript

Type-safe get function that extracts the value by paths in TypeScript

Basic implementation of getting a value in an object, optional paths, array and tuples, one solution with connection to JavaScript

Working in Video Advertising player at Yandex

Developed features, team members and collaboration inside the team

Code obfuscation in Joyn video player (2020 edition)

Code obfuscation using confusion and the way how to make it readable again

Subtitles, statistics and DRM in Udemy video player (2020 edition)

Subtitles with WebVTT, statistics and DRM

Geolocation identification in BBC iPlayer (2019 edition)

Geolocation identification in iPlayer

State machine and bundles in Amazon video player (2019 edition)

From video tag to the implementation, state machine, the way bundle is loaded, bundle names