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

tailwind-scrollbar

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tailwind-scrollbar - npm Package Compare versions

Comparing version 3.0.2 to 3.0.3

2

package.json
{
"name": "tailwind-scrollbar",
"version": "3.0.2",
"version": "3.0.3",
"description": "Tailwind plugin for styling scrollbars",

@@ -5,0 +5,0 @@ "author": "Graham Still <graham@gstill.dev>",

/**
* Imports a default export agnostic of whether CommonJS is in use or not.
* Gets the underlying default import of a module.
*

@@ -7,9 +7,9 @@ * This is used to handle internal imoprts from Tailwind, since Tailwind Play

*
* This is a hacky fix to get this working; in particular, it makes the typing
* very loose. Converting the entire module to typescript might have the side
* effect of making this function unnecessary.
*
* @param {string} path The path to import
* @returns {unknown} The imported module
* @template T
* @param {T | { __esModule: unknown, default: T }} mod The module
* @returns {T} The bare export
*/
export function agnosticRequire(path: string): unknown;
export function importDefault<T>(mod: T | {
__esModule: unknown;
default: T;
}): T;
/**
* Imports a default export agnostic of whether CommonJS is in use or not.
* Gets the underlying default import of a module.
*

@@ -7,18 +7,11 @@ * This is used to handle internal imoprts from Tailwind, since Tailwind Play

*
* This is a hacky fix to get this working; in particular, it makes the typing
* very loose. Converting the entire module to typescript might have the side
* effect of making this function unnecessary.
*
* @param {string} path The path to import
* @returns {unknown} The imported module
* @template T
* @param {T | { __esModule: unknown, default: T }} mod The module
* @returns {T} The bare export
*/
const agnosticRequire = path => {
// eslint-disable-next-line global-require, import/no-dynamic-require
const exported = require(path);
// eslint-disable-next-line no-underscore-dangle
return exported.__esModule && exported.default ? exported.default : exported;
};
// eslint-disable-next-line no-underscore-dangle
const importDefault = mod => (mod?.__esModule ? mod.default : mod);
module.exports = {
agnosticRequire
importDefault
};

@@ -0,6 +1,10 @@

const flattenColorPaletteImport = require('tailwindcss/lib/util/flattenColorPalette');
const toColorValueImport = require('tailwindcss/lib/util/toColorValue');
const typedefs = require('./typedefs');
const { agnosticRequire } = require('./helpers');
const { importDefault } = require('./helpers');
const flattenColorPalette = agnosticRequire('tailwindcss/lib/util/flattenColorPalette');
const toColorValue = agnosticRequire('tailwindcss/lib/util/toColorValue');
// Tailwind Play will import these internal imports as ES6 imports, while most
// other workflows will import them as CommonJS imports.
const flattenColorPalette = importDefault(flattenColorPaletteImport);
const toColorValue = importDefault(toColorValueImport);

@@ -7,0 +11,0 @@ const COMPONENTS = ['track', 'thumb', 'corner'];

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