MCPcopy
hub / github.com/prettier/prettier / hasDecoratorsBeforeExport

Function hasDecoratorsBeforeExport

src/language-js/print/decorators.js:75–87  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

73}
74
75function hasDecoratorsBeforeExport(node) {
76 if (
77 node.type !== "ExportDefaultDeclaration" &&
78 node.type !== "ExportNamedDeclaration" &&
79 node.type !== "DeclareExportDeclaration"
80 ) {
81 return false;
82 }
83
84 const decorators = node.declaration?.decorators;
85
86 return isNonEmptyArray(decorators) && hasSameLocStart(node, decorators[0]);
87}
88
89export {
90 printClassMemberDecorators,

Callers 2

printDecoratorsFunction · 0.85

Calls 2

hasSameLocStartFunction · 0.90
isNonEmptyArrayFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…