0.2.0 - Mid migration

This commit is contained in:
Daniel Mason 2022-04-25 14:47:15 +12:00
parent 139e6a915e
commit 7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions

View file

@ -0,0 +1 @@
export declare function capitalize(str: string): string;

View file

@ -0,0 +1 @@
export declare function copyWithStructuralSharing<T>(oldObj: any, newObj: T): T;

View file

@ -0,0 +1,6 @@
/**
* Alternative to `Array.flat(1)`
* @param arr An array like [1,2,3,[1,2]]
* @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat
*/
export declare const flatten: (arr: readonly any[]) => never[];

View file

@ -0,0 +1,8 @@
export * from './isAbsoluteUrl';
export * from './isValidUrl';
export * from './joinUrls';
export * from './flatten';
export * from './capitalize';
export * from './isOnline';
export * from './isDocumentVisible';
export * from './copyWithStructuralSharing';

View file

@ -0,0 +1,6 @@
/**
* If either :// or // is present consider it to be an absolute url
*
* @param url string
*/
export declare function isAbsoluteUrl(url: string): boolean;

View file

@ -0,0 +1,5 @@
/**
* Assumes true for a non-browser env, otherwise makes a best effort
* @link https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState
*/
export declare function isDocumentVisible(): boolean;

View file

@ -0,0 +1,5 @@
/**
* Assumes a browser is online if `undefined`, otherwise makes a best effort
* @link https://developer.mozilla.org/en-US/docs/Web/API/NavigatorOnLine/onLine
*/
export declare function isOnline(): boolean;

View file

@ -0,0 +1 @@
export declare function isValidUrl(string: string): boolean;

View file

@ -0,0 +1 @@
export declare function joinUrls(base: string | undefined, url: string | undefined): string;