Skip to content

Commit

Permalink
@transloadit/enrich-tweet: use dynamic import to fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Murderlon committed May 7, 2024
1 parent 15e1116 commit e2eebcc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/enrich-tweet/src/enrichTweet.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import twttr = require('twitter-text')
import tall = require('tall')

import getUrls = require('get-urls')

async function tryUnshorten(url: string, unshorten: boolean): Promise<string> {
if (!unshorten) return url
try {
Expand Down Expand Up @@ -64,6 +62,7 @@ export = async function enrichTweet(tweet: Tweet, unshorten = true): Promise<str
}
}

const getUrls = (await import('get-urls')).default
const urls = getUrls(text)
for (const subUrl3 of urls) {
if (!subUrl3.match(/^https?:\/\/bit\.ly/)) {
Expand Down

0 comments on commit e2eebcc

Please sign in to comment.