@js-bits/xpromise
Advanced tools
Comparing version 0.1.3 to 0.2.0
import enumerate from '@js-bits/enumerate'; | ||
console.log(`xpromise import mode ${typeof require === 'undefined' ? 'esm' : 'cjs'}`); | ||
// pseudo-private properties emulation in order to avoid source code transpiling | ||
@@ -4,0 +6,0 @@ // TODO: replace with #privateField syntax when it gains wide support |
/* eslint-disable max-classes-per-file */ | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import { jest } from '@jest/globals'; | ||
import { cyan } from '@js-bits/log-in-color'; | ||
import ExtendablePromise from './index.js'; | ||
// import ExtendablePromise from './dist/index.cjs'; | ||
// const ExtendablePromise = require('./dist/index.cjs'); | ||
const env = cyan(`[${typeof window === 'undefined' ? 'node' : 'jsdom'}]`); | ||
describe(`ExtendablePromise: ${env}`, () => { | ||
describe(`ExtendablePromise`, () => { | ||
let executorFunc; | ||
@@ -11,0 +10,0 @@ let promise; |
{ | ||
"name": "@js-bits/xpromise", | ||
"version": "0.1.3", | ||
"version": "0.2.0", | ||
"description": "Extendable Promise", | ||
@@ -13,9 +13,20 @@ "keywords": [ | ||
"type": "module", | ||
"main": "./dist/index.cjs", | ||
"module": "./index.js", | ||
"exports": "./index.js", | ||
"exports": { | ||
".": { | ||
"require": "./dist/index.cjs", | ||
"default": "./index.js" | ||
} | ||
}, | ||
"scripts": { | ||
"build": "rollup ./index.js --format cjs --file dist/index.cjs --exports default", | ||
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --verbose", | ||
"test-cjs": "jest --verbose", | ||
"test-coverage": "yarn test --coverage", | ||
"test-watch": "yarn test --watch", | ||
"lint": "eslint '**/*.{js,jsx}'" | ||
"lint": "eslint '**/*.{js,jsx}'", | ||
"husky:pre-commit": "npx husky add .husky/pre-commit \"yarn build\" && npx husky add .husky/pre-commit \"git add dist/**.*\" && git add .husky/pre-commit", | ||
"husky:pre-push": "npx husky add .husky/pre-push \"yarn lint\" && npx husky add .husky/pre-push \"yarn test\" && git add .husky/pre-push", | ||
"husky:init": "npx husky install && yarn husky:pre-commit && yarn husky:pre-push" | ||
}, | ||
@@ -30,5 +41,7 @@ "repository": { | ||
"@js-bits/formalinter": "^0.1.2", | ||
"@js-bits/log-in-color": "^0.0.2", | ||
"@js-bits/log-in-color": "^0.3.1", | ||
"@types/jest": "^26.0.22", | ||
"jest": "^26.6.3" | ||
"husky": "^7.0.1", | ||
"jest": "^26.6.3", | ||
"rollup": "^2.55.1" | ||
}, | ||
@@ -55,4 +68,4 @@ "engines": { | ||
"dependencies": { | ||
"@js-bits/enumerate": "^0.4.0" | ||
"@js-bits/enumerate": "^0.5.1" | ||
} | ||
} |
@@ -25,2 +25,8 @@ # Extendable Promise | ||
or require for CommonJS: | ||
```javascript | ||
const ExtendablePromise = require('@js-bits/xpromise'); | ||
``` | ||
## How to use | ||
@@ -47,3 +53,2 @@ | ||
- Does not include any polyfills, which means that Internet Explorer is not supported. | ||
- Requires [ECMAScript modules](https://nodejs.org/api/esm.html) to be enabled in Node.js environment. Otherwise, compile into a CommonJS module. | ||
- [Alternative solution](https://stackoverflow.com/questions/48158730/extend-javascript-promise-and-resolve-or-reject-it-inside-constructor) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12977
9
326
53
6
+ Added@js-bits/enumerate@0.5.2(transitive)
- Removed@js-bits/enumerate@0.4.2(transitive)
Updated@js-bits/enumerate@^0.5.1