@prezly/uploads
Advanced tools
Comparing version 0.3.1 to 0.3.2
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36
310
23097
1