1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-07-08 13:04:21 +00:00
TiddlyWiki5/core/modules/filters/count.js

27 lines
447 B
JavaScript
Raw Normal View History

/*\
title: $:/core/modules/filters/count.js
type: application/javascript
2022-08-30 17:01:46 +00:00
module-type: newfilteroperator
Filter operator returning the number of entries in the current list.
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.count = function(source,operator,options) {
var count = 0;
source(function(tiddler,title) {
count++;
});
2022-08-30 17:01:46 +00:00
return [count];
};
})();