New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mux/blurhash

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mux/blurhash - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2-canary.0-04f2548

13

dist/index.js

@@ -43,4 +43,10 @@ import sharp from 'sharp';

const muxBlurHash = async (playbackId, options = {}) => {
if (typeof playbackId !== 'string') {
throw new TypeError(`[@mux/blurhash] playbackId error. Expected a string, got ${typeof playbackId}`);
}
let url = `https://image.mux.com/${playbackId}/thumbnail.png`;
if (typeof options.time !== 'undefined' || typeof options.thumbnailToken !== 'undefined') {
if (typeof options.time !== 'undefined' && typeof options.thumbnailToken !== 'undefined') {
console.warn('[@mux/blurhash] When thumbnailToken is set, time will have no effect. Encode time in your token. See https://docs.mux.com/guides/video/secure-video-playback for more information.');
}
url += '?';

@@ -56,3 +62,8 @@ if (typeof options.time !== 'undefined') {

if (response.status === 403) {
throw new Error(`[@mux/blurhash] Error fetching thumbnail. 403: Forbidden. This Playback ID may require a thumbnail token. See https://docs.mux.com/guides/video/secure-video-playback for more information.`);
if (typeof options.thumbnailToken !== 'undefined') {
throw new Error(`[@mux/blurhash] Error fetching thumbnail. 403: Forbidden. The thumbnailToken option may be invalid. See https://docs.mux.com/guides/video/secure-video-playback for more information.`);
}
else {
throw new Error(`[@mux/blurhash] Error fetching thumbnail. 403: Forbidden. This Playback ID may require a thumbnail token. See https://docs.mux.com/guides/video/secure-video-playback for more information.`);
}
}

@@ -59,0 +70,0 @@ else if (response.status >= 400) {

2

package.json
{
"name": "@mux/blurhash",
"version": "0.1.1",
"version": "0.1.2-canary.0-04f2548",
"type": "module",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -58,5 +58,15 @@ import sharp from 'sharp';

const muxBlurHash = async (playbackId: string, options: MuxBlurHashOptions = {}) => {
if (typeof playbackId !== 'string') {
throw new TypeError(
`[@mux/blurhash] playbackId error. Expected a string, got ${typeof playbackId}`
);
}
let url = `https://image.mux.com/${playbackId}/thumbnail.png`;
if (typeof options.time !== 'undefined' || typeof options.thumbnailToken !== 'undefined') {
if (typeof options.time !== 'undefined' && typeof options.thumbnailToken !== 'undefined') {
console.warn(
'[@mux/blurhash] When thumbnailToken is set, time will have no effect. Encode time in your token. See https://docs.mux.com/guides/video/secure-video-playback for more information.'
);
}
url += '?';

@@ -74,5 +84,11 @@ if (typeof options.time !== 'undefined') {

if (response.status === 403) {
throw new Error(
`[@mux/blurhash] Error fetching thumbnail. 403: Forbidden. This Playback ID may require a thumbnail token. See https://docs.mux.com/guides/video/secure-video-playback for more information.`
);
if (typeof options.thumbnailToken !== 'undefined') {
throw new Error(
`[@mux/blurhash] Error fetching thumbnail. 403: Forbidden. The thumbnailToken option may be invalid. See https://docs.mux.com/guides/video/secure-video-playback for more information.`
);
} else {
throw new Error(
`[@mux/blurhash] Error fetching thumbnail. 403: Forbidden. This Playback ID may require a thumbnail token. See https://docs.mux.com/guides/video/secure-video-playback for more information.`
);
}
} else if (response.status >= 400) {

@@ -79,0 +95,0 @@ throw new Error(

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc