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

strapi-utils

Package Overview
Dependencies
Maintainers
10
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.6.6 to 3.6.7

4

lib/config.js
'use strict';
const _ = require('lodash');
const { getCommonBeginning } = require('./string-formatting');
const { getCommonPath } = require('./string-formatting');

@@ -49,3 +49,3 @@ const getConfigUrls = (serverConfig, forAdminBuild = false) => {

) {
adminPath = adminUrl.replace(getCommonBeginning(serverUrl, adminUrl), '');
adminPath = adminUrl.replace(getCommonPath(serverUrl, adminUrl), '');
adminPath = `/${_.trim(adminPath, '/')}`;

@@ -52,0 +52,0 @@ } else if (adminUrl.startsWith('http')) {

'use strict';
const _ = require('lodash');
const slugify = require('@sindresorhus/slugify');

@@ -9,14 +9,12 @@

const getCommonBeginning = (str1 = '', str2 = '') => {
let common = '';
let index = 0;
while (index < str1.length && index < str2.length) {
if (str1[index] === str2[index]) {
common += str1[index];
index += 1;
} else {
break;
}
}
return common;
const getCommonBeginning = (...strings) => _.takeWhile(
strings[0],
(char, index) => strings.every(string => string[index] === char)
).join('');
const getCommonPath = (...paths) => {
const [segments, ...otherSegments] = paths.map(it => _.split(it, '/'));
return _.join(
_.takeWhile(segments, (str, index) => otherSegments.every(it => it[index] === str))
, '/');
};

@@ -43,2 +41,3 @@

getCommonBeginning,
getCommonPath,
escapeQuery,

@@ -45,0 +44,0 @@ stringIncludes,

{
"name": "strapi-utils",
"version": "3.6.6",
"version": "3.6.7",
"description": "Shared utilities for the Strapi packages",

@@ -48,3 +48,3 @@ "homepage": "https://strapi.io",

"license": "SEE LICENSE IN LICENSE",
"gitHead": "e63fb9d5093de3c099a487e7d87f48ffb8029a24"
"gitHead": "5202c4ed5c96d5e39823e8e6e936bb75c2c59a33"
}
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