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

paths.macro

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

paths.macro - npm Package Compare versions

Comparing version 2.0.2 to 3.0.0

22

macro.js

@@ -5,3 +5,3 @@ const path = require('path');

const findRoot = require('find-root');
const { createMacro } = require('babel-macros');
const { createMacro } = require('babel-plugin-macros');
const { toUnix } = require('upath');

@@ -13,10 +13,14 @@

const _file = path.basename(_fileAbsolute);
const _extention = path.extname(_fileAbsolute);
const _filename = _file.replace(_extention, '');
const _extension = path.extname(_fileAbsolute);
const _filename = _file.replace(_extension, '');
const _npmRoot = toUnix(findRootAttempt(_osDependentAbsolute));
const _gitRoot = toUnix(findRootAttempt(_osDependentAbsolute, (dir) => fs.existsSync(path.resolve(dir, '.git'))));
const _gitRoot = toUnix(
findRootAttempt(_osDependentAbsolute, dir =>
fs.existsSync(path.resolve(dir, '.git')),
),
);
const _wd = toUnix(process.cwd());
const _baseAbsolute = _fileAbsolute.replace(_file, '');

@@ -31,3 +35,3 @@ const _base = _baseAbsolute.replace(_npmRoot, '');

file: _file,
extention: _extention,
extension: _extension,
filename: _filename,

@@ -58,5 +62,5 @@ baseAbsolute: _baseAbsolute,

});
})
});
};
module.exports = createMacro(macro);
{
"name": "paths.macro",
"version": "2.0.2",
"version": "3.0.0",
"description": "Babel plugin that returns an object containing paths like __dirname and __filename as static values",

@@ -30,11 +30,10 @@ "keywords": [

"dependencies": {
"babel-macros": "^1.2.0",
"babel-plugin-macros": "^2.0.0",
"babel-plugin-macros": "^2.8.0",
"find-root": "^1.1.0",
"upath": "^1.0.2"
"upath": "^1.2.0"
},
"devDependencies": {
"babel-core": "^6.26.0",
"jest": "^22.1.4"
"@babel/core": "^7.10.2",
"jest": "^26.0.1"
}
}

@@ -14,3 +14,3 @@ # Babel paths.macro

file | `input.js`
extention | `.js`
extension | `.js`
filename | `input`

@@ -27,3 +27,3 @@ baseAbsolute | `/Users/you/project/src/`

```js
import base, { filename } from 'babel-plugin-module-paths/paths.macro';
import base, { filename } from 'paths.macro';

@@ -36,3 +36,3 @@ console.log(base, filename);

return [filename, base];
};
}
```

@@ -49,3 +49,3 @@

return ["input", "/src/"];
};
}
```

@@ -58,3 +58,3 @@

```sh
yarn add babel-plugin-module-paths
yarn add paths.macro
```

@@ -61,0 +61,0 @@

@@ -9,2 +9,2 @@ import base, { filename } from '../macro';

return [filename, base];
};
}

@@ -1,2 +0,2 @@

const babel = require('babel-core');
const babel = require('@babel/core');

@@ -3,0 +3,0 @@ const options = {

Sorry, the diff of this file is not supported yet

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