How to use the directive function from @babel/types
Find comprehensive JavaScript @babel/types.directive code examples handpicked from public code repositorys.
7 8 9 10 11 12 13 14 15 16
for (const directive of node.directives) { if (directive.value.value === 'use babel') return; } path.unshiftContainer('directives', t.directive(t.directiveLiteral('use babel'))); }, }, }; }
1
1
1
89 90 91 92 93 94 95 96 97 98
const hasStrict = path.node.directives.some(directive => { return directive.value.value === "use strict"; }); if (!hasStrict) { path.unshiftContainer("directives", t.directive(t.directiveLiteral("use strict"))); } } const headers = [];
0
1
1
+ 21 other calls in file
@babel/types.identifier is the most popular function in @babel/types (20936 examples)