mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-08-29 20:42:44 +00:00
31 lines
582 B
JavaScript
31 lines
582 B
JavaScript
![]() |
/*\
|
||
|
title: $:/core/modules/filters/moduleproperty.js
|
||
|
type: application/javascript
|
||
|
module-type: filteroperator
|
||
|
|
||
|
Filter [[module-name]moduleproperty[name]] retrieve a module property
|
||
|
|
||
|
\*/
|
||
|
(function(){
|
||
|
|
||
|
/*jslint node: true, browser: true */
|
||
|
/*global $tw: false */
|
||
|
"use strict";
|
||
|
|
||
|
/*
|
||
|
Export our filter function
|
||
|
*/
|
||
|
exports.moduleproperty = function(source,operator,options) {
|
||
|
var results = [];
|
||
|
source(function(tiddler,title) {
|
||
|
var value = require(title)[operator.operand || ""];
|
||
|
if(value !== undefined) {
|
||
|
results.push(value);
|
||
|
}
|
||
|
});
|
||
|
results.sort();
|
||
|
return results;
|
||
|
};
|
||
|
|
||
|
})();
|