spacedrive/interface/util/index.tsx
nikec e3d69fe1b5
[ENG-1114] List view improvements (#1371)
* almost there

* so close

* fix drag scroll

* rerender

* Update index.tsx

* fix y scroll

* scroll

* header border

* remove react-scroll-sync
2023-09-24 12:16:38 +00:00

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;