Skip to content

Commit

Permalink
make array parsing kinder (microsoft#2963)
Browse files Browse the repository at this point in the history
Co-authored-by: Andy Brown <asbrown002@gmail.com>
  • Loading branch information
beyackle and a-b-r-o-w-n authored May 11, 2020
1 parent 068c07e commit f02918d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface SkillManifest {
export interface ContentProps {
completeStep: () => void;
errors: { [key: string]: any };
setErrors: (erros: { [key: string]: any }) => void;
setErrors: (errors: { [key: string]: any }) => void;
setSchema: (_: JSONSchema7) => void;
setSkillManifest: (name: string) => void;
schema: JSONSchema7;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const Description: React.FC<ContentProps> = ({ errors, value, schema, onC
itemSchema && itemSchema?.type === 'string'
? {
get: value => (Array.isArray(value) ? value.join(', ') : value),
set: value => (typeof value === 'string' ? value.split(', ') : value),
set: value => (typeof value === 'string' ? value.split(',').map(s => s.trim()) : value),
}
: null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
- SWITCH: ${dayOfWeek(utcNow())}
- CASE: ${0}
- Happy Sunday!
-CASE: ${6}
- CASE: ${6}
- Happy Saturday!
-DEFAULT:
- DEFAULT:
- Working day!

# timeOfDayGreeting(timeOfDay)
Expand All @@ -40,7 +40,7 @@
]

# multilineText
- ``` you have such alarms
alarm1: 7:am
alarm2: 9:pm
- ``` You have the following alarms:
alarm1: 7:00 am
alarm2: 9:00 pm
```

0 comments on commit f02918d

Please sign in to comment.