Giter VIP home page Giter VIP logo

Comments (5)

ENikS avatar ENikS commented on July 23, 2024

You have to build with TSC 1.18.xx and set target to es2015. For sample look at configuration file

from linq.

WouterBos avatar WouterBos commented on July 23, 2024

Ah! Thanks. I'm afraid that in that case this project is not a good fit for me because I also use other libraries that require a more recent TSC.

from linq.

WouterBos avatar WouterBos commented on July 23, 2024

I assume the same limitation exists for linq-es5. What is the limitation of this library to upgrade to a higher TSC? Is it a practical or a technical one?

from linq.

WouterBos avatar WouterBos commented on July 23, 2024

I thought of a simpler solution: I only load the definition file like /// <reference path="../node_modules/linq-es5/dist/linq.d.ts" />, assuming that the definition file is less dependent on a specific version of TypeScript. But I don't know how to use it. I don't know how to get the correct type. An example would help me a lot.

My best effort so far:


let fruits = ["apple", "mango", "orange", "passionfruit", "grape"] as Enumerable<string>; // Neither type is assignable to the other.
let result: string = fruits.FirstOrDefault();
alert(result);```

from linq.

ENikS avatar ENikS commented on July 23, 2024

You don't need to add reference to the linq-xx.d.ts file. TSC v1.8 compiler will pick its location from the package.json file.
For sample on how to use the library please follow this link: https://tonicdev.com/eniks/using-linq
... or you could locate link on the npmjs package page saying: Try it out: "Test linq-es2015 in your browser." and it will let you execute it in node.

from linq.

Related Issues (20)

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.