MCPcopy
hub / github.com/prisma/prisma / define

Function define

packages/client/scripts/colors.js:50–68  ·  view source on GitHub ↗
(name, codes, type)

Source from the content-addressed store, hash-verified

48 }
49
50 const define = (name, codes, type) => {
51 colors.styles[name] = ansi({ name, codes })
52 let keys = colors.keys[type] || (colors.keys[type] = [])
53 keys.push(name)
54
55 Reflect.defineProperty(colors, name, {
56 configurable: true,
57 enumerable: true,
58 set(value) {
59 colors.alias(name, value)
60 },
61 get() {
62 let color = (input) => style(input, color.stack)
63 Reflect.setPrototypeOf(color, colors)
64 color.stack = this.stack ? this.stack.concat(name) : [name]
65 return color
66 },
67 })
68 }
69
70 define('reset', [0, 0], 'modifier')
71 define('bold', [1, 22], 'modifier')

Callers 1

createFunction · 0.85

Calls 2

ansiFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected