mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-02-24 10:59:49 +00:00
* fix: apply automatic eslint fixes * lint: allow hashbang comment for tiddlywiki.js * lint: first back of manual lint fixes for unused vars * lint: added more fixes for unused vars * lint: missed files * lint: updated eslint config with selected rules from #9669
27 lines
476 B
JavaScript
27 lines
476 B
JavaScript
/*\
|
|
title: $:/macros/tiddlywiki/entry.js
|
|
type: application/javascript
|
|
module-type: macro
|
|
\*/
|
|
"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 "";
|
|
}
|
|
};
|