PHP 8.2.30
Preview: remove-path.doc.md Size: 1.21 KB
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/lib/utils/flat/remove-path.doc.md

This method removes the given path from the flatten object.

Most of the time removing one path is a trivial thing but when it comes to arrays it is more
complicated than just simply removing its key.


### Usage

```javascript

import { flat } from 'adminjs'

// do something with flat.removePath
const paramsWithoutName = flat.removePath(otherParams, 'name.0')
```

### Why it exists?

Take a look at this example:

having the flatten object

```javascript
{
  'property.0': 'val1',
  'property.1': 'val2',
  'property.2': 'val3',
}
```

you want to remove `property.1` path. In order to do this you will need to remove key `property.1`
and rename `property.2` to `property.1`

and take a look at this example:

```javascript
{
  name: 'value',
  'notPopulated.0': 'val1',
  'notPopulated.1': 'val2',
  'property.0': 'val1',
  'property.1': 'val2',
  'property.2': 'val3',
  'property.3.nested.0': 'val1',
  'property.3.nested.1': 'val2',
  'property.3.nested.2': 'val3',
  'property.3.nested.3.some': 'val3',
  'property.3.nested.4.some-other': 'val41',
  'property.4': 'val4',
  'property.5.nested.0': 'val5',
}
```

what should happen when you want to remove `property.3.nested.3.some` ?

This function solves these problems for you.

Directory Contents

Dirs: 0 × Files: 26

Name Size Perms Modified Actions
44 B lrw-r--r-- 2026-02-28 00:31:26
Edit Download
448 B lrw-r--r-- 2026-02-28 00:31:56
Edit Download
722 B lrw-r--r-- 2026-02-28 00:31:30
Edit Download
1.40 KB lrw-r--r-- 2026-02-28 00:31:30
Edit Download
906 B lrw-r--r-- 2026-02-28 00:31:32
Edit Download
2.74 KB lrw-r--r-- 2026-02-28 00:31:56
Edit Download
10 B lrw-r--r-- 2026-02-28 00:31:34
Edit Download
587 B lrw-r--r-- 2026-02-28 00:31:56
Edit Download
2.35 KB lrw-r--r-- 2026-02-28 00:31:34
Edit Download
2.75 KB lrw-r--r-- 2026-02-28 00:31:34
Edit Download
66 B lrw-r--r-- 2026-02-28 00:31:44
Edit Download
567 B lrw-r--r-- 2026-02-28 00:31:46
Edit Download
2.11 KB lrw-r--r-- 2026-02-28 00:31:46
Edit Download
10 B lrw-r--r-- 2026-02-28 00:31:48
Edit Download
730 B lrw-r--r-- 2026-02-28 00:31:56
Edit Download
701 B lrw-r--r-- 2026-02-28 00:31:48
Edit Download
814 B lrw-r--r-- 2026-02-28 00:31:48
Edit Download
1.21 KB lrw-r--r-- 2026-02-28 00:31:56
Edit Download
1.34 KB lrw-r--r-- 2026-02-28 00:31:48
Edit Download
2.47 KB lrw-r--r-- 2026-02-28 00:31:48
Edit Download
504 B lrw-r--r-- 2026-02-28 00:31:56
Edit Download
904 B lrw-r--r-- 2026-02-28 00:31:48
Edit Download
1.48 KB lrw-r--r-- 2026-02-28 00:31:48
Edit Download
639 B lrw-r--r-- 2026-02-28 00:31:56
Edit Download
1.85 KB lrw-r--r-- 2026-02-28 00:31:48
Edit Download
4.64 KB lrw-r--r-- 2026-02-28 00:31:48
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).