1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-07-03 02:33:15 +00:00
TiddlyWiki5/core/modules/filters/indexes.js
Jermolene b7f674c51a First pass at refactoring filter execution
This is the beginning of addressing #523.
2014-04-03 20:49:16 +01:00

31 lines
563 B
JavaScript

/*\
title: $:/core/modules/filters/indexes.js
type: application/javascript
module-type: filteroperator
Filter operator for returning the indexes of a data tiddler
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.indexes = function(source,operator,options) {
var results = [];
source(function(tiddler,title) {
var data = options.wiki.getTiddlerData(title);
if(data) {
$tw.utils.pushTop(results,Object.keys(data));
}
});
results.sort();
return results;
};
})();