Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

monkeyify

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

monkeyify

Monkey patch factory

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

monkeyify

Monkey patch factory

API

By monkeyify the atob function let atob support base64 url

window.atob = monkeyify(window.atob, {
  caller: {name: 'I am the caller, I will be given in the first argument in monkey function'},
  allowMonkeyInMonkey: 'return old monkey'; // true or 'return old monkey'
  monkey: function (caller, args, original) {
    var base64url = args[0];
    var d = 4 - base64url.length % 4;
    while (d-->0) {
      base64url += '=';
    }
    args[0] = base64url
      .replace(/\-/g, "+")
      .replace(/_/g, "/");
    return original.apply(caller, args);
  }
});
// or
window.atob = monkeyify(window.atob, function () {
// your code
});

Keywords

FAQs

Package last updated on 17 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc