vue-tweet-pure
Version:
A Vue 3 component for embedding tweets in your Vue.js applications.
2 lines (1 loc) • 811 B
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./fetch-tweet-BatlAg1x.cjs");async function c(t,e){const{data:r,tombstone:n,notFound:s}=await o.fetchTweet(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.`):n&&console.error(`The tweet ${t} has been made private by the account owner. Update your code to remove this tweet when possible.`),r}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}`)}exports.TwitterApiError=o.TwitterApiError;exports.fetchTweet=o.fetchTweet;exports.getOEmbed=i;exports.getTweet=c;