Socket
Socket
Sign inDemoInstall

module-alias

Package Overview
Dependencies
0
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.10 to 2.0.0

README.md

13

index.js

@@ -25,3 +25,3 @@ 'use strict'

for (var alias in moduleAliases) {
if (request.indexOf(alias) === 0) {
if (isPathMatchesAlias(request, alias)) {
request = nodePath.join(

@@ -37,2 +37,12 @@ moduleAliases[alias],

function isPathMatchesAlias (path, alias) {
// Matching /^alias(\/|$)/
if (path.indexOf(alias) === 0) {
if (path.length === alias.length) return true
if (path[alias.length] === '/') return true
}
return false
}
function addPathHelper (path, targetArray) {

@@ -162,2 +172,3 @@ path = nodePath.normalize(path)

module.exports.addAliases = addAliases
module.exports.isPathMatchesAlias = isPathMatchesAlias
module.exports.reset = reset

4

package.json
{
"name": "module-alias",
"description": "Create aliases of directories and register custom module paths in NodeJS like a boss!",
"version": "1.0.10",
"version": "2.0.0",
"author": {
"name": "Nikita Gavrilov",
"name": "Nick Gavrilov",
"email": "artnikpro@gmail.com"

@@ -8,0 +8,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc