1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-10-30 14:46:19 +00:00
TiddlyWiki5/plugins/tiddlywiki/tw2parser/entry.js
Mario Pietsch 231a39e743
Fix whitespace in all plugins for v5.3.6 (#8285)
* Fix whitespace in all plugins for v5.3.5

* remove const to var chanes
2024-08-20 16:33:07 +01:00

31 lines
555 B
JavaScript

/*\
title: $:/macros/tiddlywiki/entry.js
type: application/javascript
module-type: macro
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Information about this macro
returns value of key in a data json tiddler
note that macros are not connected with the refresh mechanism -use with caution.
*/
exports.name = "entryof";
exports.params = [
{ name: "key" }, { name: "map" }
];
/*
Run the macro
*/
exports.run = function(key,map) {
try {
return JSON.parse(map)[key];
} catch(e) {
return "";
}
}
})();