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

larvitfiles

Package Overview
Dependencies
Maintainers
1
Versions
142
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

larvitfiles - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

21

controllers/adminFileEdit.js

@@ -44,4 +44,18 @@ 'use strict';

// Check so slug is not an empty string
tasks.push(function(cb) {
if (newFileData.slug === '') {
data.global.errors.push('Slug can not be empty');
}
cb();
});
// Check so slug is not taken
tasks.push(function(cb) {
if (data.global.errors.length !== 0) {
cb();
return;
}
if ((file !== undefined && file.slug !== newFileData.slug) || file === undefined) {

@@ -52,3 +66,3 @@ lFiles.getFileUuidBySlug(newFileData.slug, function(err, result) {

if ((result !== false && file !== undefined && file.uuid !== result) || (file === undefined && result !== false)) {
data.global.errors = ['Slug already taken'];
data.global.errors.push('Slug already taken');
}

@@ -79,2 +93,7 @@

tasks.push(function(cb) {
if (data.global.errors.length !== 0) {
cb();
return;
}
if (file === undefined) {

@@ -81,0 +100,0 @@ file = new lFiles.File(newFileData, cb);

2

index.js

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

if (options.slug) {
if (options.slug !== undefined && options.slug !== '') {
tasks.push(function(cb) {

@@ -36,0 +36,0 @@ db.query('SELECT uuid, slug FROM larvitfiles_files WHERE slug = ?', [options.slug], function(err, rows) {

{
"name": "larvitfiles",
"version": "1.1.0",
"version": "1.1.1",
"description": "Storage of files with an API and database to use in web environments",

@@ -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