Coder Social home page Coder Social logo

cowsay's People

Contributors

fakoua avatar trgwii avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

trgwii

cowsay's Issues

Type safety issues on imports.

Default deno install gives these errors on running Cowsay.

No index signature with a parameter of type 'string' was found on type 'typeof import("https://deno.land/x/cowsay/src/balloon")'. return baloon[action](options.text, options.wrap ? options.wrapLength : null) + "\n" + cow(face);

Need to be able to define the import as { [key: string]: any } I guess.

Perhaps there is some config in deno that can turn this check on/off.

TypeScript Errors when attempting to run

Steps to reproduce

Windows 10
In terminal (e.g. Git Bash)

$ deno run https://deno.land/x/cowsay/cowsay.ts -t="Hello world"
Compile https://deno.land/x/cowsay/cowsay.ts
error: TS7053 [ERROR]: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'typeof import("https://deno.land/x/cowsay/src/balloon")'.
  No index signature with a parameter of type 'string' was found on type 'typeof import("https://deno.land/x/cowsay/src/balloon")'.
 return baloon[action](options.text, options.wrap ? options.wrapLength : null) + "\n" + cow(face);
        ~~~~~~~~~~~~~~
    at https://deno.land/x/cowsay/mod.ts:34:9

TS7053 [ERROR]: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'typeof import("https://deno.land/x/cowsay/src/cows/cows")'.
  No index signature with a parameter of type 'string' was found on type 'typeof import("https://deno.land/x/cowsay/src/cows/cows")'.
 let text = cows[cow]
            ~~~~~~~~~
    at https://deno.land/x/cowsay/src/cows.ts:5:13

TS7006 [ERROR]: Parameter 'options' implicitly has an 'any' type.
 return function (options) {
                  ~~~~~~~
    at https://deno.land/x/cowsay/src/cows.ts:6:19

TS7006 [ERROR]: Parameter 'options' implicitly has an 'any' type.
export const faces = function (options): any {
                               ~~~~~~~
    at https://deno.land/x/cowsay/src/faces.ts:40:32

Found 4 errors.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.