machinepack-strings
Advanced tools
Comparing version 5.0.0 to 5.1.0
@@ -48,4 +48,24 @@ module.exports = { | ||
defaultsTo: true | ||
}, | ||
global: { | ||
friendlyName: 'Replace all?', | ||
description: 'Whether or not to replace all substrings that match the regular expression, or just the first.', | ||
extendedDescription: 'This will build the regular expression using the `/g` modifier.', | ||
example: true, | ||
advanced: true, | ||
defaultsTo: false | ||
}, | ||
multiline: { | ||
friendlyName: 'Multiline?', | ||
description: 'Whether to treat beginning and end characters (^ and $) as matching each line delimited by \\n or \\r.', | ||
extendedDescription: 'This will build the regular expression using the `/m` modifier.', | ||
example: true, | ||
advanced: true, | ||
defaultsTo: false | ||
} | ||
}, | ||
@@ -95,5 +115,15 @@ | ||
// (and if relevant, enable case-insensitivity) | ||
var modifiers = ''; | ||
if (inputs.caseInsensitive) { | ||
regexp = new RegExp(regexp, 'i'); | ||
modifiers += 'i'; | ||
} | ||
if (inputs.global) { | ||
modifiers += 'g'; | ||
} | ||
if (inputs.multiline) { | ||
modifiers += 'm'; | ||
} | ||
if (modifiers.length) { | ||
regexp = new RegExp(regexp, modifiers); | ||
} | ||
else { | ||
@@ -100,0 +130,0 @@ regexp = new RegExp(regexp); |
{ | ||
"name": "machinepack-strings", | ||
"version": "5.0.0", | ||
"version": "5.1.0", | ||
"description": "Work with strings.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68873
1984
1