Socket
Socket
Sign inDemoInstall

weapon-regex

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

weapon-regex - npm Package Compare versions

Comparing version 1.0.3 to 1.1.0

core/target/js-3/weapon-regex-opt/main.js

124

index.d.ts
export interface Location {
start: Position;
end: Position;
start: Position;
end: Position;
}
export interface Position {
line: number;
column: number;
line: number;
column: number;
}

@@ -12,6 +13,7 @@

declare class ParserFlavorJSClass {
private __marker: 'js';
private __marker: 'js';
}
declare class ParserFlavorJVMClass {
private __marker: 'jvm';
private __marker: 'jvm';
}

@@ -25,36 +27,37 @@

export interface TokenMutator {
name: string;
levels: number[];
description: string;
name: string;
levels: number[];
description: string;
}
export interface MutationOptions {
mutators?: TokenMutator[];
mutationLevels?: number[];
flavor?: ParserFlavor;
mutators?: TokenMutator[];
mutationLevels?: number[];
flavor?: ParserFlavor;
}
export interface Mutant {
/** The replacement pattern
*/
pattern: string;
/** The replacement pattern
*/
pattern: string;
/** Name of the mutation
*/
name: string;
/** Name of the mutation
*/
name: string;
/** [[weaponregex.model.Location]] in the original string where the mutation occurred
*/
location: Location;
/** [[weaponregex.model.Location]] in the original string where the mutation occurred
*/
location: Location;
/** The mutation levels of the mutator
*/
levels: number[];
/** The mutation levels of the mutator
*/
levels: number[];
/** Description on the mutation
*/
description: string;
/** Description on the mutation
*/
description: string;
}
/** Mutate using the given mutators at some specific mutation levels
/** Mutate a regex pattern with the given options.
*
* @param pattern

@@ -66,4 +69,5 @@ * Input regex string

* {
* mutators: [Mutators to be used for mutation],
* mutationLevels: [Target mutation levels. If this is `null`, the `mutators` will not be filtered],
* mutators: [Mutators to be used for mutation. If this is `null`, all built-in mutators will be used.],
* mutationLevels: [Target mutation levels. If this is `null`, the `mutators`, will not be filtered.],
* flavor: [Regex flavor. By the default, `ParerFlavorJS` will be used.]
* }

@@ -73,7 +77,9 @@ * }}}

* A JavaScript Array of [[weaponregex.model.mutation.Mutant]] if can be parsed, or throw an exception otherwise
* @deprecated Use `mutate(pattern, flags, options)` instead. This will be removed in the future.". @since 0.7.x
* @deprecated
* Use `mutate(pattern, flags, options)` instead. This will be removed in the future.". @since 0.7.x
*/
export function mutate(pattern: string, options: MutationOptions): Mutant[];
/** Mutate using the given mutators at some specific mutation levels
/** Mutate a regex pattern and flags with the given options.
*
* @param pattern

@@ -87,4 +93,5 @@ * Input regex string

* {
* mutators: [Mutators to be used for mutation],
* mutationLevels: [Target mutation levels. If this is `null`, the `mutators` will not be filtered],
* mutators: [Mutators to be used for mutation. If this is `null`, all built-in mutators will be used.],
* mutationLevels: [Target mutation levels. If this is `null`, the `mutators`, will not be filtered.],
* flavor: [Regex flavor. By the default, `ParerFlavorJS` will be used.]
* }

@@ -97,3 +104,4 @@ * }}}

/** Mutate using the given mutators at some specific mutation levels
/** Mutate a regex pattern with the default options.
*
* @param pattern

@@ -111,29 +119,29 @@ * Input regex string

export const BuiltinMutators: {
/** JS Array of all built-in token mutators
*/
all: TokenMutator[];
/** JS Array of all built-in token mutators
*/
all: TokenMutator[];
/** JS Map that maps from a token mutator class names to the associating token mutator
*/
byName: Map<string, TokenMutator>;
/** JS Map that maps from a token mutator class names to the associating token mutator
*/
byName: Map<string, TokenMutator>;
/** JS Map that maps from mutation level number to token mutators in that level
*/
byLevel: Map<number, TokenMutator[]>;
/** JS Map that maps from mutation level number to token mutators in that level
*/
byLevel: Map<number, TokenMutator[]>;
/** Get all the token mutators in the given mutation level
* @param mutationLevel
* Mutation level number
* @return
* Array of all the tokens mutators in that level, if any
*/
atLevel(mutationLevel: number): TokenMutator[];
/** Get all the token mutators in the given mutation level
* @param mutationLevel
* Mutation level number
* @return
* Array of all the tokens mutators in that level, if any
*/
atLevel(mutationLevel: number): TokenMutator[];
/** Get all the token mutators in the given mutation levels
* @param mutationLevels
* Mutation level numbers
* @return
* Array of all the tokens mutators in that levels, if any
*/
atLevels(mutationLevels: number[]): TokenMutator[];
/** Get all the token mutators in the given mutation levels
* @param mutationLevels
* Mutation level numbers
* @return
* Array of all the tokens mutators in that levels, if any
*/
atLevels(mutationLevels: number[]): TokenMutator[];
};

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

export * from './core/target/js-2.13/weapon-regex-opt/main.js'
export * from './core/target/js-3/weapon-regex-opt/main.js'
{
"name": "weapon-regex",
"type": "module",
"version": "1.0.3",
"version": "1.1.0",
"description": "Weapon regeX mutates regular expressions for use in mutation testing.",

@@ -6,0 +6,0 @@ "main": "./index.js",

@@ -1,3 +0,1 @@

# Weapon regeX
[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fstryker-mutator%2Fweapon-regex%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/stryker-mutator/weapon-regex/main)

@@ -7,4 +5,6 @@ [![Build Status](https://github.com/stryker-mutator/weapon-regex/workflows/Scala%20CI/badge.svg)](https://github.com/stryker-mutator/weapon-regex/actions?query=workflow%3AScala%20CI+branch%3Amain)

<img src="images/WeaponRegeX_logo.svg" width="50%" alt="Weapon regeX Logo">
<img src="images/WeaponRegeX_logo.svg" width="25%" alt="Weapon regeX Logo">
# Weapon regeX
Weapon regeX mutates regular expressions for use in mutation testing. It has been designed from the ground up

@@ -18,3 +18,3 @@ to support [Stryker Mutator](https://github.com/stryker-mutator). Weapon regeX is available for both

The current supported versions for Scala are: `2.12` and `2.13`.
The current supported versions for Scala are: `2.12`, `2.13` and `3`.

@@ -27,3 +27,3 @@ # Getting started

Add Weapon regeX to your `build.sbt` [![Maven Central](https://img.shields.io/maven-central/v/io.stryker-mutator/weapon-regex_2.13.svg?label=Maven%20Central&colorB=brightgreen)](https://search.maven.org/artifact/io.stryker-mutator/sbt-stryker4s):
Add Weapon regeX to your `build.sbt` [![Maven Central](https://img.shields.io/maven-central/v/io.stryker-mutator/weapon-regex_3.svg?label=Maven%20Central&colorB=brightgreen)](https://search.maven.org/artifact/io.stryker-mutator/weapon-regex_3):

@@ -103,5 +103,2 @@ ```scala

): Either[String, Seq[Mutant]] = ???
WeaponRegeX.mutate _
// res1: (String, Seq[TokenMutator], Seq[Int], ParserFlavor) => Either[String, Seq[Mutant]] = <function4>
```

@@ -108,0 +105,0 @@

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