Skip to content

Commit 9e2ce2e

Browse files
bytemainantongolub
andauthored
feat: re-export glob.globbySync as glob.sync (google#1135)
* feat: reexport glob.sync * chore: update testcase * chore: increase * chore: increase * chore: increase * chore: update testcase * docs: tweak up `glob.sync` example * chore: update .size-limit.json --------- Co-authored-by: Anton Golub <antongolub@antongolub.com> Co-authored-by: Anton Golub <golub.anton@gmail.com>
1 parent 26e9559 commit 9e2ce2e

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

.size-limit.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
{
1717
"name": "dts libdefs",
1818
"path": "build/*.d.ts",
19-
"limit": "39.4 kB",
19+
"limit": "39.42 kB",
2020
"brotli": false,
2121
"gzip": false
2222
},
2323
{
2424
"name": "vendor",
2525
"path": "build/vendor-*",
26-
"limit": "767.1 kB",
26+
"limit": "767.12 kB",
2727
"brotli": false,
2828
"gzip": false
2929
},

docs/api.md

+1
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ The [globby](https://github.com/sindresorhus/globby) package.
268268

269269
```js
270270
const packages = await glob(['package.json', 'packages/*/package.json'])
271+
const markdowns = glob.sync('*.md') // sync API shortcut
271272
```
272273

273274
## `which()`

src/vendor-extra.ts

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export const createRequire = _createRequire as unknown as (
4141
export const globbyModule = {
4242
convertPathToPattern,
4343
globby,
44+
sync: globbySync,
4445
globbySync,
4546
globbyStream,
4647
generateGlobTasksSync,

test/vendor.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ describe('vendor API', () => {
3333

3434
test('globby() works', async () => {
3535
assert.deepEqual(await glob('*.md'), ['README.md'])
36+
assert.deepEqual(glob.sync('*.md'), ['README.md'])
3637
})
3738

3839
test('fetch() works', async () => {

0 commit comments

Comments
 (0)