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.180 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.179 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.178 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.177 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.176 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.175 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.174 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.173 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.172 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.171 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.170 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.169 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.167 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.166 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.165 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.164 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.163 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.162 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.161 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts
trackler-2.2.1.160 tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts