File tree Expand file tree Collapse file tree
packages/compiler/src/compiler/scope Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import * as t from '@babel/types' ;
2+ import { NodePath } from '@babel/core' ;
3+ import { IReplexicaScope } from "./types" ;
4+ import { attributeExists } from '../../utils/ast' ;
5+ import { ReplexicaScopeData } from '../types' ;
6+
7+ export class ReplexicaSkipScope implements IReplexicaScope {
8+ public get id ( ) : string {
9+ throw new Error ( 'Method not implemented.' ) ;
10+ }
11+
12+ public static fromNode ( path : NodePath < t . Node > ) : IReplexicaScope [ ] {
13+ const result : IReplexicaScope [ ] = [ ] ;
14+
15+ if ( ! path . isJSXElement ( ) ) { return result ; }
16+
17+ const skipRequired = attributeExists ( path , 'data-replexica-skip' ) ;
18+ if ( skipRequired ) {
19+ throw 'skip' ;
20+ }
21+
22+ return result ;
23+ }
24+
25+ public injectIntl ( ) : ReplexicaScopeData {
26+ return { } ;
27+ }
28+
29+ public extractHints ( ) : any [ ] {
30+ return [ ] ;
31+ }
32+ }
You can’t perform that action at this time.
0 commit comments