mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 11:22:19 +03:00
parent
20507b5dd5
commit
8ccf7fd172
@ -4,7 +4,7 @@ var _ = require('lodash'),
|
||||
|
||||
/**
|
||||
* ### Filter Packages
|
||||
* Normalizes packages read by read-packages so that the themes module can use them.
|
||||
* Normalizes packages read by read-packages so that the apps and themes modules can use them.
|
||||
* Iterates over each package and return an array of objects which are simplified representations of the package
|
||||
* with 3 properties:
|
||||
* - `name` - the package name
|
||||
@ -17,10 +17,10 @@ var _ = require('lodash'),
|
||||
*
|
||||
* @param {object} packages as returned by read-packages
|
||||
* @param {array/string} active as read from the settings object
|
||||
* @returns {Array} of objects with useful info about themes
|
||||
* @returns {Array} of objects with useful info about apps / themes
|
||||
*/
|
||||
filterPackages = function filterPackages(packages, active) {
|
||||
// turn active into an array if it isn't one, so this function can deal with lists and one-offs
|
||||
// turn active into an array (so themes and apps can be checked the same)
|
||||
if (!Array.isArray(active)) {
|
||||
active = [active];
|
||||
}
|
||||
|
@ -3,7 +3,9 @@
|
||||
*
|
||||
* Ghost has / is in the process of gaining support for several different types of sub-packages:
|
||||
* - Themes: have always been packages, but we're going to lean more heavily on npm & package.json in future
|
||||
* - Adapters: replace fundamental pieces like storage, will become npm modules
|
||||
* - Adapters: an early version of apps, replace fundamental pieces like storage, will become npm modules
|
||||
* - Apps: plugins that can be installed whilst Ghost is running & modify behaviour
|
||||
* - More?
|
||||
*
|
||||
* These utils facilitate loading, reading, managing etc, packages from the file system.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user