Skip to content

Commit

Permalink
🦄 refactor: 改名
Browse files Browse the repository at this point in the history
  • Loading branch information
zzxming committed May 21, 2024
1 parent d8b3669 commit b25c115
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export * from './use-same-click-target';
export * from './use-model-value';
export * from './use-lock-scroll';
export * from './use-support-touch';
export * from './user-slide';
export * from './use-slide';
File renamed without changes.
1 change: 1 addition & 0 deletions packages/utils/array.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const ensureArray = (value: any) => (Array.isArray(value) ? (value ? value : []) : [value]);
20 changes: 10 additions & 10 deletions packages/utils/functions.ts → packages/utils/function.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/** 缓存函数结果 */
export const cacheFunction = <T>(func: (...args: any[]) => T) => {
let result: T;
return function () {
if (typeof result === 'undefined') {
result = func();
}
return result;
};
};
/** 缓存函数结果 */
export const cacheFunction = <T>(func: (...args: any[]) => T) => {
let result: T;
return function () {
if (typeof result === 'undefined') {
result = func();
}
return result;
};
};
3 changes: 2 additions & 1 deletion packages/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from './functions';
export * from './function';
export * from './types';
export * from './vue';
export * from './color';
Expand All @@ -7,3 +7,4 @@ export * from './scroll';
export * from './raf';
export * from './number';
export * from './object';
export * from './array';

0 comments on commit b25c115

Please sign in to comment.