M
M
Max Zhukov2018-11-19 18:37:42
JavaScript
Max Zhukov, 2018-11-19 18:37:42

How to organize a list of files and folders with a nesting level in an object for work?

How to organize a list of files and folders with a nesting level in an object for work? To make it convenient to display them and when you click a folder, files and folders in the selected folder are loaded.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Spirin, 2018-11-20
@MaksZhukov

Something like:

[
  {
    name: 'some_name',
    type: 'folder',
    isHidden: false,
    size: 23123,
    created_at: 4342323434,
    edited_at: 3453123434,
    path: '/some_place/some_name',
    children: [],
    childrenLength: 4,
    access_rights: [],
  },
  {
    name: 'some_image.png',
    type: 'file',
    isHidden: false,
    size: 23123,
    created_at: 4342323434,
    edited_at: 3453123434,
    path: '/some_place/some_image.png',
    access_rights: [],
  },
]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question