Skip to content

@fibbojs / util / FAssetUtil

Class: FAssetUtil

A class that provides asset management utilities.

Constructors

new FAssetUtil()

new FAssetUtil(): FAssetUtil

Returns

FAssetUtil

Methods

interpretPath()

static interpretPath(path): string

Smartly interpret a path to an asset.

  • URL paths are returned as is.
  • Absolute paths are interpreted as relative to the origin.
  • Relative paths are interpreted as relative to the assets folder. This method uses the current window location to determine the origin, so it should only be used in a browser environment.

Parameters

path: string

The path to interpret.

Returns

string

The interpreted path.

Defined in

util/src/FAssetUtil.ts:22

Properties

__ASSETS_PATH__

static __ASSETS_PATH__: string = 'assets'

The path to the assets directory.

Default

ts
'assets'

Defined in

util/src/FAssetUtil.ts:11