UNPKG

vue-tweet-pure

Version:

A Vue 3 component for embedding tweets in your Vue.js applications.

23 lines (22 loc) 823 B
import { f as n } from "./fetch-tweet-CzGg1NgE.js"; import { T as d } from "./fetch-tweet-CzGg1NgE.js"; async function c(t, e) { const { data: o, tombstone: r, notFound: s } = await n(t, e); return s ? console.error( `The tweet ${t} does not exist or has been deleted by the account owner. Update your code to remove this tweet when possible.` ) : r && console.error( `The tweet ${t} has been made private by the account owner. Update your code to remove this tweet when possible.` ), o; } async function i(t) { const e = await fetch(`https://publish.twitter.com/oembed?url=${t}`); if (e.ok) return e.json(); if (e.status !== 404) throw new Error(`Fetch for embedded tweet failed with code: ${e.status}`); } export { d as TwitterApiError, n as fetchTweet, i as getOEmbed, c as getTweet };