Sha256: 2c6330ca1513cc7e888cc64a8e85e3049c929c06acd6ced458fa5f35c53f515d

Contents?: true

Size: 432 Bytes

Versions: 295

Compression:

Stored size: 432 Bytes

Contents

class Transcriptor {
    toRna(input: string): string {
       const dictionary: {[key: string]: string } = { G: "C" ,  C: "G" , T: "A" ,  A: "U"  }
        let temp = ""
        input.split("").forEach((element) => {
            const current = dictionary[element]
            if (current === undefined) { throw new Error('Invalid input DNA.')}
            temp += current
    })
        return temp
}
}
export default Transcriptor

Version data entries

295 entries across 295 versions & 1 rubygems

Version Path
trackler-2.0.8.15 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.0.8.14 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.0.8.13 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.0.8.12 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.0.8.11 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.0.8.10 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.0.8.9 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.0.8.8 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.0.8.7 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.0.8.6 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.0.8.5 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.0.8.4 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.0.8.3 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.0.8.2 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.0.8.1 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts