mirror of
				https://github.com/Redocly/redoc.git
				synced 2025-11-04 01:37:32 +03:00 
			
		
		
		
	Merge pull request #94 from kedashoe/ts-string-vs-String
give type "string" for pipe transforms
This commit is contained in:
		
						commit
						22eff033e3
					
				| 
						 | 
					@ -41,7 +41,7 @@ export class ValuesPipe implements PipeTransform {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Pipe({ name: 'jsonPointerEscape' })
 | 
					@Pipe({ name: 'jsonPointerEscape' })
 | 
				
			||||||
export class JsonPointerEscapePipe implements PipeTransform {
 | 
					export class JsonPointerEscapePipe implements PipeTransform {
 | 
				
			||||||
  transform(value) {
 | 
					  transform(value:string) {
 | 
				
			||||||
    if (isBlank(value)) return value;
 | 
					    if (isBlank(value)) return value;
 | 
				
			||||||
    if (!isString(value)) {
 | 
					    if (!isString(value)) {
 | 
				
			||||||
      throw new InvalidPipeArgumentException(JsonPointerEscapePipe, value);
 | 
					      throw new InvalidPipeArgumentException(JsonPointerEscapePipe, value);
 | 
				
			||||||
| 
						 | 
					@ -53,7 +53,7 @@ export class JsonPointerEscapePipe implements PipeTransform {
 | 
				
			||||||
@Pipe({ name: 'marked' })
 | 
					@Pipe({ name: 'marked' })
 | 
				
			||||||
export class MarkedPipe implements PipeTransform {
 | 
					export class MarkedPipe implements PipeTransform {
 | 
				
			||||||
  constructor(private sanitizer: DomSanitizationService) {}
 | 
					  constructor(private sanitizer: DomSanitizationService) {}
 | 
				
			||||||
  transform(value) {
 | 
					  transform(value:string) {
 | 
				
			||||||
    if (isBlank(value)) return value;
 | 
					    if (isBlank(value)) return value;
 | 
				
			||||||
    if (!isString(value)) {
 | 
					    if (!isString(value)) {
 | 
				
			||||||
      throw new InvalidPipeArgumentException(JsonPointerEscapePipe, value);
 | 
					      throw new InvalidPipeArgumentException(JsonPointerEscapePipe, value);
 | 
				
			||||||
| 
						 | 
					@ -68,7 +68,7 @@ export class MarkedPipe implements PipeTransform {
 | 
				
			||||||
@Pipe({ name: 'safe' })
 | 
					@Pipe({ name: 'safe' })
 | 
				
			||||||
export class SafePipe implements PipeTransform {
 | 
					export class SafePipe implements PipeTransform {
 | 
				
			||||||
  constructor(private sanitizer: DomSanitizationService) {}
 | 
					  constructor(private sanitizer: DomSanitizationService) {}
 | 
				
			||||||
  transform(value) {
 | 
					  transform(value:string) {
 | 
				
			||||||
    if (isBlank(value)) return value;
 | 
					    if (isBlank(value)) return value;
 | 
				
			||||||
    if (!isString(value)) {
 | 
					    if (!isString(value)) {
 | 
				
			||||||
      throw new InvalidPipeArgumentException(JsonPointerEscapePipe, value);
 | 
					      throw new InvalidPipeArgumentException(JsonPointerEscapePipe, value);
 | 
				
			||||||
| 
						 | 
					@ -109,7 +109,7 @@ export class PrismPipe implements PipeTransform {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Pipe({ name: 'encodeURIComponent' })
 | 
					@Pipe({ name: 'encodeURIComponent' })
 | 
				
			||||||
export class EncodeURIComponentPipe implements PipeTransform {
 | 
					export class EncodeURIComponentPipe implements PipeTransform {
 | 
				
			||||||
  transform(value) {
 | 
					  transform(value:string) {
 | 
				
			||||||
    if (isBlank(value)) return value;
 | 
					    if (isBlank(value)) return value;
 | 
				
			||||||
    if (!isString(value)) {
 | 
					    if (!isString(value)) {
 | 
				
			||||||
      throw new InvalidPipeArgumentException(EncodeURIComponentPipe, value);
 | 
					      throw new InvalidPipeArgumentException(EncodeURIComponentPipe, value);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user