Skip to content

Instantly share code, notes, and snippets.

View Elijah-Bodden's full-sized avatar

Elijah Bodden Elijah-Bodden

View GitHub Profile
@Elijah-Bodden
Elijah-Bodden / typeCheck.js
Last active August 27, 2022 00:17
A tiny, dynamic type checker and TypeError generator
function checkTypes(...requiredArgs, expectedTypes) {
var mistyped = requiredArgs.filter((argumentObj, index) => {
return expectedTypes[index]
? !expectedTypes[index].includes(typeof Object.values(argumentObj)[0])
: false;
});
if (mistyped != "") {
throw new TypeError(
`expected the argument "${
Object.keys(mistyped[0])[0]
@PurpleBooth
PurpleBooth / README-Template.md
Last active July 6, 2024 04:11
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites