Socket
Socket
Sign inDemoInstall

@prezly/content-format

Package Overview
Dependencies
2
Maintainers
11
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.59.0 to 0.60.0

tsconfig.tsbuildinfo

13

build/nodes/ContactNode.js
import { Element } from '../Element';
import { isObject, isUuid } from '../validation';
import { isBoolean, isEnum, isObject, isUuid } from '../validation';
export var ContactNode;
(function (ContactNode) {
ContactNode.TYPE = 'contact';
let Layout;
(function (Layout) {
Layout["CARD"] = "card";
Layout["SIGNATURE"] = "signature";
})(Layout = ContactNode.Layout || (ContactNode.Layout = {}));
function isContactNode(value) {

@@ -11,3 +16,7 @@ return Element.isElement(value, ContactNode.TYPE);

function validateContactNode(value) {
const isValid = isContactNode(value) && isUuid(value.uuid) && isObject(value.contact);
const isValid = isContactNode(value) &&
isUuid(value.uuid) &&
isObject(value.contact) &&
isEnum(value.layout, ContactNode.Layout) &&
isBoolean(value.show_avatar);
return isValid ? value : null;

@@ -14,0 +23,0 @@ }

@@ -9,2 +9,4 @@ import { Element } from '../Element';

contact: ContactNode.ContactInfo;
layout: `${ContactNode.Layout}`;
show_avatar: boolean;
}

@@ -26,2 +28,6 @@ export declare namespace ContactNode {

}
enum Layout {
CARD = "card",
SIGNATURE = "signature"
}
function isContactNode(value: any): value is ContactNode;

@@ -28,0 +34,0 @@ function validateContactNode(value: any): ContactNode | null;

4

package.json
{
"name": "@prezly/content-format",
"version": "0.59.0",
"version": "0.60.0",
"description": "Prezly Content Format types and utilities",

@@ -53,3 +53,3 @@ "license": "MIT",

},
"gitHead": "4825f366b51fbafbbdfcee8ea6d26d32e59238ed"
"gitHead": "b5d7537c9ea4c6a7da1a5babb668132312d069a0"
}
import { Element } from '../Element';
import { isObject, isUuid } from '../validation';
import { isBoolean, isEnum, isObject, isUuid } from '../validation';

@@ -12,2 +12,4 @@ interface NewsroomContact {

contact: ContactNode.ContactInfo;
layout: `${ContactNode.Layout}`;
show_avatar: boolean;
}

@@ -32,2 +34,7 @@

export enum Layout {
CARD = 'card',
SIGNATURE = 'signature',
}
export function isContactNode(value: any): value is ContactNode {

@@ -38,3 +45,8 @@ return Element.isElement(value, TYPE);

export function validateContactNode(value: any): ContactNode | null {
const isValid = isContactNode(value) && isUuid(value.uuid) && isObject(value.contact);
const isValid =
isContactNode(value) &&
isUuid(value.uuid) &&
isObject(value.contact) &&
isEnum(value.layout, ContactNode.Layout) &&
isBoolean(value.show_avatar);

@@ -41,0 +53,0 @@ return isValid ? value : null;

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

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc