Commit 122fb690 authored by nanahira's avatar nanahira

add maybe array

parent 1f891dbf
...@@ -9,3 +9,4 @@ export * from './src/i18n'; ...@@ -9,3 +9,4 @@ export * from './src/i18n';
export * from './src/patch-string-in-object'; export * from './src/patch-string-in-object';
export * from './src/observe-diff'; export * from './src/observe-diff';
export * from './src/memorize'; export * from './src/memorize';
export * from './src/may-be-array';
export type MayBeArray<T> = T | T[];
export const makeArray = <T>(value: MayBeArray<T>): T[] => {
return Array.isArray(value) ? value : [value];
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment