Skip to content

Latest commit

 

History

History
66 lines (42 loc) · 1.22 KB

asset.md

File metadata and controls

66 lines (42 loc) · 1.22 KB

Asset

Properties

  • type String Asset type, eg. 'image'.
  • src String Asset URL, eg. 'https://.../image.png'.

getType

Get asset type.

Examples

// Asset: { src: 'https://.../image.png', type: 'image' }
asset.getType(); // -> 'image'

Returns String

getSrc

Get asset URL.

Examples

// Asset: { src: 'https://.../image.png'  }
asset.getSrc(); // -> 'https://.../image.png'

Returns String

getFilename

Get filename of the asset (based on src).

Examples

// Asset: { src: 'https://.../image.png' }
asset.getFilename(); // -> 'image.png'
// Asset: { src: 'https://.../image' }
asset.getFilename(); // -> 'image'

Returns String

getExtension

Get extension of the asset (based on src).

Examples

// Asset: { src: 'https://.../image.png' }
asset.getExtension(); // -> 'png'
// Asset: { src: 'https://.../image' }
asset.getExtension(); // -> ''

Returns String