swc/packages/helpers/esm/_sliced_to_array.js
Jiwon Choi 69719c2acb
refactor(es/helpers): Remove unnecessary exports (#9225)
**Description:**

Helper methods were exporting twice, `_` and it's own function name.
We can map the build script to export `_` as it's own name (filename).
Therefore we export only once as `_`, and map the name on the build
script.

```js
// helpers/_foo.js

function _foo() {
  // ...
}

export { _foo as _ }
```
```js
// index.js

// We know the func name will be `_foo` based on the filename.
export { _ as _foo } from '_foo.js'
```

Closes #9203

---------

Co-authored-by: magic-akari <akari.ccino@gmail.com>
2024-07-13 17:13:25 +09:00

10 lines
512 B
JavaScript

import { _ as _array_with_holes } from "./_array_with_holes.js";
import { _ as _iterable_to_array_limit } from "./_iterable_to_array_limit.js";
import { _ as _non_iterable_rest } from "./_non_iterable_rest.js";
import { _ as _unsupported_iterable_to_array } from "./_unsupported_iterable_to_array.js";
function _sliced_to_array(arr, i) {
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
}
export { _sliced_to_array as _ };