funny-accidents

We don't make mistakes, only happy little accidents.

Usage no npm install needed!

<script type="module">
  import funnyAccidents from 'https://cdn.skypack.dev/funny-accidents';
</script>

README

funny-accidents

We don't make mistakes, only happy little accidents.

  • Bob Ross

inspired by Jake Archibald's tweet, and by my own old pet project, when i was kinda obsessed with the syntax of pug (it was called jade back then).

install

install funny-accidents with npm or yarn:

$ npm install funny-accidents
# or
$ yarn add funny-accidents

usage

allow happy little accidents in the global scope:

import 'funny-accidents';

consloe.log('hello');
cnosole.log('ehlo');
consoel.log('hola');

allow happy little mistakes on a specific object:

import patch from 'funny-accidents/patch'

const user = {
  name: 'John Doe',
};

patch(user);

console.log(user.naem);

how does this work?

it's using a Proxy to catch every property access on an object, and it selects the most appropriate existing one based on its Levenshtein distance. then it overrides __proto__ of global.

should i use this?

no.

license

MIT