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

@inploi/core

Package Overview
Dependencies
Maintainers
2
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@inploi/core - npm Package Compare versions

Comparing version 1.5.2 to 1.5.3

49

flows/flows.schemas.ts
import { z } from 'zod';
import { exhaustive, uniqueByPropertyOrThrow, uniqueOrThrow } from '../common/common.utils';
import { uniqueByPropertyOrThrow, uniqueOrThrow } from '../common/common.utils';

@@ -189,36 +189,19 @@ const FIELD_KEY_VALIDATION_REGEX = /^[a-zA-Z_0-9-]+$/;

export const getSchemaForNodeType = (nodeType: FlowNodeType) => {
switch (nodeType) {
case 'text':
return TextNodeSchema;
case 'question-text':
return QuestionTextSchema;
case 'question-file':
return QuestionFileSchema;
case 'complete-flow':
return CompleteFlowNodeSchema;
case 'abandon-flow':
return AbandonFlowNodeSchema;
case 'image':
return ImageNodeSchema;
case 'question-boolean':
return QuestionBooleanSchema;
case 'question-enum':
return QuestionEnumSchema;
case 'question-address':
return QuestionAddressSchema;
case 'if-block':
return IfBlockSchema;
case 'jump':
return JumpNodeSchema;
case 'question-number':
return QuestionNumberSchema;
default:
exhaustive(nodeType);
}
};
export type FlowNode = z.infer<typeof FlowNodeSchema>;
export const FlowNodesSchema = z.array(FlowNodeSchema);
export const nodeTypeToSchema = {
text: TextNodeSchema,
'question-text': QuestionTextSchema,
'question-file': QuestionFileSchema,
'complete-flow': CompleteFlowNodeSchema,
'abandon-flow': AbandonFlowNodeSchema,
image: ImageNodeSchema,
'question-boolean': QuestionBooleanSchema,
'question-enum': QuestionEnumSchema,
'question-address': QuestionAddressSchema,
'if-block': IfBlockSchema,
jump: JumpNodeSchema,
'question-number': QuestionNumberSchema,
} satisfies Record<FlowNodeType, z.ZodSchema>;
export type FlowNode = z.infer<typeof FlowNodeSchema>;
export type FlowNodeType = FlowNode['type'];
{
"name": "@inploi/core",
"version": "1.5.2",
"version": "1.5.3",
"license": "MIT",

@@ -24,3 +24,3 @@ "exports": {

"tsup": "^7.2.0",
"typescript": "^5.1.6",
"typescript": "^5.3.2",
"zod": "^3.22.0",

@@ -34,4 +34,4 @@ "eslint-config-custom": "0.1.0",

"scripts": {
"lint": "eslint ./ --fix --max-warnings 0"
"check": "eslint ./ --fix --max-warnings 0 && tsc"
}
}
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