Last active
November 25, 2023 04:09
-
-
Save vpctorr/5217a668544e88790e545cbe6914d34e to your computer and use it in GitHub Desktop.
Turf.js TypeScript 5 Patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl https://gist.githubusercontent.com/vpctorr/5217a668544e88790e545cbe6914d34e/raw/75420dcf22e73b80f027d3dd81dd42315284b044/turf_types_patch.sh | bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
directory="node_modules/@turf" | |
for subdir in $directory/*; do | |
package="$subdir/package.json" | |
if [[ -f "$package" ]]; then | |
types_value=$(jq -r .types $package) | |
if [[ "$types_value" != "null" ]]; then | |
types_value="./$types_value" | |
new_content=$(jq --arg types "$types_value" '.exports["."].types = $types' $package) | |
echo "$new_content" > $package | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment