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

publint

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

publint - npm Package Compare versions

Comparing version 0.2.10 to 0.2.11

4

package.json
{
"name": "publint",
"version": "0.2.10",
"version": "0.2.11",
"description": "Lint packaging errors",

@@ -47,3 +47,3 @@ "type": "module",

"npm-packlist": "^5.1.3",
"picocolors": "^1.0.1",
"picocolors": "^1.1.0",
"sade": "^1.8.1"

@@ -50,0 +50,0 @@ },

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

import c from 'picocolors'
import picocolors from 'picocolors'
import {

@@ -8,7 +8,21 @@ formatMessagePath as fp,

/** @type { import('picocolors/types.js').Colors | undefined } */
let _picocolorsHasColors
/** @type { import('picocolors/types.js').Colors | undefined } */
let _picocolorsNoColors
/**
* @param {import('../index.d.ts').Message} m
* @param {import('./utils.js').Pkg} pkg
* @param {import('../utils.d.ts').FormatMessageOptions} opts
*/
export function formatMessage(m, pkg) {
export function formatMessage(m, pkg, opts = {}) {
/** @type { import('picocolors/types.js').Colors } */
let c = picocolors
if (opts.color === true) {
c = _picocolorsHasColors ??= picocolors.createColors(true)
} else if (opts.color === false) {
c = _picocolorsNoColors ??= picocolors.createColors(false)
}
/** @param {string[]} path */

@@ -15,0 +29,0 @@ const pv = (path) => getPkgPathValue(pkg, path)

@@ -5,2 +5,12 @@ import type { Message } from './index.js'

export interface FormatMessageOptions {
/**
* Whether the returned string should contain color.
* - `true`: Force has color.
* - `false`: Force no color.
* - `undefined`: Default to whether the environment supports color.
*/
color?: boolean | undefined
}
export declare function formatMessagePath(path: string[]): string

@@ -10,3 +20,4 @@ export declare function getPkgPathValue(pkg: Pkg, path: string[]): any

msg: Message,
pkg: Pkg
pkg: Pkg,
opts?: FormatMessageOptions
): string | undefined
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