Closed lpinca closed 4 years ago
@lpinca Why do you think the "encodeFlag" is "unused"?
@lpinca At least CRL class is using the flag. But anyway I do not see a reason to remove it from code - probably in a future it would be necessary.
https://github.com/PeculiarVentures/PKI.js/blob/0c3f10839098e6cebfde0f06ab4c7835d265ad16/src/AlgorithmIdentifier.js#L145 takes no arguments
takes no arguments
takes no arguments
This is confusing to anyone trying to understand why the encodeFlag
argument of SignedData.prototype.toSchema()
is passed to AlgorithmIdentifier.prototype.toSchema()
for example.
In my opinion it should be added only when AlgorithmIdentifier.prototype.toSchema()
and the others support it.
Just to make my point clearer. This does not work in TypeScript and many other languages of course.
function bar() {
return 10;
}
function foo(n: number) {
return bar(n) + n;
}
console.log(foo(5));
The compiler returns the following error:
tsc index.ts
index.ts:6:14 - error TS2554: Expected 0 arguments, but got 1.
6 return bar(n) + n;
~
Found 1 error.
The
toSchema()
method of these classes takes no arguments.