File tree Expand file tree Collapse file tree
packages/config-files/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { Injectable } from '@angular/core' ;
2+
3+ import { ConfigFileParser , ConfigFileParsingException } from './parser' ;
4+
5+ @Injectable ( { providedIn : 'root' } )
6+ export class TextParser implements ConfigFileParser {
7+ parse ( value : string ) : object {
8+ return { value } ;
9+ }
10+ }
11+
12+ @Injectable ( { providedIn : 'root' } )
13+ export class JsonParser implements ConfigFileParser {
14+ parse ( raw : string ) : object {
15+ try {
16+ return JSON . parse ( raw ) ;
17+ } catch ( error ) {
18+ throw new ConfigFileParsingException ( String ( error ) ) ;
19+ }
20+ }
21+ }
Original file line number Diff line number Diff line change 1+ import { Injectable } from '@angular/core' ;
2+
3+ import { ConfigFileValidator } from './validator' ;
4+
5+ @Injectable ( { providedIn : 'root' } )
6+ export class NoopValidator implements ConfigFileValidator < object > {
7+ validate ( ) : void { }
8+ }
You can’t perform that action at this time.
0 commit comments