cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2018-12-13 22:59:06 +03:00
parent 38c155de0c
commit 9ece16bb5b

View File

@ -34,7 +34,12 @@ var util = require('lib/util')
/*********************************************************************/ /*********************************************************************/
// Helpers... // Helpers...
// normalize a split to either contain multiple values or a list... // Normalize a split that contains either multiple values or a list to
// a list enabling the following method signature:
//
// .someMethod(arg, ..)
// .someMethod([arg, ..])
//
var splitOrList = function(args){ var splitOrList = function(args){
return (args.length == 1 && args[0] instanceof Array) ? return (args.length == 1 && args[0] instanceof Array) ?
args.pop() args.pop()
@ -547,7 +552,7 @@ var TagsPrototype = {
return that.match(query, t, cmp) }) }, return that.match(query, t, cmp) }) },
// Introspection... // Introspection and Access API...
// //
get length(){ get length(){
return this.values().length }, return this.values().length },
@ -571,8 +576,6 @@ var TagsPrototype = {
return false return false
}, },
// Tags present in the system... // Tags present in the system...
// //
// Get all tags... // Get all tags...
@ -662,8 +665,9 @@ var TagsPrototype = {
.flat())] }, .flat())] },
// Add/Remove/Modify tags API... // Edit API...
// //
//
// Resolve alias (recursive)... // Resolve alias (recursive)...
// .alias(tag) // .alias(tag)
// -> value // -> value
@ -1301,8 +1305,10 @@ var TagsPrototype = {
}, },
// Object utility API... // Object utility API...
// //
//
// .clone() // .clone()
// .clone('full') // .clone('full')
// -> tags // -> tags
@ -1315,6 +1321,7 @@ var TagsPrototype = {
// Serialization... // Serialization...
// //
//
// .json() // .json()
// -> json // -> json
// //
@ -1383,6 +1390,8 @@ var TagsPrototype = {
return this return this
}, },
__init__: function(json){ __init__: function(json){
json json
&& this.load(json) }, && this.load(json) },