Socket
Socket
Sign inDemoInstall

strapi-utils

Package Overview
Dependencies
Maintainers
6
Versions
282
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strapi-utils - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

18

lib/config.js

@@ -60,4 +60,22 @@ const _ = require('lodash');

const getAbsoluteUrl = adminOrServer => (config, forAdminBuild = false) => {
const { serverUrl, adminUrl } = getConfigUrls(config.server, forAdminBuild);
let url = adminOrServer === 'server' ? serverUrl : adminUrl;
if (url.startsWith('http')) {
return url;
}
let hostname =
config.environment === 'development' && ['127.0.0.1', '0.0.0.0'].includes(config.server.host)
? 'localhost'
: config.server.host;
return `http://${hostname}:${config.server.port}${url}`;
};
module.exports = {
getConfigUrls,
getAbsoluteAdminUrl: getAbsoluteUrl('admin'),
getAbsoluteServerUrl: getAbsoluteUrl('server'),
};

4

lib/index.js

@@ -25,3 +25,3 @@ 'use strict';

const { removeUndefined } = require('./objectFormatting');
const { getConfigUrls } = require('./config');
const { getConfigUrls, getAbsoluteAdminUrl, getAbsoluteServerUrl } = require('./config');

@@ -47,2 +47,4 @@ module.exports = {

removeUndefined,
getAbsoluteAdminUrl,
getAbsoluteServerUrl,
};
{
"name": "strapi-utils",
"version": "3.0.0",
"version": "3.0.1",
"description": "Shared utilities for the Strapi packages",

@@ -49,3 +49,3 @@ "homepage": "http://strapi.io",

"license": "MIT",
"gitHead": "6bb7a7f198b13b0780547285d4214704ce991c23"
"gitHead": "5b64e05d7f565d359f28dccb9d9917124d1ad453"
}
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