mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-07 06:43:29 +00:00
* almost there * so close * fix drag scroll * rerender * Update index.tsx * fix y scroll * scroll * header border * remove react-scroll-sync
11 lines
460 B
TypeScript
11 lines
460 B
TypeScript
import cryptoRandomString from 'crypto-random-string';
|
|
|
|
// NOTE: `crypto` module is not available in RN so this can't be in client
|
|
export const generatePassword = (length: number) =>
|
|
cryptoRandomString({ length, type: 'ascii-printable' });
|
|
|
|
export type NonEmptyArray<T> = [T, ...T[]];
|
|
|
|
export const isNonEmpty = <T,>(input: T[]): input is NonEmptyArray<T> => input.length > 0;
|
|
export const isNonEmptyObject = (input: object) => Object.keys(input).length > 0;
|