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

@prezly/uploads

Package Overview
Dependencies
Maintainers
9
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prezly/uploads - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

dist/commonjs/guards/isObject.cjs

2

dist/types/guards/isUploadedFile.d.ts
import type { UploadedFile } from '../types';
export declare function isUploadedFile(file: any | undefined): file is UploadedFile;
export declare function isUploadedFile(file: unknown): file is UploadedFile;
import type { UploadedImage } from '../types';
export declare function isUploadedImage(file: any): file is UploadedImage;
export declare function isUploadedImage(file: unknown): file is UploadedImage;
{
"name": "@prezly/uploads",
"version": "0.3.1",
"version": "0.3.2",
"description": "Types and utilities to handle uploaded files & images in Prezly",

@@ -5,0 +5,0 @@ "author": "Ivan Voskoboinyk <ivan@voskoboinyk.com>",

@@ -1,9 +0,7 @@

import { isPlainObject } from 'is-plain-object';
import type { UploadedFile } from '../types';
import { isObject } from './isObject';
export function isUploadedFile(file: any | undefined): file is UploadedFile {
export function isUploadedFile(file: unknown): file is UploadedFile {
return (
typeof file === 'object' &&
isPlainObject(file) &&
isObject(file) &&
typeof file.uuid === 'string' &&

@@ -10,0 +8,0 @@ typeof file.version === 'number' &&

import { isUploadedFile } from './isUploadedFile';
import type { UploadedImage } from '../types';
import { isObject } from './isObject';

@@ -8,5 +9,6 @@ function isNonEmptyString(value: unknown): boolean {

export function isUploadedImage(file: any): file is UploadedImage {
export function isUploadedImage(file: unknown): file is UploadedImage {
return (
typeof file === 'object' &&
isObject(file) &&
isUploadedFile(file) &&
typeof file.original_height === 'number' &&

@@ -17,5 +19,4 @@ typeof file.original_width === 'number' &&

Array.isArray(file.effects) &&
file.effects.every(isNonEmptyString) &&
isUploadedFile(file)
file.effects.every(isNonEmptyString)
);
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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