Despite the market's dour mood on Friday, shares of Meta Platforms (META 0.84%) rallied, gaining as much as 3.1%. As of 3:03 p.m. ET, the stock was still up 1.9%.

It was not one catalyst that sent the social media and artificial intelligence (AI) giant higher, but rather a flurry of developments, each from a different quarter.

When it rains, it pours

The first major development was in the Supreme Court case brought by TikTok. Congress recently passed a law, scheduled to take effect on Jan. 19, that would effectively ban the social media platform in the U.S. if it isn't sold by its parent company in China. That law cited national security concerns and TikTok's close ties with the Chinese government. Based on how they approached the question during oral arguments in the case on Friday, it appears a majority of justices are inclined to let the law take effect.

Chief Justice John Roberts asked TikTok's lawyer, "Are we supposed to ignore the fact that the ultimate parent is, in fact, subject to doing intelligence work for the Chinese government?" This seems to suggest the ban will go through. Since TikTok is one of Meta Platforms' biggest competitors, this would no doubt benefit the Facebook and Instagram parent.

The second development was some positive commentary from Wall Street. Analysts at KeyBanc maintained their overweight (buy) rating on Meta while increasing their 12-month price target for the stock to $700 -- 15% higher than Wednesday's closing price. The analysts believe Meta's heavy investments in AI are the right strategy to drive future success.

Finally, some investors were apparently reacting positively to an Axios report that Meta is ending its diversity, equity, and inclusion programs. Axios cited an internal memo from Meta that stated the company is making the move as the "legal and policy landscape surrounding diversity, equity, and inclusion efforts in the United States is changing."

Is the stock a buy?

Meta has been one of Wall Street's star performers over the past two years. The stock has gained 369% (as of this writing), making it the second-best performer among the "Magnificent Seven" stocks, trailing only Nvidia.

Despite those impressive gains, however, Meta still trades for 29 times earnings, an attractive valuation for a company with so much opportunity.