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

nature

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nature - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

lib/thing.js

@@ -288,3 +288,3 @@ "use strict";

this.set(option, true);
} else if (!optionPattern.test(arrayItems[0])) {
} else if (arrayItems.length && !optionPattern.test(arrayItems[0])) {
this.set(option, arrayItems.shift());

@@ -291,0 +291,0 @@ }

{
"name": "nature",
"version": "0.1.0",
"version": "0.1.1",
"description": "Classify the things in your world and how they interact.",

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

@@ -256,3 +256,33 @@ var assert = require("assert"),

});
it("set(process.argv) should set correct defaults", function(){
process.argv = [
"/usr/local/bin/node", "/usr/local/bin/rename", "file1.test","file2.test", "file3.test",
"file4.test", "file5.test", "--num", "--num2", "-f", "-m", "-d", "-r"
];
_thing
.define({
name: "files",
type: Array,
required: true,
defaultOption: true,
default: []
})
.define({ name: "find", type: "string", alias: "f" })
.define({ name: "make", type: "string", alias: "m", default: "pie" })
.define({ name: "num", type: "number" })
.define({ name: "num2", type: "number", default: 10 })
.define({ name: "replace", type: "string", alias: "r", default: "" })
.define({ name: "dry-run", type: "boolean", alias: "d" })
.set(process.argv);
assert.strictEqual(_thing.find, undefined, JSON.stringify(_thing.toJSON()));
assert.strictEqual(_thing.make, "pie", JSON.stringify(_thing.toJSON()));
assert.strictEqual(_thing.replace, "", JSON.stringify(_thing.toJSON()));
assert.strictEqual(_thing.num, undefined, JSON.stringify(_thing.toJSON()));
assert.strictEqual(_thing.num2, 10, JSON.stringify(_thing.toJSON()));
assert.strictEqual(_thing["dry-run"], true, JSON.stringify(_thing.toJSON()));
assert.deepEqual(_thing.files, ["file1.test", "file2.test", "file3.test", "file4.test", "file5.test"]);
});
it("set(optionsArray) with a type Array", function(){

@@ -259,0 +289,0 @@ _thing.define({ name:"one", type: Array });

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