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

@node-loaders/core

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@node-loaders/core - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

7

dist/specifier.d.ts

@@ -17,1 +17,8 @@ export declare const createCheckUrl: (name: string) => string;

export declare const convertUrlDriveLetterToUpperCase: (url: string) => string;
/**
* Resolves a file specifier to a file path
* @param specifier accepts an absolute path, an relative path or and file url
* @param parentURL required for relative specifier, ignored otherwise
* @returns resolved file path
*/
export declare const specifierToFilePath: (specifier: string, parentURL?: string) => string;

21

dist/specifier.js
import { builtinModules } from 'node:module';
import { isAbsolute } from 'node:path';
import { dirname, isAbsolute, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import validateNpmPackageName from 'validate-npm-package-name';

@@ -42,2 +43,20 @@ const nodeProtocol = 'node:';

};
/**
* Resolves a file specifier to a file path
* @param specifier accepts an absolute path, an relative path or and file url
* @param parentURL required for relative specifier, ignored otherwise
* @returns resolved file path
*/
export const specifierToFilePath = (specifier, parentURL) => {
if (isAbsolute(specifier)) {
return specifier;
}
if (specifier.startsWith('.')) {
if (!parentURL) {
throw new Error(`Error resolving module ${specifier} without a parentUrl`);
}
return join(dirname(fileURLToPath(parentURL)), specifier);
}
return fileURLToPath(specifier);
};
//# sourceMappingURL=specifier.js.map

4

package.json
{
"name": "@node-loaders/core",
"version": "0.4.0",
"version": "0.5.0",
"private": false,

@@ -51,3 +51,3 @@ "keywords": [

},
"gitHead": "b3b07fa92591c620c422bf3345fdcc600cb19912"
"gitHead": "2839739754eb82b94488fe9e0765cd8623fff860"
}

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