w3c / vc-data-integrity

W3C Data Integrity Specification
https://w3c.github.io/vc-data-integrity/
Other
39 stars 17 forks source link

(Editorial) would it be possible to annotate the input and output types for Javascript examples? #263

Closed iherman closed 1 month ago

iherman commented 1 month ago

I am looking at example 20 and example 21: it would greatly help comprehension if the exact type of the input arguments, as well as the output value, was properly defined. I am not asking to turn this into TypeScript, but at least follow the JSDoc syntax. It can be as simple as:

/**
 * @param {UInt8Array} bytes 
 * @param {number} targetBase 
 * @param {string} baseAlphabet 
 * @returns string
 */
function baseEncode(bytes, targetBase, baseAlphabet) {
   …

(Provided I interpret the input argument types properly. Is it an UInt8Array or the generic ArrayBuffer?)

msporny commented 1 month ago

PR #267 was raised to address this issue. That PR has been processed and merged. Closing.