Skip to content

Instantly share code, notes, and snippets.

@hades2510
Created November 3, 2022 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hades2510/295b42799de4112f41b162c479a79a40 to your computer and use it in GitHub Desktop.
Save hades2510/295b42799de4112f41b162c479a79a40 to your computer and use it in GitHub Desktop.
type ShiftLeft<T extends Byte> = T extends [
infer U extends Bit,
...infer R extends Bit[]
]
? [...R, Zero]
: never;
type ShiftRight<T extends Byte> = T extends [
...infer U extends Bit[],
infer R extends Bit
]
? [Zero, ...U]
: never;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment