Options
All
  • Public
  • Public/Protected
  • All
Menu

Module utils

Index

Functions

basename

  • basename(path: string): string

formatBytes

  • formatBytes(bytes: number): string

interpolate

  • interpolate(pod: Pod, string: string, params: any): any
  • Applies string interpolation to a given string. For example, if a given string is Hello ${name} and the params are {string: 'World'}, the result of calling the interpolation is "Hello World".

    Typically, this would be used with the pod object to provide the ability to refer to pod content: Hello ${pod.meta.title}, and then providing params such as: {pod: <Pod instance>}. The value of pod.meta would be specified within amagaki.ts.

    Parameters

    • pod: Pod

      The pod.

    • string: string

      A string to interpolate.

    • params: any

      The parameters to use for interpolation.

    Returns any

    The interpolated string.

localizeData

  • localizeData(data: any, locale: Locale): any

queryObject

  • queryObject(query: string | undefined, data: any): any
  • Returns data queried from a YAML file. Use by specifying a query, such as 'foo.bar'. This will return the value nested under the keys: {foo: {bar: 'value'}}.

    Parameters

    • query: string | undefined
    • data: any

      An object mapping keys to values.

    Returns any

    The YAML content at the specified query.

splitFrontMatter

walk

  • walk(path: string, newFiles?: string[], removePrefix?: string): string[]
  • Parameters

    • path: string
    • Optional newFiles: string[]
    • Optional removePrefix: string

    Returns string[]

Generated using TypeDoc