How to use the prelude-ts.HashMap.of function in prelude-ts

To help you get started, we’ve selected a few prelude-ts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github klemola / foobar2000-web-ui / server / Message.ts View on Github external
import { Vector, HashMap, Option } from 'prelude-ts'
import { Result, Failure } from 'runtypes'

import {
    Message,
    TrackInfo,
    InfoMessage,
    StatusType,
    VolumeMessage
} from './Models'
import { failure, success, mapSuccess } from './Util'

const statusCodes: HashMap<string, StatusType> = HashMap.of(
    ['111', 'playing'],
    ['112', 'stopped'],
    ['113', 'paused'],
    ['222', 'volumeChange'],
    ['999', 'info']
)

const trackInfoKeys: (keyof TrackInfo)[] = [
    'status',
    'secondsPlayed',
    'codec',
    'bitrate',
    'artist',
    'album',
    'date',
    'genre',