keystone
Version:
Web Application Framework and Admin GUI / Content Management System built on Express.js and Mongoose
19 lines (15 loc) • 441 B
JavaScript
/**
* Exports an object of lists, keyed with their key instead of their name and
* wrapped with the List helper (./List.js)
*/
import List from './List';
exports.listsByKey = {};
exports.listsByPath = {};
for (const key in Keystone.lists) {
// Guard for-ins
if ({}.hasOwnProperty.call(Keystone.lists, key)) {
var list = new List(Keystone.lists[key]);
exports.listsByKey[key] = list;
exports.listsByPath[list.path] = list;
}
}