swc/packages/helpers/esm/_class_static_private_field_destructure.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

12 lines
678 B
JavaScript

import { _ as _class_apply_descriptor_destructure } from "./_class_apply_descriptor_destructure.js";
import { _ as _class_check_private_static_access } from "./_class_check_private_static_access.js";
import { _ as _class_check_private_static_field_descriptor } from "./_class_check_private_static_field_descriptor.js";
function _class_static_private_field_destructure(receiver, classConstructor, descriptor) {
_class_check_private_static_access(receiver, classConstructor);
_class_check_private_static_field_descriptor(descriptor, "set");
return _class_apply_descriptor_destructure(receiver, descriptor);
}
export { _class_static_private_field_destructure as _ };