Comparing version 0.1.0 to 0.2.0
{ | ||
"name": "a2a", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Async await to Array", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"scripts": { | ||
"test": "nyc --reporter=html mocha" | ||
"test": "nyc --reporter=html mocha && ts-node test/tsd.ts" | ||
}, | ||
@@ -26,5 +27,8 @@ "repository": { | ||
"devDependencies": { | ||
"@types/node": "^10.12.4", | ||
"mocha": "^5.2.0", | ||
"nyc": "^13.0.1" | ||
"nyc": "^13.0.1", | ||
"ts-node": "^7.0.1", | ||
"typescript": "^3.1.6" | ||
} | ||
} |
@@ -18,3 +18,3 @@ # A2A - Async Await to Array | ||
```js | ||
const A2A = require('@iinc/a2a'); | ||
const A2A = require('a2a'); | ||
const axios = require('axios'); | ||
@@ -48,1 +48,20 @@ | ||
``` | ||
## TypeScript | ||
```ts | ||
import a2a from 'a2a'; | ||
a2a(Promise.resolve(123)) // => Promise<[any, number]> | ||
.then(([error, result]) => { | ||
console.log(result as number); | ||
}); | ||
// => Promise<[any, number|string]> | ||
a2a<number|string>(Promise.resolve('123')); | ||
// => Promise<[any, Array<number|string>]> | ||
a2a<number|string>([Promise.resolve('123')]); | ||
// => Promise<[Error, number|string>> | ||
a2a<number|string, Error>(Promise.resolve('123')); | ||
``` |
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
4070
6
39
66
5