sortBy(sorter) {
        sorter = sorter || this._tree.config.sort;

        // Only apply sort if one provided
        if (sorter) {
            this.batch();

            const sorted = sortBy(this, sorter);

            this.length = 0;
            each(sorted, node => {
                this.push(node);
            });

            this.indicesDirty = true;

            this.end();
        }

        return this;
    }
Sorts all TreeNode objects in this collection.

If no custom sorter given, the configured "sort" value will be used.

@param {string|function} sorter Sort function or property name.
@return {TreeNodes} Array of node objects.