Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

improved

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

improved - npm Package Compare versions

Comparing version
1.7.0
to
1.8.0
+3
dist/regex.d.ts
export declare function all(re: RegExp, str: string): string[] | string[][] | undefined;
export declare function single(re: RegExp, str: string): string[] | undefined;
export default function capture(re: RegExp, str: string): string[] | string[][] | undefined;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function all(re, str) {
if (!re.global) {
console.info("Executing regex.all on regex without global flag, falling back to regex.single");
return single(re, str);
}
let exec = re.exec(str);
const arr = [];
while (exec !== null) {
const [, ...captures] = exec;
arr.push(captures);
exec = re.exec(str);
}
return arr;
}
exports.all = all;
function single(re, str) {
const exec = re.exec(str);
if (!exec)
return undefined;
const [, ...captures] = exec;
return captures;
}
exports.single = single;
function capture(re, str) {
return re.global ? all(re, str) : single(re, str);
}
exports.default = capture;
//# sourceMappingURL=regex.js.map
{"version":3,"file":"regex.js","sourceRoot":"","sources":["../src/regex.ts"],"names":[],"mappings":";;AAAA,SAAgB,GAAG,CAAC,EAAU,EAAE,GAAW;IACzC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE;QACd,OAAO,CAAC,IAAI,CACV,gFAAgF,CACjF,CAAA;QACD,OAAO,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,CAAA;KACvB;IAED,IAAI,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACvB,MAAM,GAAG,GAAe,EAAE,CAAA;IAE1B,OAAO,IAAI,KAAK,IAAI,EAAE;QACpB,MAAM,CAAC,EAAE,GAAG,QAAQ,CAAC,GAAG,IAAI,CAAA;QAC5B,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAClB,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;KACpB;IAED,OAAO,GAAG,CAAA;AACZ,CAAC;AAlBD,kBAkBC;AAED,SAAgB,MAAM,CAAC,EAAU,EAAE,GAAW;IAC5C,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACzB,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAA;IAE3B,MAAM,CAAC,EAAE,GAAG,QAAQ,CAAC,GAAG,IAAI,CAAA;IAC5B,OAAO,QAAQ,CAAA;AACjB,CAAC;AAND,wBAMC;AAED,SAAwB,OAAO,CAAC,EAAU,EAAE,GAAW;IACrD,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,CAAA;AACnD,CAAC;AAFD,0BAEC"}
+1
-1
{
"name": "improved",
"version": "1.7.0",
"version": "1.8.0",
"description": "Collection of useful node extensions to its standard library",

@@ -5,0 +5,0 @@ "scripts": {