Socket
Socket
Sign inDemoInstall

require-dir

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

require-dir - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

test/camelcase.js

17

index.js

@@ -123,3 +123,20 @@ // requireDir.js

if (opts.camelcase) {
for (var base in map) {
// protect against enumerable object prototype extensions:
if (!map.hasOwnProperty(base)) {
continue;
}
map[toCamelCase(base)] = map[base];
}
}
return map;
};
function toCamelCase(str) {
return str.replace(/[_-][a-z]/ig, function (s) {
return s.substring(1).toUpperCase();
});
}

2

package.json
{ "name": "require-dir"
, "description": "Helper to require() directories."
, "version": "0.2.0"
, "version": "0.3.0"
, "author": "Aseem Kishore <aseem.kishore@gmail.com>"

@@ -5,0 +5,0 @@ , "license": "MIT"

@@ -63,2 +63,6 @@ [![Build Status](https://travis-ci.org/aseemk/requireDir.svg?branch=master)](https://travis-ci.org/aseemk/requireDir)

`camelcase`: Automatically add camelcase aliases for files with dash- and
underscore-separated names. E.g. `foo-bar.js` will be exposed under both the
original `'foo-bar'` name as well as a `'fooBar'` alias. Default is false.
`duplicates`: By default, if multiple files share the same basename, only the

@@ -65,0 +69,0 @@ highest priority one is `require()`'d and returned. (Priority is determined by

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