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

@sensorfactdev/draconarius

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sensorfactdev/draconarius - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

lib/isArrayOfStrings.js

2

API.md

@@ -60,3 +60,3 @@ <a name="Draconarius"></a>

| --- | --- |
| flags | <code>object</code> |
| flags | <code>object</code> \| <code>array</code> |

@@ -63,0 +63,0 @@ <a name="Draconarius.version"></a>

const Pack = require('../package.json');
const isArrayOfStrings = require('./isArrayOfStrings');
const isObject = require('./isObject');

@@ -11,11 +12,13 @@ const isValidFlagValue = require('./isValidFlagValue');

* Creates an instance of Draconarius.
* @param {object} flags
* @param {object|array} flags
* @memberof Draconarius
*/
constructor(flags) {
if (!isObject(flags)) {
throw new TypeError(`Draconarius constructor expects flags to be an object but received \`${JSON.stringify(flags)}\``);
constructor(flags = []) {
if (isArrayOfStrings(flags)) {
this.flags = flags.reduce((acc, flag) => ({ ...acc, [flag]: true }), {});
} else if (isObject(flags)) {
this.flags = flags;
} else {
throw new TypeError(`Draconarius constructor expects flags to be an object or an array of strings, but received \`${JSON.stringify(flags)}\``);
}
this.flags = flags;
}

@@ -22,0 +25,0 @@

{
"name": "@sensorfactdev/draconarius",
"version": "1.0.0",
"version": "1.1.0",
"description": "Manage (feature)flags like a Roman soldier\"",

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

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