How to use the shimmer.massUnwrap function in shimmer

To help you get started, we’ve selected a few shimmer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mickhansen / dataloader-sequelize / src / index.js View on Github external
export function removeContext(sequelize) {
  const Model = /^[45]/.test(sequelize.constructor.version) ? // v3 vs v4
    sequelize.constructor.Model : sequelize.constructor.Model.prototype;

  shimmer.massUnwrap(Model, methods(Sequelize.version).findByPk);
  shimmer.unwrap(sequelize.constructor.Association.BelongsTo.prototype, 'get');
  shimmer.unwrap(sequelize.constructor.Association.HasOne.prototype, 'get');
  shimmer.unwrap(sequelize.constructor.Association.HasMany.prototype, 'get');
  shimmer.unwrap(sequelize.constructor.Association.BelongsToMany.prototype, 'get');
}
github iopipe / iopipe-js-trace / src / plugins / mongodb.js View on Github external
function unwrap() {
  if (serverTarget.__iopipeShimmer) {
    shimmer.massUnwrap(serverTarget, serverOps);
    delete serverTarget.__iopipeShimmer;
  }
  if (collectionTarget.__iopipeShimmer) {
    shimmer.massUnwrap(collectionTarget, collectionOps);
    delete collectionTarget.__iopipeShimmer;
  }
  if (cursorTarget.__iopipeShimmer) {
    shimmer.massUnwrap(cursorTarget, cursorOps);
    delete cursorTarget.__iopipeShimmer;
  }
  if (clientTarget.__iopipeShimmer) {
    shimmer.massUnwrap(clientTarget, clientOps); // mass just seems to hang and not complete
    delete clientTarget.__iopipeShimmer;
  }
}
github iopipe / iopipe-js-trace / src / plugins / mongodb.js View on Github external
function unwrap() {
  if (serverTarget.__iopipeShimmer) {
    shimmer.massUnwrap(serverTarget, serverOps);
    delete serverTarget.__iopipeShimmer;
  }
  if (collectionTarget.__iopipeShimmer) {
    shimmer.massUnwrap(collectionTarget, collectionOps);
    delete collectionTarget.__iopipeShimmer;
  }
  if (cursorTarget.__iopipeShimmer) {
    shimmer.massUnwrap(cursorTarget, cursorOps);
    delete cursorTarget.__iopipeShimmer;
  }
  if (clientTarget.__iopipeShimmer) {
    shimmer.massUnwrap(clientTarget, clientOps); // mass just seems to hang and not complete
    delete clientTarget.__iopipeShimmer;
  }
}
github iopipe / iopipe-js-trace / src / plugins / mongodb.js View on Github external
function unwrap() {
  if (serverTarget.__iopipeShimmer) {
    shimmer.massUnwrap(serverTarget, serverOps);
    delete serverTarget.__iopipeShimmer;
  }
  if (collectionTarget.__iopipeShimmer) {
    shimmer.massUnwrap(collectionTarget, collectionOps);
    delete collectionTarget.__iopipeShimmer;
  }
  if (cursorTarget.__iopipeShimmer) {
    shimmer.massUnwrap(cursorTarget, cursorOps);
    delete cursorTarget.__iopipeShimmer;
  }
  if (clientTarget.__iopipeShimmer) {
    shimmer.massUnwrap(clientTarget, clientOps); // mass just seems to hang and not complete
    delete clientTarget.__iopipeShimmer;
  }
}
github iopipe / iopipe-js-trace / src / plugins / mongodb.js View on Github external
function unwrap() {
  if (serverTarget.__iopipeShimmer) {
    shimmer.massUnwrap(serverTarget, serverOps);
    delete serverTarget.__iopipeShimmer;
  }
  if (collectionTarget.__iopipeShimmer) {
    shimmer.massUnwrap(collectionTarget, collectionOps);
    delete collectionTarget.__iopipeShimmer;
  }
  if (cursorTarget.__iopipeShimmer) {
    shimmer.massUnwrap(cursorTarget, cursorOps);
    delete cursorTarget.__iopipeShimmer;
  }
  if (clientTarget.__iopipeShimmer) {
    shimmer.massUnwrap(clientTarget, clientOps); // mass just seems to hang and not complete
    delete clientTarget.__iopipeShimmer;
  }
}
github census-instrumentation / opencensus-node / packages / opencensus-instrumentation-mongodb / src / mongodb.ts View on Github external
applyUnpatch(): void {
    shimmer.unwrap(this.moduleExports.Server.prototype, 'command');
    shimmer.massUnwrap(this.moduleExports.Server.prototype, this.SERVER_FNS);
    shimmer.massUnwrap(
      this.moduleExports.Cursor.prototype,
      this.CURSOR_FNS_FIRST
    );
  }
github open-telemetry / opentelemetry-js / packages / opentelemetry-plugin-mongodb-core / src / mongodb.ts View on Github external
unpatch(): void {
    shimmer.massUnwrap(
      [this._moduleExports.Server.prototype],
      this._SERVER_METHODS as never[]
    );
    shimmer.massUnwrap(
      [this._moduleExports.Cursor.prototype],
      this._CURSOR_METHODS as never[]
    );
  }
github census-instrumentation / opencensus-node / packages / opencensus-instrumentation-mongodb / src / mongodb.ts View on Github external
applyUnpatch(): void {
    shimmer.unwrap(this.moduleExports.Server.prototype, 'command');
    shimmer.massUnwrap(this.moduleExports.Server.prototype, this.SERVER_FNS);
    shimmer.massUnwrap(
      this.moduleExports.Cursor.prototype,
      this.CURSOR_FNS_FIRST
    );
  }

shimmer

Safe(r) monkeypatching for JavaScript.

BSD-2-Clause
Latest version published 5 years ago

Package Health Score

67 / 100
Full package analysis