@neosjs/cli
Version:
Neos(奈欧斯)是一个帮助开发者快速地创建 Vue3 应用并自动配置项目编译的脚手架
10 lines (9 loc) • 393 B
text/typescript
export const inBrowser = typeof window !== 'undefined';
export const supportsPassive = true;
export const trim = (string: string) => (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
export const raf = (fn: FrameRequestCallback): number => (inBrowser ? requestAnimationFrame(fn) : -1);
export const cancelRaf = (id: number) => {
if (inBrowser) {
cancelAnimationFrame(id);
}
};