/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
benchmark/path/matchesGlob-posix.js
28 строк
555 B
bq
path: add benchmarks for path.matchesGlob()
18 июл 2026, 00:34
18 июл 2026, 00:34
0a32b56
Код
Авторство
О чём код?
'use strict'; const common = require('../common.js'); const { posix } = require('path'); const assert = require('assert'); const bench = common.createBenchmark(main, { path: [ 'src/index.ts', 'src/index.test.ts', 'src/foo/bar/biz/baz/index.test.ts', ], pattern: [ 'src/**/baz/*.test.ts', 'src/**/baz/*.ts', 'test/**/*.ts', ], n: [1e5], }); function main({ path, pattern, n }) { bench.start(); let a; for (let i = 0; i < n; i++) { a = posix.matchesGlob(path, pattern); } bench.end(n); assert(a + 'a'); }