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

stamina-api

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stamina-api - npm Package Compare versions

Comparing version 1.0.0-dev to 1.0.1-dev

6

errors/MessageErrors.js
module.exports = {
gettingOption_Missing: "[GETTING_OPTION_MISSING] The 'getting option' is missing.",
gettingOption_Invalid: "[GETTING_OPTION_INVALID] An invalid 'getting option' was provided.",
jokesByType_Missing: "[JOKES_BY_TYPE_MISSING] The 'by type option' is missing.",
jokesByType_Invalid: "[JOKES_BY_TYPE_INVALID] An invalid 'by type option' was provided.",
jokesByType_Missing: "[JOKES_BY_TYPE_MISSING] The 'type' is missing.",
jokesByType_Invalid: "[JOKES_BY_TYPE_INVALID] An invalid 'type' was provided.",
jokesById_Missing: "[JOKES_BY_ID_MISSING] The 'id' is missing.",
jokesById_Invalid: "[JOKES_BY_ID_INVALID] An invalid 'id' was provided.",
MUST_BE_TYPE_OBJECT: "The 'option' option must be an Object.",
MUST_BE_TYPE_STRING_ARRAY: "The 'disallow' option must be an Array or String.",
}

@@ -46,5 +46,12 @@ const MessageErrors = require("../errors/MessageErrors.js")

},
/*byId(id) {
return "id: "+id
}*/
byId(id) {
if (!id) throw new Error(MessageErrors.jokesById_Missing)
if (typeof id !== "number") throw new Error(MessageErrors.jokesById_Invalid)
var blagues = require("../jokes/jokes.json")
blagues = blagues.filter(b => b.id === Number(id))
if (blagues) {
return blagues
} else throw new Error(MessageErrors.jokesById_Invalid)
}
}
{
"name": "stamina-api",
"version": "1.0.0-dev",
"version": "1.0.1-dev",
"description": "Ce module est une api consernant le site Stamina et le jeu portant le même nom, nous sommes encore en développement, mais notre module sera utilisé par vous et par nous les développeurs de Stamina. Mais vous n'aurez accès aux fonctions de développement consernant l'infrastructure de Stamina.",

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

@@ -36,3 +36,3 @@ [![Discord](https://img.shields.io/discord/880133347446247574?color=informational&logo=discord&logoColor=white)](https://discord.gg/rCg6C7YJXJ)

A cette méthode, vous pouvez spécifier certains types que vous ne souhaitez pas
Avec cette méthode, vous pouvez spécifier certains types que vous ne souhaitez pas
recevoir.

@@ -60,3 +60,3 @@

```js
const blague = await api.jokes.byID(50);
const blague = await Stamina.get("jokes").byID(50);
```

@@ -63,0 +63,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