Socket
Socket
Sign inDemoInstall

easy-promise

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-promise - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

.travis.yml

2

bower.json

@@ -8,3 +8,3 @@ {

],
"license": "BSD",
"license": "BSD-2-Clause",
"keywords": [

@@ -11,0 +11,0 @@ "promise"

/*!
* easy-promise v0.0.3
* Homepage https://github.com/cnwhy/promise#readme
* License BSD
* License BSD-2-Clause
*/

@@ -6,0 +6,0 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

/*!
* easy-promise v0.0.3
* Homepage https://github.com/cnwhy/promise#readme
* License BSD
* License BSD-2-Clause
*/
!function e(t,n,r){function o(s,u){if(!n[s]){if(!t[s]){var f="function"==typeof require&&require;if(!u&&f)return f(s,!0);if(i)return i(s,!0);throw new Error("Cannot find module '"+s+"'")}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return o(n?n:e)},c,c.exports,e,t,n,r)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s<r.length;s++)o(r[s]);return o}({1:[function(e,t,n){!function(e,t){if("function"==typeof define&&(define.amd||define.cmd))define([],t);else{if("undefined"==typeof window&&"undefined"==typeof self)throw new Error("加载 "+e+" 模块失败!,请检查您的环境!");var n="undefined"!=typeof window?window:self;n[e]=t()}}("Promise",function(){var t=e("./setTimeout");return t})},{"./setTimeout":2}],2:[function(e,t,n){t.exports=e("./src")(function(e){setTimeout(e,0)})},{"./src":3}],3:[function(e,t,n){"use strict";t.exports=function(e){function t(e,r){if(n(r))r.then(e.resolve,e.reject);else if(!r||"function"!=typeof r&&"object"!=typeof r)e.resolve(r);else{var o,i=!1;try{o=r.then,"function"==typeof o?o.call(r,function(n){i||(i=!0,t(e,n))},function(t){i||(i=!0,e.reject(t))}):e.resolve(r)}catch(t){i||(i=!0,e.reject(t))}}}function n(e){return e instanceof r}function r(e){function n(e){o.call(f,1,e)}function r(e){o.call(f,0,e)}function i(e){if(!c)return c=!0,f===e?r(new TypeError("The promise and its value refer to the same object")):void t({resolve:n,reject:r},e)}function s(e){c||(c=!0,r(e))}var f=this;this.status=-1,this._events=[];var c=!1;if(this.resolve=i,this.reject=s,e!==u&&"function"==typeof e)try{e(this.resolve,this.reject)}catch(e){this.reject(e)}}function o(e,t){var n=this;~this.status||(this.status=e,e?this.value=t:this.reason=t,i.call(n))}function i(){if(~this.status){for(var e=this,t=e._events,n=e.status?e.value:e.reason,r=e.status?0:1,o=0;o<t.length;o++)!function(t){var o=t[r],i=t[2];s(o,n,i,e.status)}(t[o]);t=[]}}function s(t,n,r,o){var i=r.resolve,s=r.reject;"function"==typeof t?e(function(){var e;try{e=t(n)}catch(e){return void s(e)}i(e)}):o?i(n):s(n)}var u=function(){};return r.defer=function(){var e=new r(u);return{promise:e,resolve:e.resolve,reject:e.reject}},r.resolve=function(e){return n(e)?e:new r(function(t,n){t(e)})},r.reject=function(e){return new r(function(t,n){n(e)})},Promise.prototype.toString=function(){return"[object Promise]"},r.prototype.then=function(e,t){var n=this.status,o=r.defer(),i=o.promise;return~n?n&&"function"==typeof e?s(e,this.value,i,n):n||"function"!=typeof t?n?o.resolve(this.value):o.reject(this.reason):s(t,this.reason,i,n):this._events.push([e,t,i]),i},r}},{}]},{},[1]);
{
"name": "easy-promise",
"version": "0.0.3",
"version": "0.0.4",
"description": "Pnly Promises/A+ implementation",

@@ -18,3 +18,3 @@ "main": "nextTick.js",

"author": "cnwhy <w.why@163.com>",
"license": "BSD",
"license": "BSD-2-Clause",
"bugs": {

@@ -21,0 +21,0 @@ "url": "https://github.com/cnwhy/promise/issues"

# easy-promise
Pnly Promises/A+ implementation
If you want to make a more powerful `Promise` class, it is recommended to use the [extend-promise] (https://github.com/cnwhy/extend-promise) extension.
If you want to make a more powerful `Promise` class, it is recommended to use the [extend-promise](https://github.com/cnwhy/extend-promise) extension.

@@ -13,4 +13,6 @@ ## API

## Install
npm install easy-promise
bower install easy-promise
**npm**
`npm install easy-promise`
**bower**
`bower install easy-promise`

@@ -30,4 +32,4 @@ ## Use

### In the no Promise browser
`dist/easy-Promise.js` (gzip 1.7k)
`dist/easy-Promise.min.js` (gzip 1.1k)
- `dist/easy-Promise.js` (gzip 1.8k)
- `dist/easy-Promise.min.js` (gzip 1.2k)

@@ -108,3 +108,3 @@ "use strict";

Promise.prototype.toString = function () {
Promise_.prototype.toString = function () {
return "[object Promise]";

@@ -111,0 +111,0 @@ }

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc