From 6497d96a8c82f5431235f243865d67998f616385 Mon Sep 17 00:00:00 2001 From: atanasster Date: Sun, 23 Feb 2020 23:10:43 -0500 Subject: [PATCH] fix: source stories update --- blocks/core/src/Source/Source.stories.tsx | 32 +++++++++++++---------- blocks/core/src/Source/argument-utils.ts | 3 +-- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/blocks/core/src/Source/Source.stories.tsx b/blocks/core/src/Source/Source.stories.tsx index a6109fcd9..bba552de6 100644 --- a/blocks/core/src/Source/Source.stories.tsx +++ b/blocks/core/src/Source/Source.stories.tsx @@ -176,13 +176,15 @@ export const controlsValues = () => { name: 'name', usage: [ { - end: { - column: 65, - line: 0, - }, - start: { - column: 61, - line: 0, + loc: { + end: { + column: 65, + line: 0, + }, + start: { + column: 61, + line: 0, + }, }, }, ], @@ -202,13 +204,15 @@ export const controlsValues = () => { name: 'age', usage: [ { - end: { - column: 75, - line: 0, - }, - start: { - column: 72, - line: 0, + loc: { + end: { + column: 75, + line: 0, + }, + start: { + column: 72, + line: 0, + }, }, }, ], diff --git a/blocks/core/src/Source/argument-utils.ts b/blocks/core/src/Source/argument-utils.ts index 34b4937bc..6268b9fdc 100644 --- a/blocks/core/src/Source/argument-utils.ts +++ b/blocks/core/src/Source/argument-utils.ts @@ -12,7 +12,7 @@ import { export const getArgumentNames = (args: StoryArguments): string[] => { return args.reduce((acc: string[], a) => { if (Array.isArray(a.value)) { - return [...acc, ...getArgumentNames(a.value as StoryArguments)]; + return [...acc, ...getArgumentNames(a.value)]; } return [...acc, a.value]; }, []); @@ -62,7 +62,6 @@ export const mergeControlValues = ( ): string => { const locations = getArgumentsUsage(args); const lines = source.split('\n'); - //sort locations in reverse order, so to replace source backwards locations .sort((a, b) => {