Overview for 'asked'

A Laravel(ish) Optional helper in Javascript

Written by / Original link on Apr. 9, 2018

My attempt at creating an optional helper.@lessworkjs/optionalLaravels 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…

Bookshelf js Simple Pagination

Written by / Original link on Feb. 21, 2018

Similar to Laravels Eloquent feature.UPDATE: I’ve made this plugin a package.npm install --save bookshelf-simplepaginateUse the simplePaginate plugin to call a fetchAll and return single pages with meta data.Intended for use with large datasets as pagination with counts can be slow.Example:bookshel…

Serverless custom authorizer issues on AWS.

Written by / Original link on Feb. 16, 2018

If you google around you’ll find plenty of examples on how-to create a custom authorizer for serverless lambda events.I used this example when I was building mine:// Return an IAM policy document for the current endpoint const effect = isAllowed ? 'Allow' : 'Deny'; const userId = user.username; con…