# all files / lib/ utils.js

50% Statements 5/10
100% Branches 0/0
0% Functions 0/3
50% Lines 5/10

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21

    1×

    1×
    1×

    1×

    1×

     "use strict";

    module.exports.mixin = function mixin(target, source) {
      const keys = Object.getOwnPropertyNames(source);
      for (let i = 0; i < keys.length; ++i) {
        Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i]));
      }
    };

    module.exports.wrapperSymbol = Symbol("wrapper");
    module.exports.implSymbol = Symbol("impl");

    module.exports.wrapperForImpl = function (impl) {
      return impl[module.exports.wrapperSymbol];
    };

    module.exports.implForWrapper = function (wrapper) {
      return wrapper[module.exports.implSymbol];
    };