mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-11 09:50:27 +00:00
adopted style recommendations
This commit is contained in:
parent
d0a24bd9f0
commit
91b5547cdf
@ -88,7 +88,7 @@ $tw.utils.each = function(object,callback) {
|
||||
Pushes a value to an array only when not yet contained.
|
||||
*/
|
||||
$tw.utils.pushOnce = function(array,value) {
|
||||
if(0 > array.indexOf(value)){
|
||||
if(array.indexOf(value) == -1) {
|
||||
array.push(value);
|
||||
}
|
||||
}
|
||||
|
@ -20,10 +20,10 @@ exports.each = function(source,operator,options) {
|
||||
var results =[] ,
|
||||
value,values = {},
|
||||
field = operator.operand || "title";
|
||||
if("list" !== operator.suffix) {
|
||||
if(operator.suffix !== "list") {
|
||||
source(function(tiddler,title) {
|
||||
if(tiddler) {
|
||||
value = "title" === field ? title : tiddler.getFieldString(field);
|
||||
value = (field === "title") ? title : tiddler.getFieldString(field);
|
||||
if(!$tw.utils.hop(values,value)) {
|
||||
values[value] = true;
|
||||
results.push(title);
|
||||
|
Loading…
Reference in New Issue
Block a user