@prismatic-io/spectral
Advanced tools
Comparing version 7.6.8 to 7.7.0
@@ -120,8 +120,15 @@ "use strict"; | ||
const predicates = expression.slice(1); | ||
const results = predicates.map(exports.evaluate); | ||
switch (operator) { | ||
case types_1.BooleanOperator.and: | ||
return results.reduce((previous, current) => previous && current, true); | ||
for (const predicate of predicates) { | ||
if (!(0, exports.evaluate)(predicate)) | ||
return false; | ||
} | ||
return true; | ||
case types_1.BooleanOperator.or: | ||
return results.reduce((previous, current) => previous || current, false); | ||
for (const predicate of predicates) { | ||
if ((0, exports.evaluate)(predicate)) | ||
return true; | ||
} | ||
return false; | ||
default: | ||
@@ -128,0 +135,0 @@ throw new Error(`Invalid operator: '${operator}'`); |
@@ -16,3 +16,3 @@ /** | ||
*/ | ||
export declare const component: <T extends boolean>(definition: ComponentDefinition<T>) => ReturnType<typeof convertComponent>; | ||
export declare const component: <TPublic extends boolean, TKey extends string>(definition: ComponentDefinition<TPublic, TKey>) => ReturnType<typeof convertComponent>; | ||
/** | ||
@@ -19,0 +19,0 @@ * This function creates an action object that can be referenced |
import { ComponentDefinition } from "../types"; | ||
import { Component as ServerComponent } from "."; | ||
export declare const convertComponent: <TPublic extends boolean>({ connections, actions, triggers, dataSources, hooks, ...definition }: ComponentDefinition<TPublic>) => ServerComponent; | ||
export declare const convertComponent: <TPublic extends boolean, TKey extends string>({ connections, actions, triggers, dataSources, hooks, ...definition }: ComponentDefinition<TPublic, TKey>) => ServerComponent; |
@@ -8,5 +8,5 @@ import { ActionDefinition, ConnectionDefinition, ComponentDisplayDefinition, TriggerDefinition, DataSourceDefinition } from "."; | ||
/** Defines attributes of a Component. */ | ||
export declare type ComponentDefinition<TPublic extends boolean> = { | ||
export declare type ComponentDefinition<TPublic extends boolean, TKey extends string> = { | ||
/** Specifies unique key for this Component. */ | ||
key: string; | ||
key: TKey; | ||
/** Specifies if this Component is available for all Organizations or only your own @default false */ | ||
@@ -28,5 +28,5 @@ public?: TPublic; | ||
/** Specified the URL for the Component Documentation. */ | ||
documentationUrl: string; | ||
documentationUrl: `https://prismatic.io/docs/components/${TKey}/`; | ||
} : { | ||
documentationUrl?: string; | ||
}); |
{ | ||
"name": "@prismatic-io/spectral", | ||
"version": "7.6.8", | ||
"version": "7.7.0", | ||
"description": "Utility library for building Prismatic components", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
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
173634
3882