refactor: merge branch 'main' into refactor/monorepo
This commit is contained in:
@@ -8,9 +8,9 @@ import { map } from "rxjs/operators"
|
||||
*
|
||||
* @returns The constructed object observable
|
||||
*/
|
||||
export function constructFromStreams<T>(
|
||||
streamObj: { [key in keyof T]: Observable<T[key]> }
|
||||
): Observable<T> {
|
||||
export function constructFromStreams<T>(streamObj: {
|
||||
[key in keyof T]: Observable<T[key]>
|
||||
}): Observable<T> {
|
||||
return combineLatest(Object.values<Observable<T[keyof T]>>(streamObj)).pipe(
|
||||
map((streams) => {
|
||||
const keys = Object.keys(streamObj) as (keyof T)[]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export const decodeB64StringToArrayBuffer = (input) => {
|
||||
export function decodeB64StringToArrayBuffer(input: string): ArrayBuffer {
|
||||
const bytes = Math.floor((input.length / 4) * 3)
|
||||
const ab = new ArrayBuffer(bytes)
|
||||
const uarray = new Uint8Array(ab)
|
||||
@@ -1,12 +0,0 @@
|
||||
export function getSourcePrefix(source) {
|
||||
const sourceEmojis = {
|
||||
// Source used for info messages.
|
||||
info: "\tℹ️ [INFO]:\t",
|
||||
// Source used for client to server messages.
|
||||
client: "\t⬅️ [SENT]:\t",
|
||||
// Source used for server to client messages.
|
||||
server: "\t➡️ [RECEIVED]:\t",
|
||||
}
|
||||
if (Object.keys(sourceEmojis).includes(source)) return sourceEmojis[source]
|
||||
return ""
|
||||
}
|
||||
12
packages/hoppscotch-app/helpers/utils/string.ts
Normal file
12
packages/hoppscotch-app/helpers/utils/string.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
const sourceEmojis = {
|
||||
// Source used for info messages.
|
||||
info: "\tℹ️ [INFO]:\t",
|
||||
// Source used for client to server messages.
|
||||
client: "\t⬅️ [SENT]:\t",
|
||||
// Source used for server to client messages.
|
||||
server: "\t➡️ [RECEIVED]:\t",
|
||||
}
|
||||
|
||||
export function getSourcePrefix(source: keyof typeof sourceEmojis) {
|
||||
return sourceEmojis[source]
|
||||
}
|
||||
Reference in New Issue
Block a user