2021-12-05 09:46:09 +03:00
|
|
|
#!/bin/bash
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
files=$(ls ./src/_*.js | xargs -I "{}" basename {} .js)
|
|
|
|
lines=$(echo $files | tr " " "\n")
|
|
|
|
|
|
|
|
content='';
|
|
|
|
|
|
|
|
for src in $lines; do
|
|
|
|
name=$(echo $src | perl -pe 's/(^|_)./uc($&)/ge;s/_//g')
|
|
|
|
if [ $name = "classNameTdzError" ]; then
|
|
|
|
name='classNameTDZError';
|
|
|
|
fi
|
|
|
|
if [ $name = "typeof" ]; then
|
|
|
|
name='_typeof';
|
|
|
|
fi
|
|
|
|
if [ $name = "instanceof" ]; then
|
|
|
|
name='_instanceof';
|
|
|
|
fi
|
|
|
|
if [ $name = "throw" ]; then
|
|
|
|
name='_throw';
|
|
|
|
fi
|
2022-06-16 10:23:02 +03:00
|
|
|
echo "export { default as $name } from './$src.mjs';"
|
2021-12-05 09:46:09 +03:00
|
|
|
done
|