Remove utility belt

This commit is contained in:
Steve Kinney
2024-09-30 10:37:34 -06:00
parent 3d6307fe59
commit 523c05d3f5
4 changed files with 0 additions and 55 deletions

View File

@@ -1,7 +0,0 @@
export type RequireOnly<T, Keys extends keyof T = keyof T> = Partial<T> &
Required<Pick<T, Keys>>;
export declare const isError: (error: unknown) => error is Error;
export declare const getErrorMessage: (
error: unknown,
defaultMessage: string,
) => string;

View File

@@ -1,16 +0,0 @@
/**
*
* @param {unknown} error The error object to check.
* @returns {error is Error}
*/
export const isError = (error) => error instanceof Error;
/**
* Get the error message from an error object or return a default message.
* @param {unknown} error The error object to check.
* @param {string} defaultMessage The default message to return if the error is not an instance of Error.
* @returns {string} The error message or the default message.
*/
export const getErrorMessage = (error, defaultMessage) => {
return isError(error) ? error.message : defaultMessage;
};

View File

@@ -1,23 +0,0 @@
{
"name": "utility-belt",
"version": "1.0.0",
"description": "Some little utilities",
"main": "index.js",
"type": "module",
"scripts": {
"types": "tsc --emitDeclarationOnly --allowJs --declaration --skipLibCheck index.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/stevekinney/testing-javascript.git"
},
"author": "Steve Kinney <hello@stevekinney.net>",
"license": "MIT",
"bugs": {
"url": "https://github.com/stevekinney/testing-javascript/issues"
},
"homepage": "https://github.com/stevekinney/testing-javascript#readme",
"devDependencies": {
"typescript": "^5.6.2"
}
}

9
types.d.ts vendored
View File

@@ -1,9 +0,0 @@
declare module '*.html' {
const value: string;
export default value;
}
declare module '*.html?raw' {
const value: string;
export default value;
}