insidewhy / angular-promise-extras Goto Github PK
View Code? Open in Web Editor NEWProvides $q.allSettled, $q.map, $q.mapSettled and $q.resolve
License: ISC License
Provides $q.allSettled, $q.map, $q.mapSettled and $q.resolve
License: ISC License
I get the following after running npm audit
:
Moderate Prototype Pollution
Package angular
Patched in >=1.7.9
Dependency of angular-promise-extras
Path angular-promise-extras > angular
More info https://npmjs.com/advisories/1343
I have already installed angular 1.7.9 but I assume I still get this error because angular-promise-extras depends on angular < 1.7.0. I could submit a PR if that is OK with the maintainers.
@mtrias You have published my package, please npm owner add jpike angular-promise-extras
so I can update my package on the npm registry.
Hi,
I wanted to make a PR, but have no access rights.
In my opinion the field 'state' must be renamed to 'status', as you can see in MDN documentation:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled
The TS typings are correct which currently enforces casting of results.
package.json states ISC License, but none in the repo. We would like to include the license to give credit to you in our project. The standard ISC license is a template, so can we add one to the repo?
declare module 'angular' {
interface IQService {
allSettled<Promises extends Array<IPromise<unknown> | unknown>>(
promises: Promises,
): IPromise<
Array<PromiseFulfilledResult<unknown> | PromiseRejectedResult>
>;
allSettled<
Promises extends Record<string, IPromise<unknown> | unknown>
>(
promises: Promises,
): IPromise<
Record<
keyof Promises,
PromiseFulfilledResult<unknown> | PromiseRejectedResult
>
>;
}
}
PromiseFulfilledResult
and PromiseRejectedResult
are added in ES2020 for native Promise.allSettled
In #15 we updated the project to be compatible with angular 1.6.1.
Those changes are in master but were not published in a release so they cannot be used for people fetching this dependency using a version number.
Hi,
could $q.resolve be removed, as it already exists in angular?
https://docs.angularjs.org/api/ng/service/$q
resolve(value, [successCallback], [errorCallback], [progressCallback]);
From my point of view the package should only add "extras" and not alter the behavior of the existing $q.
The default $q.resolve handles the case implemented in this library but has additional features. Threrefore this "extra" is kind of a downgrade.
Best regards
Hi there,
Not really an issue, but could you please explain why the library requires angular < 1.5.0 ?
Thanks!
Due to work regulations I can't provide a pull request now. The function($delegate)
starting on line 21 is missing the array notation which breaks this library using ngAnnotate.
When angular-promise-extra.js is combined with other javascript files it breaks with this error because of missing semi-colon towards the end.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.