wix-style-react
Version:
wix-style-react
26 lines (23 loc) • 927 B
JavaScript
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
import eyes from 'eyes.it';
var defaultConfig = {
enableSnapshotAtBrowserGet: false
};
/**
* Create an instance of eyes.it with a default configure options.
* All instances share the same eyes singleton which is already initialized.
*/
export function eyesItInstance(config) {
/* eslint-disable no-restricted-globals */
return new Proxy(eyes, {
/* eslint-enable no-restricted-globals */
get: function get(obj, prop) {
if (prop === 'it' || prop === 'fit') {
return function (msg, f, configArg) {
return obj[prop](msg, f, _extends({}, defaultConfig, config, configArg));
};
}
return obj[prop];
}
});
}