# Asset
# Properties
type
String (opens new window) Asset type, eg.'image'
.src
String (opens new window) Asset URL, eg.'https://.../image.png'
.
# getType
Get asset type.
# Examples
// Asset: { src: 'https://.../image.png', type: 'image' }
asset.getType(); // -> 'image'
Returns String (opens new window)
# getSrc
Get asset URL.
# Examples
// Asset: { src: 'https://.../image.png' }
asset.getSrc(); // -> 'https://.../image.png'
Returns String (opens new window)
# 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 (opens new window)
# 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 (opens new window)