Socket
Socket
Sign inDemoInstall

@types/picomatch

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/picomatch - npm Package Compare versions

Comparing version 2.2.2 to 2.2.3

picomatch/lib/constants.d.ts

111

picomatch/index.d.ts

@@ -8,113 +8,4 @@ // Type definitions for picomatch 2.2

import parse = require('./parse');
import constants = require('./constants');
import picomatch = require('./lib/picomatch');
interface PicomatchOptions {
ignore?: string;
onResult?: (result: Result) => void;
onIgnore?: (result: Result) => void;
onMatch?: (result: Result) => void;
dot?: boolean;
windows?: boolean;
contains?: boolean;
format?: (input: string) => string;
}
interface ParseState {
input: string;
index: number;
start: number;
dot: boolean;
consumed: string;
output: string;
prefix: string;
backtrack: boolean;
negated: boolean;
negatedExtglob?: boolean;
brackets: number;
braces: number;
parens: number;
quotes: number;
globstar: boolean;
tokens: Array<Record<string, unknown>>;
}
type Matcher = (test: string) => boolean;
interface MatcherWithState extends Matcher {
state: ParseState;
}
interface Result {
glob: string;
state: any;
regex: RegExp;
posix: boolean;
input: string;
output: string;
match: ReturnType<Picomatch['test']>['match'];
isMatch: ReturnType<Picomatch['test']>['isMatch'];
}
interface Picomatch {
/**
* Creates a matcher function from one or more glob patterns. The
* returned function takes a string to match as its first argument,
* and returns true if the string is a match. The returned matcher
* function also takes a boolean as the second argument that, when true,
* returns an object with additional information.
*
* ```js
* const picomatch = require('picomatch');
* // picomatch(glob[, options]);
*
* const isMatch = picomatch('*.!(*a)');
* console.log(isMatch('a.a')); //=> false
* console.log(isMatch('a.b')); //=> true
* ```
* @param glob One or more glob patterns.
* @return Returns a matcher function.
* @api public
*/
<T extends true | false>(
glob: string | string[],
options?: PicomatchOptions,
returnState?: T
): T extends true ? MatcherWithState : Matcher;
test(
input: string,
regex: RegExp,
options?: PicomatchOptions,
test?: {},
): { isMatch: boolean; match: boolean; output: any };
matchBase(input: string, glob: RegExp | string, options: {}, posix?: any): boolean;
isMatch(str: string | string[], patterns: string | string[], options?: {}): boolean;
parse(pattern: string, options: {}): {};
scan(input: string, options: {}): {};
compileRe(
state: ReturnType<typeof parse>,
options?: PicomatchOptions,
returnOutput?: boolean,
returnState?: boolean,
): RegExp;
makeRe(
input: string,
options?: PicomatchOptions,
returnOutput?: boolean,
returnState?: boolean,
): Picomatch['compileRe'];
toRegex(source: string | RegExp, options?: { flags?: string; nocase?: boolean; debug?: boolean }): RegExp;
constants: typeof constants;
}
declare const picomatch: Picomatch;
export = picomatch;
{
"name": "@types/picomatch",
"version": "2.2.2",
"version": "2.2.3",
"description": "TypeScript definitions for picomatch",

@@ -27,4 +27,4 @@ "license": "MIT",

"dependencies": {},
"typesPublisherContentHash": "7bf0ec2a05c440dd31b713a5be64dbaf1b544aab31376b514f2bef6f4ec5d022",
"typesPublisherContentHash": "e0fb33a3986888dac8c2ff6e53b213b526bb8bffec21265d50835ab083b85318",
"typeScriptVersion": "3.5"
}

@@ -11,3 +11,3 @@ # Installation

### Additional Details
* Last updated: Mon, 12 Apr 2021 20:31:18 GMT
* Last updated: Thu, 06 May 2021 19:31:23 GMT
* Dependencies: none

@@ -14,0 +14,0 @@ * Global values: none

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