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.2.1.159 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.158 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.157 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.156 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.155 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.154 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.153 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.152 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.151 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.150 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.149 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.148 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.147 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.146 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.145 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.144 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.143 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.142 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.141 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.140 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts