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

alaska-field-image

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alaska-field-image - npm Package Compare versions

Comparing version 0.9.0 to 0.9.1

20

lib/view.js

@@ -62,5 +62,15 @@ 'use strict';

}
var serviceId = 'alaska-user';
var modelName = 'User';
var id = '_new';
if (model) {
serviceId = model.service.id;
modelName = model.name;
}
if (data && data._id) {
id = data._id;
}
var url = _this.context.settings.services['alaska-admin'].prefix + '/api/upload?' + (0, _qs.stringify)({
service: model.service.id,
model: model.name
service: serviceId,
model: modelName
});

@@ -73,3 +83,3 @@ var nextState = {

var matchs = file.name.match(/\.(\w+)$/);
if (!matchs || !matchs[1] || field.allowed.indexOf(matchs[1].replace('jpeg', 'jpg').toLowerCase()) < 0) {
if (!matchs || !matchs[1] || (field.allowed || ['jpg', 'png']).indexOf(matchs[1].replace('jpeg', 'jpg').toLowerCase()) < 0) {
nextState.errorText = t('Invalid image format');

@@ -79,4 +89,4 @@ return;

_alaskaAdminView.api.post(url, {
id: data._id == '_new' ? '' : data._id,
path: field.path,
id: id,
path: field.path || 'avatar',
file: file

@@ -83,0 +93,0 @@ }).then(function (res) {

{
"name": "alaska-field-image",
"version": "0.9.0",
"version": "0.9.1",
"description": "Alaska image field",
"keywords": [
"alaska",
"alaska-field"
],
"main": "index.js",

@@ -6,0 +10,0 @@ "scripts": {

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