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

strapi-cdn-url-rewrite

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strapi-cdn-url-rewrite - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

28

index.js

@@ -15,3 +15,3 @@ const flatten = require('flat')

) {
this.orignal = storageUrl
this.storage = storageUrl
this.cdn = cdnUrl

@@ -25,20 +25,16 @@ } else {

try {
if (data && data.constructor === Object) {
const flattened = flatten(data)
const flattened = flatten(data)
let matches = []
for (let prop in flattened) {
if (typeof flattened[prop] == 'string' && flattened[prop].includes(this.storage)) {
matches.push({
prop,
value: flattened[prop].replace(this.storage, this.cdn)
})
}
let matches = []
for (let prop in flattened) {
if (typeof flattened[prop] == 'string' && flattened[prop].includes(this.storage)) {
matches.push({
prop,
value: flattened[prop].replace(this.storage, this.cdn)
})
}
}
matches.forEach(match => dset(data, match.prop, match.value))
return data
} else {
throw new Error('`data` must be valid object')
}
matches.forEach(match => dset(data, match.prop, match.value))
return data
} catch (err) {

@@ -45,0 +41,0 @@ console.error(err)

{
"name": "strapi-cdn-url-rewrite",
"version": "0.0.3",
"version": "0.0.4",
"description": "Strapi controller module to rewrite upload URLs to CDN",

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

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