Socket
Socket
Sign inDemoInstall

shortstop

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shortstop - npm Package Compare versions

Comparing version 1.0.1 to 1.0.3

6

index.js

@@ -42,3 +42,3 @@ /*───────────────────────────────────────────────────────────────────────────*\

if (isModule(file)) {
resolve(require(file), callback);
resolve(require(file), file, callback);
return;

@@ -55,3 +55,3 @@ }

data = JSON.parse(data);
resolve(data, callback);
resolve(data, file, callback);
} catch (err) {

@@ -66,2 +66,2 @@ callback(err);

};
};

@@ -139,5 +139,10 @@ /*───────────────────────────────────────────────────────────────────────────*\

*/
resolve: function resolve(data, callback) {
resolve: function resolve(data, filename, callback) {
var self, tasks, handler;
if (!callback) {
callback = filename;
filename = null;
}
self = this;

@@ -150,3 +155,3 @@

tasks = data.map(function (val) {
return resolve.bind(self, val);
return resolve.bind(self, val, filename);
});

@@ -157,3 +162,3 @@

Object.keys(data).forEach(function (key) {
tasks[key] = resolve.bind(self, data[key]);
tasks[key] = resolve.bind(self, data[key], filename);
});

@@ -181,2 +186,4 @@ }

if (handler.length < 2) {
// If the handler is single argument, expect its return value to be useful,
// so we wrap it up in continuation-passing style
return function wrapper(input, done) {

@@ -198,4 +205,6 @@ var data, error;

tasks.unshift(function init(done) {
tasks.unshift(tasks[0].length == 2 ? function init(done) {
done(null, data);
} : function init(done) {
done(null, data, filename);
});

@@ -202,0 +211,0 @@

{
"name": "shortstop",
"version": "1.0.1",
"version": "1.0.3",
"description": "Enable use of protocols (such as file:, buffer:, or method:) in configuration files.",

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

@@ -1,3 +0,8 @@

# shortstop
shortstop
=========
Lead Maintainer: [Poornima Venkat](https://github.com/pvenkatakrishnan/)
[![Build Status](https://travis-ci.org/krakenjs/shortstop.svg?branch=master)](https://travis-ci.org/krakenjs/shortstop)
Sometimes JSON just isn't enough for configuration needs. Occasionally it would be nice to use arbitrary types as values,

@@ -7,4 +12,2 @@ but JSON is necessarily a subset of all available JS types. `shortstop` enables the use of protocols and handlers to

[![Build Status](https://travis-ci.org/krakenjs/shortstop.png?branch=master)](https://travis-ci.org/krakenjs/shortstop)
```javascript

@@ -11,0 +14,0 @@ var fs = require('fs');

Sorry, the diff of this file is not supported yet

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