Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@beyonk/content-delivery

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beyonk/content-delivery - npm Package Compare versions

Comparing version 1.0.7 to 1.1.0

2

lib/content-delivery.js
import { extension } from './mime-type'
function getCdnUrl (metadata, width = 'large') {
const base = [`https://adaptive.delivery/api/v1`]
const base = [ process.env.cdnBaseUrl ]

@@ -6,0 +6,0 @@ base.push('beyonk')

@@ -6,8 +6,16 @@ 'use strict'

describe('cdn-url', () => {
before(() => {
process.env.cdnBaseUrl = 'https://test.adaptive.delivery/api/v1'
})
after(() => {
delete process.env.cdnBaseUrl
})
describe('#getCdnUrl()', () => {
context('with image descriptor', () => {
const scenarios = [
{ size: 'small', expected: 'https://adaptive.delivery/api/v1/beyonk/q/small/something%2Fabc123.webp' },
{ size: 'tiny', expected: 'https://adaptive.delivery/api/v1/beyonk/q/tiny/something%2Fabc123.webp' },
{ size: undefined, expected: 'https://adaptive.delivery/api/v1/beyonk/q/large/something%2Fabc123.webp' }
{ size: 'small', expected: 'https://test.adaptive.delivery/api/v1/beyonk/q/small/something%2Fabc123.webp' },
{ size: 'tiny', expected: 'https://test.adaptive.delivery/api/v1/beyonk/q/tiny/something%2Fabc123.webp' },
{ size: undefined, expected: 'https://test.adaptive.delivery/api/v1/beyonk/q/large/something%2Fabc123.webp' }
]

@@ -45,3 +53,3 @@

getCdnUrl(descriptor)
).to.equal('https://adaptive.delivery/api/v1/beyonk/q/large/missing.jpeg')
).to.equal('https://test.adaptive.delivery/api/v1/beyonk/q/large/missing.jpeg')
})

@@ -48,0 +56,0 @@ })

{
"name": "@beyonk/content-delivery",
"version": "1.0.7",
"version": "1.1.0",
"description": "Beyonk Content Delivery Utils",

@@ -29,3 +29,3 @@ "author": "Antony Jones <aj@desirableobjects.co.uk>",

},
"gitHead": "96cf1ae518bedbe531fcb37788a0b907d3007a3a"
"gitHead": "785fc457bb53ca2528509f411a4a2cbc7f9dfee7"
}
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