@fluentui/styles
Version:
A set of styling utilities for CSS-in-JS.
28 lines (27 loc) • 816 B
JavaScript
import { isEnabled as isDebugEnabled } from './debugEnabled';
export var withDebugId = process.env.NODE_ENV === 'production' ? function (data, debugId) {
return data;
} : function (data, debugId) {
if (!isDebugEnabled || debugId === undefined) {
return data;
}
if (typeof data === 'object' && data !== null) {
if (!Object.prototype.hasOwnProperty.call(data, '_debugId')) {
var copy = Object.assign({}, data);
Object.defineProperty(copy, '_debugId', {
value: debugId,
writable: false,
enumerable: false
});
return copy;
}
}
if (typeof data === 'function') {
return function () {
var result = data.apply(void 0, arguments);
return withDebugId(result, debugId);
};
}
return data;
};
//# sourceMappingURL=withDebugId.js.map