1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-05 01:26:18 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/system/if-macro.js
Tobias Beer 51739e3fd2 moved if-macro, see #2005
as per #2005 from @Evolena
2015-10-09 10:39:00 +02:00

27 lines
408 B
JavaScript

/*\
title: $:/editions/tw5.com/if-macro.js
type: application/javascript
module-type: macro
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.name = ".if";
exports.params = [
{ name: "cond" },
{ name: "then" },
{ name: "else" }
];
exports.run = function(cond, then, elze) {
then = then || "";
elze = elze || "";
return cond ? then : elze;
};
})();