Giter Site home page Giter Site logo

type-comparator's Issues

How should I write to get the results I want?

const array = [
{ name: 'Mission1', value: 1, isGeted:true, isFinish:true },
{ name: 'Mission2', value: 2, isGeted:false, isFinish:true },
{ name: 'Mission3', value: 3, isGeted:false, isFinish:false },
{ name: 'Mission4', value: 4, isGeted:false, isFinish:false},
];

I want get the result like this:

const array = [
{ name: 'Mission2', value: 2, isGeted:false, isFinish:true },
{ name: 'Mission4', value: 4, isGeted:false, isFinish:false},
{ name: 'Mission3', value: 3, isGeted:false, isFinish:false },
{ name: 'Mission1', value: 1, isGeted:true, isFinish:true },
];

Means the finish mission is in the top. But when "isGeted" is true, it will move to the bottom.
At last, other missions will sort by value desc.

I write this:
comparator = queue([
map(m => m.isGeted, asc),
map(m => m.isFinish, desc),
map(m => m.value, desc)
]);
but the result is:
[
{ name: 'Mission2', value: 2, isGeted:false, isFinish:true },
{ name: 'Mission1', value: 1, isGeted:true, isFinish:true },
{ name: 'Mission4', value: 4, isGeted:false, isFinish:false},
{ name: 'Mission3', value: 3, isGeted:false, isFinish:false },
];
How should I write to get the results I want?

Angular warns on CommonJS or AMD dependencies

When a class in Angular app uses types from the library, Angular prints the following warning while executing ng build.
image

Versions
Angular: v14+ (I've not checked on earlier ones).
type-comparator: 0.2.9

Latest release (0.2.9-rc.2) is missing the build directory

I think the latest release is missing its build directory, which causes TS to fail to import anything.

The error message I get is Cannot find module 'type-comparator' or its corresponding type declarations.ts(2307)

Skimming the Github workflows file, it looks like there's no npm build step being called anywhere, just install and publish

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.