mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2025-03-02 07:13:22 +00:00
17 lines
297 B
JavaScript
17 lines
297 B
JavaScript
|
"use strict";
|
||
|
|
||
|
// Method which caches a single instance for each author
|
||
|
|
||
|
var Authors = (function () {
|
||
|
var authors = {};
|
||
|
|
||
|
return function (author) {
|
||
|
if (authors[author.id]) {
|
||
|
return authors[author.id]
|
||
|
} else {
|
||
|
return authors[author.id] = author;
|
||
|
}
|
||
|
};
|
||
|
})();
|
||
|
|
||
|
module.exports = Authors;
|