UNPKG

lambda-live-debugger

Version:

Debug Lambda functions locally like it is running in the cloud

10 lines (6 loc) 317 B
'use strict'; const escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode); const hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`; const escapeUriPath = (uri) => uri.split("/").map(escapeUri).join("/"); exports.escapeUri = escapeUri; exports.escapeUriPath = escapeUriPath;