funny-accidents

1.0.3 • Public • Published

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

/funny-accidents/

    Package Sidebar

    Install

    npm i funny-accidents

    Weekly Downloads

    1

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    3.02 kB

    Total Files

    4

    Last publish

    Collaborators

    • lennon