You are here

protected function LocalRemoteAssetTrait::processJsAssets in Libraries API 8.3

Gets the JavaScript assets attached to this library.

Parameters

array $assets:

Return value

array An array of JavaScript assets of the library. The keys of the array are the file paths of the JavaScript files and the values are JavaScript options.

See also

\Drupal\libraries\ExternalLibrary\Asset\SingleAssetLibraryTrait::getJsAssets()

File

src/ExternalLibrary/Asset/LocalRemoteAssetTrait.php, line 98

Class

LocalRemoteAssetTrait
A trait for asset libraries that serve local and remote files.

Namespace

Drupal\libraries\ExternalLibrary\Asset

Code

protected function processJsAssets(array $assets) {

  // @todo Consider somehow caching the processed information.
  $processed_assets = [];

  // @todo Somehow consolidate this with getCssAssets().
  foreach ($assets as $filename => $options) {
    $processed_assets[$this
      ->getPathPrefix() . '/' . $filename] = $options;
  }
  return $processed_assets;
}