MCPcopy
hub / github.com/prettier/prettier / setProperty

Method setProperty

src/language-html/parse/ast.js:34–53  ·  view source on GitHub ↗
(property, value)

Source from the content-addressed store, hash-verified

32 }
33
34 setProperty(property, value) {
35 if (this[property] === value) {
36 return;
37 }
38
39 if (property in NODES_KEYS) {
40 value = value.map((node) => this.createChild(node));
41 }
42
43 if (!NON_ENUMERABLE_PROPERTIES.has(property)) {
44 this[property] = value;
45 return;
46 }
47
48 Object.defineProperty(this, property, {
49 value,
50 enumerable: false,
51 configurable: true,
52 });
53 }
54
55 map(fn) {
56 /** @type{any} */

Callers 3

constructorMethod · 0.95
mapMethod · 0.80
createChildMethod · 0.80

Calls 2

createChildMethod · 0.95
mapMethod · 0.45

Tested by

no test coverage detected