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

@tng/gta

Package Overview
Dependencies
Maintainers
5
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tng/gta - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

yarn.lock

6

lib/gta.js
const request = require('request-promise')
class Gta {
class GTA {
// static myProp = 42;

@@ -35,4 +35,2 @@ constructor (options = {}) {

const gta = new Gta()
gta.Gta = Gta
module.exports = gta
module.exports = GTA
{
"name": "@tng/gta",
"version": "1.0.1",
"version": "1.0.2",
"description": "TNG GTA ==============",

@@ -5,0 +5,0 @@ "main": "index.js",

TNG GTA
==============
## 使用
## 安装
```
yarn add @tng/gta
重写的request-promise模块
```
### 用法一
### 使用
```js
const { Gta } = require('@tng/gta')
const gta = new Gta({url:'https://gta.teambition.net/v1/track/'})
const GTA = require('@tng/gta')
const gta = new GTA({url:'https://gta.teambition.net/v1/track/'})

@@ -25,22 +23,8 @@ // get方法

// {event: 1}
```
### 用法二
```js
const gta = require('@tng/gta')
// note: options 参考 request模块
// 指定 options
const gta = new GTA()
const options = { url: 'https://gta.teambition.net/v1/track/' }
// get方法
// @return promise
console.log(yield gta.get({ param: 'abc' }, options))
// {event: 1}
// post方法
// @return promise
console.log(yield gta.post({ param: 'abc' }, options))
// {event: 1}
```

@@ -5,4 +5,3 @@ 'use strict'

const GTA = rewire('../lib/gta')
const { Gta } = GTA
const cgta = new Gta({url: 'http://gaohuifeng.cn/api'})
const gta = new GTA({url: 'http://gaohuifeng.cn/api'})
describe('gta', () => {

@@ -37,21 +36,16 @@ const params = {

it('cgta get should ok', function * () {
const data = yield cgta.get(params)
it('gta get should ok', function * () {
const data = yield gta.get(params)
expect(data).eql('Hello World')
})
it('cgta get should ok', function * () {
const data = yield cgta.get(params, options)
it('gta get should ok', function * () {
const data = yield gta.get(params, options)
expect(data).eql('Hello World')
})
it('cgta post should ok', function * () {
const data = yield cgta.post(params)
it('gta post should ok', function * () {
const data = yield gta.post(params)
expect(data).eql('Hello World')
})
it('GAT get should ok', function * () {
const data = yield GTA.get(params, options)
expect(data).eql('Hello World')
})
})
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