A Laravel(ish) Optional helper in Javascript

My attempt at creating an optional helper.

Laravels optional helper can be pretty useful. With its new optional closure you can do even more.

I wanted something similar in javascript so I wrote this based on my Laravel(ish) resource/transformer.

You can also provide a callback that will be called if the option exists.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.