@socketsecurity/lib 4.2.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/README.md +1 -1
- package/dist/external/fast-glob.js +5 -1
- package/dist/globs.d.ts +12 -0
- package/dist/globs.js +16 -4
- package/dist/package-default-node-range.d.ts +1 -0
- package/dist/package-extensions.js +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [4.3.0](https://github.com/SocketDev/socket-lib/releases/tag/v4.3.0) - 2025-11-20
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **globs**: New `glob()` and `globSync()` wrapper functions for fast-glob
|
|
13
|
+
- Provides convenient wrappers around fast-glob with normalized options
|
|
14
|
+
- Maintains consistent API with existing glob functionality
|
|
15
|
+
- Export: `@socketsecurity/lib/globs`
|
|
16
|
+
|
|
8
17
|
## [4.1.0](https://github.com/SocketDev/socket-lib/releases/tag/v4.1.0) - 2025-11-17
|
|
9
18
|
|
|
10
19
|
### Added
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://socket.dev/npm/package/@socketsecurity/lib)
|
|
4
4
|
[](https://github.com/SocketDev/socket-lib/actions/workflows/ci.yml)
|
|
5
|
-

|
|
6
6
|
|
|
7
7
|
[](https://twitter.com/SocketSecurity)
|
|
8
8
|
[](https://bsky.app/profile/socket.dev)
|
|
@@ -5723,7 +5723,11 @@ var require_out4 = __commonJS({
|
|
|
5723
5723
|
|
|
5724
5724
|
// src/external/fast-glob.js
|
|
5725
5725
|
var fastGlob = require_out4();
|
|
5726
|
-
module.exports = fastGlob.globStream ? {
|
|
5726
|
+
module.exports = fastGlob.globStream ? {
|
|
5727
|
+
glob: fastGlob,
|
|
5728
|
+
globStream: fastGlob.globStream,
|
|
5729
|
+
globSync: fastGlob.sync
|
|
5730
|
+
} : fastGlob;
|
|
5727
5731
|
/*! Bundled license information:
|
|
5728
5732
|
|
|
5729
5733
|
is-extglob/index.js:
|
package/dist/globs.d.ts
CHANGED
|
@@ -44,3 +44,15 @@ export declare function getGlobMatcher(glob: Pattern | Pattern[], options?: {
|
|
|
44
44
|
nocase?: boolean;
|
|
45
45
|
ignore?: string[];
|
|
46
46
|
}): (path: string) => boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Asynchronously find files matching glob patterns.
|
|
49
|
+
* Wrapper around fast-glob.
|
|
50
|
+
*/
|
|
51
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
52
|
+
export declare function glob(patterns: Pattern | Pattern[], options?: FastGlobOptions): Promise<string[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Synchronously find files matching glob patterns.
|
|
55
|
+
* Wrapper around fast-glob.sync.
|
|
56
|
+
*/
|
|
57
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
58
|
+
export declare function globSync(patterns: Pattern | Pattern[], options?: FastGlobOptions): string[];
|
package/dist/globs.js
CHANGED
|
@@ -31,7 +31,9 @@ var globs_exports = {};
|
|
|
31
31
|
__export(globs_exports, {
|
|
32
32
|
defaultIgnore: () => defaultIgnore,
|
|
33
33
|
getGlobMatcher: () => getGlobMatcher,
|
|
34
|
-
|
|
34
|
+
glob: () => glob,
|
|
35
|
+
globStreamLicenses: () => globStreamLicenses,
|
|
36
|
+
globSync: () => globSync
|
|
35
37
|
});
|
|
36
38
|
module.exports = __toCommonJS(globs_exports);
|
|
37
39
|
var fastGlob = __toESM(require("./external/fast-glob.js"));
|
|
@@ -107,8 +109,8 @@ function globStreamLicenses(dirname, options) {
|
|
|
107
109
|
}
|
|
108
110
|
const matcherCache = /* @__PURE__ */ new Map();
|
|
109
111
|
// @__NO_SIDE_EFFECTS__
|
|
110
|
-
function getGlobMatcher(
|
|
111
|
-
const patterns = Array.isArray(
|
|
112
|
+
function getGlobMatcher(glob2, options) {
|
|
113
|
+
const patterns = Array.isArray(glob2) ? glob2 : [glob2];
|
|
112
114
|
const key = JSON.stringify({ patterns, options });
|
|
113
115
|
let matcher = matcherCache.get(key);
|
|
114
116
|
if (matcher) {
|
|
@@ -129,9 +131,19 @@ function getGlobMatcher(glob, options) {
|
|
|
129
131
|
matcherCache.set(key, matcher);
|
|
130
132
|
return matcher;
|
|
131
133
|
}
|
|
134
|
+
// @__NO_SIDE_EFFECTS__
|
|
135
|
+
function glob(patterns, options) {
|
|
136
|
+
return fastGlob.glob(patterns, options);
|
|
137
|
+
}
|
|
138
|
+
// @__NO_SIDE_EFFECTS__
|
|
139
|
+
function globSync(patterns, options) {
|
|
140
|
+
return fastGlob.globSync(patterns, options);
|
|
141
|
+
}
|
|
132
142
|
// Annotate the CommonJS export names for ESM import in node:
|
|
133
143
|
0 && (module.exports = {
|
|
134
144
|
defaultIgnore,
|
|
135
145
|
getGlobMatcher,
|
|
136
|
-
|
|
146
|
+
glob,
|
|
147
|
+
globStreamLicenses,
|
|
148
|
+
globSync
|
|
137
149
|
});
|
|
@@ -36,6 +36,7 @@ var yarnPkgExtensions = __toESM(require("./external/@yarnpkg/extensions.js"));
|
|
|
36
36
|
const { freeze: ObjectFreeze } = Object;
|
|
37
37
|
const packageExtensions = ObjectFreeze(
|
|
38
38
|
[
|
|
39
|
+
/* c8 ignore next - External @yarnpkg/extensions data */
|
|
39
40
|
...yarnPkgExtensions.packageExtensions,
|
|
40
41
|
[
|
|
41
42
|
"@yarnpkg/extensions@>=1.1.0",
|