Skip to content

Latest commit

 

History

History
90 lines (66 loc) · 3.66 KB

LoaderUtils.md

File metadata and controls

90 lines (66 loc) · 3.66 KB

LoaderUtils

Kind: global class

new LoaderUtils()

Various single use utilities for file names & paths, and query manipulations.

import { LoaderUtils } from 'ad-load'

LoaderUtils.createXMLHttpRequest() ⇒ XMLHttpRequest

Kind: static method of LoaderUtils

LoaderUtils.getFileName(url) ⇒ string

Kind: static method of LoaderUtils
Returns: string - Strips a file path and extension to return the file name

Param Type Description
url string A full file path including the file name

LoaderUtils.getFontName(url) ⇒ string

Kind: static method of LoaderUtils
Returns: string - Strips a file path and extension to return the file name

Param Type Description
url string A full file path including the file name

LoaderUtils.getFileType(url) ⇒ string

Kind: static method of LoaderUtils
Returns: string - Determines the file type and returns that

Param Type Description
url string A full file path including the file name

LoaderUtils.getFullUrl(prepend, file, platformGetUrl) ⇒ string

Kind: static method of LoaderUtils
Returns: string - Determines the full url path to a file by either matching the protocol or utilizing a platform tool, such as DoubleClick's Enabler.getUrl

Param Type Description
prepend string The file path
file string The file name with extension
platformGetUrl function Optional platform specific url formatter

LoaderUtils.getUrlPrepend(path) ⇒ string

Kind: static method of LoaderUtils
Returns: string - Removes the file name and extension to retun only the path

Param Type Description
path string A full file path including the file name

LoaderUtils.getParamsFromData(query) ⇒ string

Kind: static method of LoaderUtils
Returns: string - Formats a query string and returns it

Param Type Description
query string | object A query string or object of key/value pairs