New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

yahoo-exchange

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yahoo-exchange - npm Package Compare versions

Comparing version 1.0.0-alpha to 1.0.0-alpha.2

9

index.js

@@ -28,2 +28,11 @@ "use strict";

exports.getDataArray = getDataArray;
function getPairArray(currency, base) {
let list = [];
currency.forEach(v => base.forEach(v2 => {
if (v2 !== v)
list.push(v + v2);
}));
return list;
}
exports.getPairArray = getPairArray;
//# sourceMappingURL=index.js.map

10

index.ts

@@ -14,3 +14,3 @@ import request = require("request");

export function getDataArray(pair: Array<string>, callback: (data: number, pair?: string) => any, errorHandler: (error: Error, pair?: String) => any = err => console.log(err)): void {
pair.map(v => request({
pair.map(v => request({
url: `https://finance.yahoo.com/quote/${v}=X?p=${v}=X`,

@@ -22,2 +22,10 @@ encoding: null,

}));
}
export function getPairArray(currency: Array<string>, base: Array<string>): Array<string> {
let list: Array<string> = [];
currency.forEach(v => base.forEach(v2 => {
if (v2 !== v) list.push(v + v2);
}));
return list;
}

2

package.json

@@ -14,3 +14,3 @@ {

"main": "index.js",
"version": "1.0.0-alpha",
"version": "1.0.0-alpha.2",
"license": "MIT",

@@ -17,0 +17,0 @@ "dependencies": {

# yahoo-exchange
npm : https://www.npmjs.com/package/yahoo-exchange
## getData(pair, callback, errorHandler): void

@@ -43,2 +44,11 @@ ### Example

getDataArray does not return Array to Callback.
## getPairArray(currency: Array<string>, base: Array<string>): Array<string>
It Returns a pair array.
### Example
* ``` javascript
const currency = ['USD','JPY'];
const base = ['KRW'];
getPairArray(currency,base);
// ['USDKRW','JPYKRW'];
```
## test.js

@@ -45,0 +55,0 @@ * ``` javascript

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