MCPcopy
hub / github.com/di-sukharev/opencommit / useColors

Function useColors

out/cli.cjs:15114–15126  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15112 "#FFCC33"
15113 ];
15114 function useColors() {
15115 if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
15116 return true;
15117 }
15118 if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
15119 return false;
15120 }
15121 return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
15122 typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
15123 // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
15124 typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
15125 typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
15126 }
15127 function formatArgs(args) {
15128 args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
15129 if (!this.useColors) {

Callers

nothing calls this directly

Calls 2

toLowerCaseMethod · 0.80
matchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…