notes and tweaks...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-11-25 17:46:59 +03:00
parent 145f6d7982
commit a96f7ed040

View File

@ -710,6 +710,8 @@ module.BaseStore = {
// | <cmp-func> // | <cmp-func>
// //
// //
// NOTE: to reverse search order prepend '-' to method name, e.g. cahnge
// 'path' to '-path', etc.
// NOTE: all path based <by> values are sync, not requireing a .gat(..) // NOTE: all path based <by> values are sync, not requireing a .gat(..)
// and thus faster than sorting via arbitrary <attr>... // and thus faster than sorting via arbitrary <attr>...
// NOTE: this performs a natural sort, i.e. numbers in strings are // NOTE: this performs a natural sort, i.e. numbers in strings are
@ -729,12 +731,10 @@ module.BaseStore = {
pwpath.basename(p)) }, pwpath.basename(p)) },
depth: function(p){ depth: function(p){
return pwpath.split(p).length }, return pwpath.split(p).length },
// XXX this only accounts for the first number...
number: function(p){ number: function(p){
return parseInt(p.split(/[^\d]+/) return p
.filter(function(e){ .split(/[^\d]+/g)
return e != '' }) .join(' ') },
.shift()) },
}, },
sort: function(paths, ...by){ sort: function(paths, ...by){
var that = this var that = this