Skip to content

Commit

Permalink
chore(ui): lint
Browse files Browse the repository at this point in the history
  • Loading branch information
psychedelicious committed Jan 17, 2025
1 parent 04b893f commit 50de54d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 21 deletions.
34 changes: 14 additions & 20 deletions invokeai/frontend/web/src/features/nodes/types/field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ const zFloatGeneratorArithmeticSequence = z.object({
});
export type FloatGeneratorArithmeticSequence = z.infer<typeof zFloatGeneratorArithmeticSequence>;
export const getFloatGeneratorArithmeticSequenceDefaults = () => zFloatGeneratorArithmeticSequence.parse({});
export const getFloatGeneratorArithmeticSequenceValues = (generator: FloatGeneratorArithmeticSequence) => {
const getFloatGeneratorArithmeticSequenceValues = (generator: FloatGeneratorArithmeticSequence) => {
const { start, step, count } = generator;
if (step === 0) {
return [start];
Expand All @@ -1041,8 +1041,8 @@ const zFloatGeneratorLinearDistribution = z.object({
values: z.array(z.number()).nullish(),
});
export type FloatGeneratorLinearDistribution = z.infer<typeof zFloatGeneratorLinearDistribution>;
export const getFloatGeneratorLinearDistributionDefaults = () => zFloatGeneratorLinearDistribution.parse({});
export const getFloatGeneratorLinearDistributionValues = (generator: FloatGeneratorLinearDistribution) => {
const getFloatGeneratorLinearDistributionDefaults = () => zFloatGeneratorLinearDistribution.parse({});
const getFloatGeneratorLinearDistributionValues = (generator: FloatGeneratorLinearDistribution) => {
const { start, end, count } = generator;
if (count === 1) {
return [start];
Expand All @@ -1060,11 +1060,8 @@ const zFloatGeneratorUniformRandomDistribution = z.object({
values: z.array(z.number()).nullish(),
});
export type FloatGeneratorUniformRandomDistribution = z.infer<typeof zFloatGeneratorUniformRandomDistribution>;
export const getFloatGeneratorUniformRandomDistributionDefaults = () =>
zFloatGeneratorUniformRandomDistribution.parse({});
export const getFloatGeneratorUniformRandomDistributionValues = (
generator: FloatGeneratorUniformRandomDistribution
) => {
const getFloatGeneratorUniformRandomDistributionDefaults = () => zFloatGeneratorUniformRandomDistribution.parse({});
const getFloatGeneratorUniformRandomDistributionValues = (generator: FloatGeneratorUniformRandomDistribution) => {
const { min, max, count } = generator;
const values = Array.from({ length: count }, () => Math.random() * (max - min) + min);
return values;
Expand All @@ -1078,8 +1075,8 @@ const zFloatGeneratorParseString = z.object({
values: z.array(z.number()).nullish(),
});
export type FloatGeneratorParseString = z.infer<typeof zFloatGeneratorParseString>;
export const getFloatGeneratorParseStringDefaults = () => zFloatGeneratorParseString.parse({});
export const getFloatGeneratorParseStringValues = (generator: FloatGeneratorParseString) => {
const getFloatGeneratorParseStringDefaults = () => zFloatGeneratorParseString.parse({});
const getFloatGeneratorParseStringValues = (generator: FloatGeneratorParseString) => {
const { input, splitOn } = generator;
const values = input
.split(splitOn)
Expand Down Expand Up @@ -1160,7 +1157,7 @@ const zIntegerGeneratorArithmeticSequence = z.object({
});
export type IntegerGeneratorArithmeticSequence = z.infer<typeof zIntegerGeneratorArithmeticSequence>;
export const getIntegerGeneratorArithmeticSequenceDefaults = () => zIntegerGeneratorArithmeticSequence.parse({});
export const getIntegerGeneratorArithmeticSequenceValues = (generator: IntegerGeneratorArithmeticSequence) => {
const getIntegerGeneratorArithmeticSequenceValues = (generator: IntegerGeneratorArithmeticSequence) => {
const { start, step, count } = generator;
if (step === 0) {
return [start];
Expand All @@ -1178,8 +1175,8 @@ const zIntegerGeneratorLinearDistribution = z.object({
values: z.array(z.number().int()).nullish(),
});
export type IntegerGeneratorLinearDistribution = z.infer<typeof zIntegerGeneratorLinearDistribution>;
export const getIntegerGeneratorLinearDistributionDefaults = () => zIntegerGeneratorLinearDistribution.parse({});
export const getIntegerGeneratorLinearDistributionValues = (generator: IntegerGeneratorLinearDistribution) => {
const getIntegerGeneratorLinearDistributionDefaults = () => zIntegerGeneratorLinearDistribution.parse({});
const getIntegerGeneratorLinearDistributionValues = (generator: IntegerGeneratorLinearDistribution) => {
const { start, end, count } = generator;
if (count === 1) {
return [start];
Expand All @@ -1197,11 +1194,8 @@ const zIntegerGeneratorUniformRandomDistribution = z.object({
values: z.array(z.number().int()).nullish(),
});
export type IntegerGeneratorUniformRandomDistribution = z.infer<typeof zIntegerGeneratorUniformRandomDistribution>;
export const getIntegerGeneratorUniformRandomDistributionDefaults = () =>
zIntegerGeneratorUniformRandomDistribution.parse({});
export const getIntegerGeneratorUniformRandomDistributionValues = (
generator: IntegerGeneratorUniformRandomDistribution
) => {
const getIntegerGeneratorUniformRandomDistributionDefaults = () => zIntegerGeneratorUniformRandomDistribution.parse({});
const getIntegerGeneratorUniformRandomDistributionValues = (generator: IntegerGeneratorUniformRandomDistribution) => {
const { min, max, count } = generator;
const values = Array.from({ length: count }, () => Math.floor(Math.random() * (max - min + 1)) + min);
return values;
Expand All @@ -1215,8 +1209,8 @@ const zIntegerGeneratorParseString = z.object({
values: z.array(z.number().int()).nullish(),
});
export type IntegerGeneratorParseString = z.infer<typeof zIntegerGeneratorParseString>;
export const getIntegerGeneratorParseStringDefaults = () => zIntegerGeneratorParseString.parse({});
export const getIntegerGeneratorParseStringValues = (generator: IntegerGeneratorParseString) => {
const getIntegerGeneratorParseStringDefaults = () => zIntegerGeneratorParseString.parse({});
const getIntegerGeneratorParseStringValues = (generator: IntegerGeneratorParseString) => {
const { input, splitOn } = generator;
const values = input
.split(splitOn)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const isBatchNode = (node: InvocationNode) => {
}
};

export const isGeneratorNode = (node: InvocationNode) => {
const isGeneratorNode = (node: InvocationNode) => {
switch (node.data.type) {
case 'float_generator':
case 'integer_generator':
Expand Down

0 comments on commit 50de54d

Please sign in to comment.