Index

Variables

Const messageSafeTypes

messageSafeTypes: Set<string> = new Set(["string","number","boolean","null","undefined",])

Messaging-safe copies of objects. Drops non-primitive properties.

Objects to be passed by messaging API must only comprise of the following, otherwise they're silently dropped. The silent drop is probably a bug. If you include a Symbol() you get a DataCloneError.

  • string
  • number
  • boolean
  • null
  • undefined
  • objects containing attributes only of the above types

    Could just copy all primitive attributes, but then we don't get the interface... If we have to do this again, consider generating automatically from typescript/lib/lib.dom.d.ts

Functions

KeyboardEvent

Node

generic

  • generic(obj: any): any
  • Messaging-safe, one level copy of obj

    Doesn't work for special objects like Events: Object.keys() is too parsimonious.

    Parameters

    • obj: any

    Returns any

generic_all_props

  • generic_all_props(obj: any): any
  • Messaging-safe, one level copy of obj

    Also looks at prototype properties. Works for e.g. Event.

    Parameters

    • obj: any

    Returns any

pick

  • pick(o: any, ...props: any[]): any