Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

relevant-urban

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

relevant-urban - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

5

package.json
{
"name": "relevant-urban",
"version": "1.2.1",
"version": "1.2.2",
"description": "Urban Dictionary API wrapper made for everyone with useful methods using promises and snekfetch",

@@ -21,3 +21,4 @@ "main": "urban.js",

"lint": "eslint urban.js test/test.js",
"check": "node test/test.js"
"lint:fix": "eslint --fix urban.js test/test.js",
"check": "ava -v"
},

@@ -24,0 +25,0 @@ "repository": {

30

test/test.js
const urban = require('../urban.js');
const line = '\n' + '-'.repeat(40);
const test = require('ava');
const print = urBan => console.log(
`${urBan.id} | ${urBan.word}\n\n${urBan.definition}` +
line);
test('Fetching random urban definition', t => urban.random()
.then(d =>t.truthy(d))
.catch(e => t.falsy(e)));
console.log(line);
test('Fetching \'hello\' urban definition', t => urban('hello')
.then(d =>t.truthy(d))
.catch(e => t.falsy(e)));
urban.random()
.then(print);
test('Fetching \'fsiojgjsgjsgihsghghjsh\' urban definition', t => urban('fsiojgjsgjsgihsghghjsh')
.then(d =>t.falsy(d))
.catch(e => t.falsy(e)));
urban('hello')
.then(print);
test('Fetching random specific urban definition', t => urban.random('hello')
.then(d =>t.truthy(d))
.catch(e => t.falsy(e)));
urban.all('hello')
.then(u => print(u[0]));
urban.random('hello')
.then(print);
test('Fetching all specific urban definitions', t => urban.all('hello')
.then(d =>t.true(typeof d == 'object'))
.catch(e => t.falsy(e)));

@@ -8,3 +8,3 @@ const snekfetch = require('snekfetch');

.then(res => res.body)
.then(body => body.result_type == 'no_results' ? null : body);
.then(body => body.result_type == 'no_results' ? Promise.reject(null) : body);
}

@@ -18,3 +18,3 @@

sounds: body.sounds
}) : null);
}) : Promise.reject(null));
}

@@ -28,3 +28,3 @@

sounds: body.sounds
}) : null);
}) : Promise.reject(null));
}

@@ -41,3 +41,3 @@

sounds: body.sounds
}) : null);
}) : Promise.reject(null));
}

@@ -44,0 +44,0 @@

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