Socket
Socket
Sign inDemoInstall

@esbuild-plugins/node-modules-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@esbuild-plugins/node-modules-polyfill - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

src/polyfills.ts

2

dist/index.d.ts

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

import type { Plugin } from 'esbuild';
import { Plugin } from 'esbuild';
export interface NodePolyfillsOptions {

@@ -3,0 +3,0 @@ name?: string;

@@ -17,4 +17,6 @@ "use strict";

const escape_string_regexp_1 = __importDefault(require("escape-string-regexp"));
const fs_1 = __importDefault(require("fs"));
const path_1 = __importDefault(require("path"));
const modules_1 = require("rollup-plugin-polyfill-node/dist/modules");
const polyfills_1 = require("./polyfills");
// import { NodeResolvePlugin } from '@esbuild-plugins/node-resolve'
const NAME = 'node-modules-polyfills';

@@ -35,3 +37,3 @@ const NAMESPACE = NAME;

const commonjsNamespace = namespace + '-commonjs';
const polyfilledBuiltins = modules_1.getModules();
const polyfilledBuiltins = polyfills_1.builtinsPolyfills();
const polyfilledBuiltinsNames = [...polyfilledBuiltins.keys()];

@@ -55,5 +57,5 @@ return {

const isCommonjs = args.namespace.endsWith('commonjs');
const key = removeEndingSlash(argsPath);
const contents = polyfilledBuiltins.get(key);
const resolveDir = path_1.default.dirname(key);
const resolved = polyfilledBuiltins.get(removeEndingSlash(argsPath));
const contents = yield (yield fs_1.default.promises.readFile(resolved)).toString();
let resolveDir = path_1.default.dirname(resolved);
if (isCommonjs) {

@@ -60,0 +62,0 @@ return {

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

import type { Plugin } from 'esbuild';
import { Plugin } from 'esbuild';
export interface NodePolyfillsOptions {

@@ -3,0 +3,0 @@ name?: string;

@@ -11,4 +11,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

import escapeStringRegexp from 'escape-string-regexp';
import fs from 'fs';
import path from 'path';
import { getModules as builtinsPolyfills } from 'rollup-plugin-polyfill-node/dist/modules';
import { builtinsPolyfills } from './polyfills';
// import { NodeResolvePlugin } from '@esbuild-plugins/node-resolve'
const NAME = 'node-modules-polyfills';

@@ -48,5 +50,5 @@ const NAMESPACE = NAME;

const isCommonjs = args.namespace.endsWith('commonjs');
const key = removeEndingSlash(argsPath);
const contents = polyfilledBuiltins.get(key);
const resolveDir = path.dirname(key);
const resolved = polyfilledBuiltins.get(removeEndingSlash(argsPath));
const contents = yield (yield fs.promises.readFile(resolved)).toString();
let resolveDir = path.dirname(resolved);
if (isCommonjs) {

@@ -53,0 +55,0 @@ return {

{
"name": "@esbuild-plugins/node-modules-polyfill",
"version": "0.2.0",
"version": "0.2.1",
"description": "",

@@ -22,9 +22,9 @@ "main": "dist/index.js",

"devDependencies": {
"rollup": "^2.75.7",
"safe-buffer": "^5.2.1",
"test-support": "*"
"test-support": "*",
"@esbuild-plugins/node-globals-polyfill": "*"
},
"dependencies": {
"escape-string-regexp": "^4.0.0",
"rollup-plugin-polyfill-node": "^0.12.0"
"rollup-plugin-node-polyfills": "^0.2.1"
},

@@ -31,0 +31,0 @@ "peerDependencies": {

@@ -1,7 +0,9 @@

import type { OnResolveArgs, Plugin } from 'esbuild'
import esbuild from 'esbuild'
import { OnResolveArgs, Plugin } from 'esbuild'
import escapeStringRegexp from 'escape-string-regexp'
import fs from 'fs'
import path from 'path'
import { getModules as builtinsPolyfills } from 'rollup-plugin-polyfill-node/dist/modules'
import esbuild from 'esbuild'
import { builtinsPolyfills } from './polyfills'
// import { NodeResolvePlugin } from '@esbuild-plugins/node-resolve'
const NAME = 'node-modules-polyfills'

@@ -52,5 +54,9 @@ const NAMESPACE = NAME

const key = removeEndingSlash(argsPath)
const contents = polyfilledBuiltins.get(key)
const resolveDir = path.dirname(key)
const resolved = polyfilledBuiltins.get(
removeEndingSlash(argsPath),
)
const contents = await (
await fs.promises.readFile(resolved)
).toString()
let resolveDir = path.dirname(resolved)

@@ -57,0 +63,0 @@ if (isCommonjs) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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