mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-08-19 22:26:18 +00:00
![Jermolene](/assets/img/avatar_default.png)
See discussion here: https://groups.google.com/d/msgid/tiddlywiki/fe51b7f5-5369-493b-82e5-94c 18e863fe0%40googlegroups.com?utm_medium=email&utm_source=footer
27 lines
449 B
JavaScript
27 lines
449 B
JavaScript
/*\
|
|
title: $:/core/modules/filters/count.js
|
|
type: application/javascript
|
|
module-type: filteroperator
|
|
|
|
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++;
|
|
});
|
|
return [count + ""];
|
|
};
|
|
|
|
})();
|