docs: correct types in transform method to match specification. (#29812)
PR Close #29812
This commit is contained in:
parent
3a8f74e392
commit
0051ddf0f3
|
@ -11,8 +11,7 @@ import { Pipe, PipeTransform } from '@angular/core';
|
||||||
*/
|
*/
|
||||||
@Pipe({name: 'exponentialStrength'})
|
@Pipe({name: 'exponentialStrength'})
|
||||||
export class ExponentialStrengthPipe implements PipeTransform {
|
export class ExponentialStrengthPipe implements PipeTransform {
|
||||||
transform(value: number, exponent: string): number {
|
transform(value: number, exponent?: number): number {
|
||||||
let exp = parseFloat(exponent);
|
return Math.pow(value, isNaN(exponent) ? 1 : exponent);
|
||||||
return Math.pow(value, isNaN(exp) ? 1 : exp);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue