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 = HashMap.of(
    ['111', 'playing'],
    ['112', 'stopped'],
    ['113', 'paused'],
    ['222', 'volumeChange'],
    ['999', 'info']
)

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

prelude-ts

A typescript functional programming library

ISC
Latest version published 2 years ago

Package Health Score

48 / 100
Full package analysis