Options
All
  • Public
  • Public/Protected
  • All
Menu

jupyter-js-utils

Index

Functions

ajaxRequest

  • Asynchronous XMLHTTPRequest handler.

    Parameters

    • url: string

      The url to request.

    • settings: IAjaxSettings

      The settings to apply to the request and response.

      Notes

      Based on this example.

    Returns Promise<IAjaxSuccess>

copy

  • copy(object: any): any
  • Get a copy of an object, or null.

    Parameters

    • object: any

    Returns any

encodeURIComponents

  • encodeURIComponents(uri: string): string
  • Encode just the components of a multi-segment uri.

    Preserves the '/' separators.

    Parameters

    • uri: string

    Returns string

extend

  • extend(target: any, source: any): any
  • Copy the contents of one object to another, recursively.

    From stackoverflow.

    Parameters

    • target: any
    • source: any

    Returns any

getBaseUrl

  • getBaseUrl(): string
  • Get the base URL for a Jupyter application.

    Returns string

getConfigOption

  • getConfigOption(name: string): string
  • Get global configuration data for the Jupyter application.

    Parameters

    • name: string

      The name of the configuration option.

    Returns string

    The config value or undefined if not found.

    Notes

    For browser based applications, it is assumed that the page HTML includes a script tag with the id jupyter-config-data containing the configuration as valid JSON.

getWsUrl

  • getWsUrl(baseUrl?: string): string
  • Get the base websocket URL for a Jupyter application.

    Parameters

    • Optional baseUrl: string

    Returns string

jsonToQueryString

  • jsonToQueryString(json: any): string
  • Return a serialized object string suitable for a query.

    From stackoverflow.

    Parameters

    • json: any

    Returns string

loadObject

  • loadObject(name: string, moduleName: string, registry?: object): Promise<any>
  • Try to load an object from a module or a registry.

    Try to load an object from a module asynchronously if a module is specified, otherwise tries to load an object from the global registry, if the global registry is provided.

    Parameters

    • name: string
    • moduleName: string
    • Optional registry: object
      • [key: string]: any

    Returns Promise<any>

shallowEquals

  • shallowEquals(o1: any, o2: any): boolean
  • Check for shallow equality of two objects.

    Parameters

    • o1: any
    • o2: any

    Returns boolean

urlJoinEncode

  • urlJoinEncode(...args: string[]): string
  • Encode and join a sequence of url components with '/'.

    Parameters

    • Rest ...args: string[]

    Returns string

urlPathJoin

  • urlPathJoin(...paths: string[]): string
  • Join a sequence of url components with '/'.

    Parameters

    • Rest ...paths: string[]

    Returns string

uuid

  • uuid(): string
  • Get a random 32 character hex string (not a formal UUID)

    Returns string

Generated using TypeDoc