mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-13 04:36:04 +00:00
18 lines
435 B
JavaScript
18 lines
435 B
JavaScript
|
export function callIfExists(func, ...args) {
|
||
|
return (typeof func === 'function') && func(...args);
|
||
|
}
|
||
|
|
||
|
export function hasOwnProp(obj, prop) {
|
||
|
return Object.prototype.hasOwnProperty.call(obj, prop);
|
||
|
}
|
||
|
|
||
|
export function uniqueId() {
|
||
|
return Math.random().toString(36).substring(7);
|
||
|
}
|
||
|
|
||
|
export const store = {};
|
||
|
|
||
|
export const canUseDOM = Boolean(
|
||
|
typeof window !== 'undefined' && window.document && window.document.createElement
|
||
|
);
|