Class: FSModel

core.FSModel

Class representing a filesystem model.

new core.FSModel ()

Properties:
Name Type Description
directoriesFirst bool

(default: true) Whether to list directories first.

filesystem html.Filesystem

(default: null) The filesystem to use.

filter function

A filtering function. By default, hidden files are filtered out.

loading bool

[readonly] true if the model is currently being loaded.

path string

(default: "") The path represented by the model.

sorter function

A sorting function. By default, items are sorted in ascending case-insensitive order by their name.

Extends

Methods

makeFilter (withDirectories, withFiles, withHidden)function

Creates a filtering function for the filter property.

Name Type Description
withDirectories bool

Whether to include directories.

withFiles bool

Whether to include files.

withHidden bool

Whether to include hidden entries (name starting with .).

Returns:
Type Description
function The filtering function.

makeSorter (role, ascending)function

Creates a sorting function for the sorter property.

Name Type Description
role string

The sort role name.

ascending bool

Whether to sort in ascending order.

Returns:
Type Description
function The sorting function.