@codspeed/tinybench-plugin 1.0.1 → 1.1.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/dist/index.cjs.js CHANGED
@@ -39,7 +39,13 @@ function locatePathSync(
39
39
 
40
40
  for (const path_ of paths) {
41
41
  try {
42
- const stat = statFunction(path.resolve(cwd, path_));
42
+ const stat = statFunction(path.resolve(cwd, path_), {
43
+ throwIfNoEntry: false,
44
+ });
45
+
46
+ if (!stat) {
47
+ continue;
48
+ }
43
49
 
44
50
  if (matchType(type, stat)) {
45
51
  return path_;
@@ -172,7 +178,7 @@ function withCodSpeed(bench) {
172
178
  core.initCore();
173
179
  const callingFile = getCallingFile();
174
180
  bench.run = async () => {
175
- console.log(`[CodSpeed] running with @codspeed/tinybench v${"1.0.1"}`);
181
+ console.log(`[CodSpeed] running with @codspeed/tinybench v${"1.1.0"}`);
176
182
  for (const task of bench.tasks) {
177
183
  const uri = callingFile + "::" + task.name;
178
184
  await core.optimizeFunction(task.fn);
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../../../node_modules/.pnpm/locate-path@7.1.1/node_modules/locate-path/index.js","../../../node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.js","../../../node_modules/.pnpm/stack-trace@1.0.0-pre1/node_modules/stack-trace/index.js","../src/index.ts"],"sourcesContent":["import process from 'node:process';\nimport path from 'node:path';\nimport fs, {promises as fsPromises} from 'node:fs';\nimport {fileURLToPath} from 'node:url';\nimport pLocate from 'p-locate';\n\nconst typeMappings = {\n\tdirectory: 'isDirectory',\n\tfile: 'isFile',\n};\n\nfunction checkType(type) {\n\tif (Object.hasOwnProperty.call(typeMappings, type)) {\n\t\treturn;\n\t}\n\n\tthrow new Error(`Invalid type specified: ${type}`);\n}\n\nconst matchType = (type, stat) => stat[typeMappings[type]]();\n\nconst toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n\nexport async function locatePath(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t\tconcurrency,\n\t\tpreserveOrder,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fsPromises.stat : fsPromises.lstat;\n\n\treturn pLocate(paths, async path_ => {\n\t\ttry {\n\t\t\tconst stat = await statFunction(path.resolve(cwd, path_));\n\t\t\treturn matchType(type, stat);\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}, {concurrency, preserveOrder});\n}\n\nexport function locatePathSync(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fs.statSync : fs.lstatSync;\n\n\tfor (const path_ of paths) {\n\t\ttry {\n\t\t\tconst stat = statFunction(path.resolve(cwd, path_));\n\n\t\t\tif (matchType(type, stat)) {\n\t\t\t\treturn path_;\n\t\t\t}\n\t\t} catch {}\n\t}\n}\n","import path from 'node:path';\nimport {fileURLToPath} from 'node:url';\nimport {locatePath, locatePathSync} from 'locate-path';\n\nconst toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n\nexport const findUpStop = Symbol('findUpStop');\n\nexport async function findUpMultiple(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) || '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, options.stopAt || root);\n\tconst limit = options.limit || Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = async locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePath(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = await name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePath([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tconst foundPath = await runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport function findUpMultipleSync(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) || '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = options.stopAt || root;\n\tconst limit = options.limit || Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePathSync(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePathSync([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\tconst foundPath = runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport async function findUp(name, options = {}) {\n\tconst matches = await findUpMultiple(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport function findUpSync(name, options = {}) {\n\tconst matches = findUpMultipleSync(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport {\n\tpathExists,\n\tpathExistsSync,\n} from 'path-exists';\n","export function get(belowFn) {\r\n const oldLimit = Error.stackTraceLimit;\r\n Error.stackTraceLimit = Infinity;\r\n\r\n const dummyObject = {};\r\n\r\n const v8Handler = Error.prepareStackTrace;\r\n Error.prepareStackTrace = function(dummyObject, v8StackTrace) {\r\n return v8StackTrace;\r\n };\r\n Error.captureStackTrace(dummyObject, belowFn || get);\r\n\r\n const v8StackTrace = dummyObject.stack;\r\n Error.prepareStackTrace = v8Handler;\r\n Error.stackTraceLimit = oldLimit;\r\n\r\n return v8StackTrace;\r\n}\r\n\r\nexport function parse(err) {\r\n if (!err.stack) {\r\n return [];\r\n }\r\n\r\n const lines = err.stack.split('\\n').slice(1);\r\n return lines\r\n .map(function(line) {\r\n if (line.match(/^\\s*[-]{4,}$/)) {\r\n return createParsedCallSite({\r\n fileName: line,\r\n lineNumber: null,\r\n functionName: null,\r\n typeName: null,\r\n methodName: null,\r\n columnNumber: null,\r\n 'native': null,\r\n });\r\n }\r\n\r\n const lineMatch = line.match(/at (?:(.+?)\\s+\\()?(?:(.+?):(\\d+)(?::(\\d+))?|([^)]+))\\)?/);\r\n if (!lineMatch) {\r\n return;\r\n }\r\n\r\n let object = null;\r\n let method = null;\r\n let functionName = null;\r\n let typeName = null;\r\n let methodName = null;\r\n let isNative = (lineMatch[5] === 'native');\r\n\r\n if (lineMatch[1]) {\r\n functionName = lineMatch[1];\r\n let methodStart = functionName.lastIndexOf('.');\r\n if (functionName[methodStart-1] == '.')\r\n methodStart--;\r\n if (methodStart > 0) {\r\n object = functionName.substr(0, methodStart);\r\n method = functionName.substr(methodStart + 1);\r\n const objectEnd = object.indexOf('.Module');\r\n if (objectEnd > 0) {\r\n functionName = functionName.substr(objectEnd + 1);\r\n object = object.substr(0, objectEnd);\r\n }\r\n }\r\n }\r\n\r\n if (method) {\r\n typeName = object;\r\n methodName = method;\r\n }\r\n\r\n if (method === '<anonymous>') {\r\n methodName = null;\r\n functionName = null;\r\n }\r\n\r\n const properties = {\r\n fileName: lineMatch[2] || null,\r\n lineNumber: parseInt(lineMatch[3], 10) || null,\r\n functionName: functionName,\r\n typeName: typeName,\r\n methodName: methodName,\r\n columnNumber: parseInt(lineMatch[4], 10) || null,\r\n 'native': isNative,\r\n };\r\n\r\n return createParsedCallSite(properties);\r\n })\r\n .filter(function(callSite) {\r\n return !!callSite;\r\n });\r\n}\r\n\r\nfunction CallSite(properties) {\r\n for (const property in properties) {\r\n this[property] = properties[property];\r\n }\r\n}\r\n\r\nconst strProperties = [\r\n 'this',\r\n 'typeName',\r\n 'functionName',\r\n 'methodName',\r\n 'fileName',\r\n 'lineNumber',\r\n 'columnNumber',\r\n 'function',\r\n 'evalOrigin'\r\n];\r\n\r\nconst boolProperties = [\r\n 'topLevel',\r\n 'eval',\r\n 'native',\r\n 'constructor'\r\n];\r\n\r\nstrProperties.forEach(function (property) {\r\n CallSite.prototype[property] = null;\r\n CallSite.prototype['get' + property[0].toUpperCase() + property.substr(1)] = function () {\r\n return this[property];\r\n }\r\n});\r\n\r\nboolProperties.forEach(function (property) {\r\n CallSite.prototype[property] = false;\r\n CallSite.prototype['is' + property[0].toUpperCase() + property.substr(1)] = function () {\r\n return this[property];\r\n }\r\n});\r\n\r\nfunction createParsedCallSite(properties) {\r\n return new CallSite(properties);\r\n}\r\n","import { initCore, measurement, optimizeFunction } from \"@codspeed/core\";\nimport { findUpSync, Options } from \"find-up\";\nimport path, { dirname } from \"path\";\nimport { get as getStackTrace } from \"stack-trace\";\nimport { Bench } from \"tinybench\";\n\ndeclare const __VERSION__: string;\n\nexport function withCodSpeed(bench: Bench): Bench {\n if (!measurement.isInstrumented()) {\n const rawRun = bench.run;\n bench.run = async () => {\n console.warn(\n `[CodSpeed] ${bench.tasks.length} benches detected but no instrumentation found, falling back to tinybench`\n );\n return await rawRun.bind(bench)();\n };\n return bench;\n }\n initCore();\n const callingFile = getCallingFile();\n bench.run = async () => {\n console.log(`[CodSpeed] running with @codspeed/tinybench v${__VERSION__}`);\n for (const task of bench.tasks) {\n const uri = callingFile + \"::\" + task.name;\n await optimizeFunction(task.fn);\n measurement.startInstrumentation();\n await task.fn();\n measurement.stopInstrumentation(uri);\n console.log(` ✔ Measured ${uri}`);\n }\n console.log(`[CodSpeed] Done running ${bench.tasks.length} benches.`);\n return bench.tasks;\n };\n return bench;\n}\n\nfunction getCallingFile(): string {\n const stack = getStackTrace();\n const callingFile = stack[2].getFileName(); // [here, withCodSpeed, actual caller]\n const gitDir = getGitDir(callingFile);\n if (gitDir === undefined) {\n throw new Error(\"Could not find a git repository\");\n }\n return path.relative(gitDir, callingFile);\n}\n\nfunction getGitDir(path: string): string | undefined {\n const dotGitPath = findUpSync(\".git\", {\n cwd: path,\n type: \"directory\",\n } as Options);\n return dotGitPath ? dirname(dotGitPath) : undefined;\n}\n"],"names":["toPath","fileURLToPath","measurement","initCore","optimizeFunction","getStackTrace","path","dirname"],"mappings":";;;;;;;;;AAMA,MAAM,YAAY,GAAG;AACrB,CAAC,SAAS,EAAE,aAAa;AACzB,CAAC,IAAI,EAAE,QAAQ;AACf,CAAC,CAAC;AACF;AACA,SAAS,SAAS,CAAC,IAAI,EAAE;AACzB,CAAC,IAAI,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,EAAE;AACrD,EAAE,OAAO;AACT,EAAE;AACF;AACA,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC,wBAAwB,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AACD;AACA,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;AAC7D;AACA,MAAMA,QAAM,GAAG,SAAS,IAAI,SAAS,YAAY,GAAG,GAAGC,sBAAa,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;AA0B5F;AACO,SAAS,cAAc;AAC9B,CAAC,KAAK;AACN,CAAC;AACD,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE;AACrB,E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WAAW,MAAQ,EAAA;AAAA,IACpC,GAAKA,EAAAA,KAAAA;AAAA,IACL,IAAM,EAAA,WAAA;AAAA,GACI,CAAA,CAAA;AACZ,EAAO,OAAA,UAAA,GAAaC,cAAQ,CAAA,UAAU,CAAI,GAAA,KAAA,CAAA,CAAA;AAC5C;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js","../../../node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.js","../../../node_modules/.pnpm/stack-trace@1.0.0-pre1/node_modules/stack-trace/index.js","../src/index.ts"],"sourcesContent":["import process from 'node:process';\nimport path from 'node:path';\nimport fs, {promises as fsPromises} from 'node:fs';\nimport {fileURLToPath} from 'node:url';\nimport pLocate from 'p-locate';\n\nconst typeMappings = {\n\tdirectory: 'isDirectory',\n\tfile: 'isFile',\n};\n\nfunction checkType(type) {\n\tif (Object.hasOwnProperty.call(typeMappings, type)) {\n\t\treturn;\n\t}\n\n\tthrow new Error(`Invalid type specified: ${type}`);\n}\n\nconst matchType = (type, stat) => stat[typeMappings[type]]();\n\nconst toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n\nexport async function locatePath(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t\tconcurrency,\n\t\tpreserveOrder,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fsPromises.stat : fsPromises.lstat;\n\n\treturn pLocate(paths, async path_ => {\n\t\ttry {\n\t\t\tconst stat = await statFunction(path.resolve(cwd, path_));\n\t\t\treturn matchType(type, stat);\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}, {concurrency, preserveOrder});\n}\n\nexport function locatePathSync(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fs.statSync : fs.lstatSync;\n\n\tfor (const path_ of paths) {\n\t\ttry {\n\t\t\tconst stat = statFunction(path.resolve(cwd, path_), {\n\t\t\t\tthrowIfNoEntry: false,\n\t\t\t});\n\n\t\t\tif (!stat) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (matchType(type, stat)) {\n\t\t\t\treturn path_;\n\t\t\t}\n\t\t} catch {}\n\t}\n}\n","import path from 'node:path';\nimport {fileURLToPath} from 'node:url';\nimport {locatePath, locatePathSync} from 'locate-path';\n\nconst toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n\nexport const findUpStop = Symbol('findUpStop');\n\nexport async function findUpMultiple(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) || '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, options.stopAt || root);\n\tconst limit = options.limit || Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = async locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePath(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = await name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePath([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tconst foundPath = await runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport function findUpMultipleSync(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) || '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = options.stopAt || root;\n\tconst limit = options.limit || Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePathSync(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePathSync([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\tconst foundPath = runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport async function findUp(name, options = {}) {\n\tconst matches = await findUpMultiple(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport function findUpSync(name, options = {}) {\n\tconst matches = findUpMultipleSync(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport {\n\tpathExists,\n\tpathExistsSync,\n} from 'path-exists';\n","export function get(belowFn) {\r\n const oldLimit = Error.stackTraceLimit;\r\n Error.stackTraceLimit = Infinity;\r\n\r\n const dummyObject = {};\r\n\r\n const v8Handler = Error.prepareStackTrace;\r\n Error.prepareStackTrace = function(dummyObject, v8StackTrace) {\r\n return v8StackTrace;\r\n };\r\n Error.captureStackTrace(dummyObject, belowFn || get);\r\n\r\n const v8StackTrace = dummyObject.stack;\r\n Error.prepareStackTrace = v8Handler;\r\n Error.stackTraceLimit = oldLimit;\r\n\r\n return v8StackTrace;\r\n}\r\n\r\nexport function parse(err) {\r\n if (!err.stack) {\r\n return [];\r\n }\r\n\r\n const lines = err.stack.split('\\n').slice(1);\r\n return lines\r\n .map(function(line) {\r\n if (line.match(/^\\s*[-]{4,}$/)) {\r\n return createParsedCallSite({\r\n fileName: line,\r\n lineNumber: null,\r\n functionName: null,\r\n typeName: null,\r\n methodName: null,\r\n columnNumber: null,\r\n 'native': null,\r\n });\r\n }\r\n\r\n const lineMatch = line.match(/at (?:(.+?)\\s+\\()?(?:(.+?):(\\d+)(?::(\\d+))?|([^)]+))\\)?/);\r\n if (!lineMatch) {\r\n return;\r\n }\r\n\r\n let object = null;\r\n let method = null;\r\n let functionName = null;\r\n let typeName = null;\r\n let methodName = null;\r\n let isNative = (lineMatch[5] === 'native');\r\n\r\n if (lineMatch[1]) {\r\n functionName = lineMatch[1];\r\n let methodStart = functionName.lastIndexOf('.');\r\n if (functionName[methodStart-1] == '.')\r\n methodStart--;\r\n if (methodStart > 0) {\r\n object = functionName.substr(0, methodStart);\r\n method = functionName.substr(methodStart + 1);\r\n const objectEnd = object.indexOf('.Module');\r\n if (objectEnd > 0) {\r\n functionName = functionName.substr(objectEnd + 1);\r\n object = object.substr(0, objectEnd);\r\n }\r\n }\r\n }\r\n\r\n if (method) {\r\n typeName = object;\r\n methodName = method;\r\n }\r\n\r\n if (method === '<anonymous>') {\r\n methodName = null;\r\n functionName = null;\r\n }\r\n\r\n const properties = {\r\n fileName: lineMatch[2] || null,\r\n lineNumber: parseInt(lineMatch[3], 10) || null,\r\n functionName: functionName,\r\n typeName: typeName,\r\n methodName: methodName,\r\n columnNumber: parseInt(lineMatch[4], 10) || null,\r\n 'native': isNative,\r\n };\r\n\r\n return createParsedCallSite(properties);\r\n })\r\n .filter(function(callSite) {\r\n return !!callSite;\r\n });\r\n}\r\n\r\nfunction CallSite(properties) {\r\n for (const property in properties) {\r\n this[property] = properties[property];\r\n }\r\n}\r\n\r\nconst strProperties = [\r\n 'this',\r\n 'typeName',\r\n 'functionName',\r\n 'methodName',\r\n 'fileName',\r\n 'lineNumber',\r\n 'columnNumber',\r\n 'function',\r\n 'evalOrigin'\r\n];\r\n\r\nconst boolProperties = [\r\n 'topLevel',\r\n 'eval',\r\n 'native',\r\n 'constructor'\r\n];\r\n\r\nstrProperties.forEach(function (property) {\r\n CallSite.prototype[property] = null;\r\n CallSite.prototype['get' + property[0].toUpperCase() + property.substr(1)] = function () {\r\n return this[property];\r\n }\r\n});\r\n\r\nboolProperties.forEach(function (property) {\r\n CallSite.prototype[property] = false;\r\n CallSite.prototype['is' + property[0].toUpperCase() + property.substr(1)] = function () {\r\n return this[property];\r\n }\r\n});\r\n\r\nfunction createParsedCallSite(properties) {\r\n return new CallSite(properties);\r\n}\r\n","import { initCore, measurement, optimizeFunction } from \"@codspeed/core\";\nimport { findUpSync, Options } from \"find-up\";\nimport path, { dirname } from \"path\";\nimport { get as getStackTrace } from \"stack-trace\";\nimport { Bench } from \"tinybench\";\n\ndeclare const __VERSION__: string;\n\nexport function withCodSpeed(bench: Bench): Bench {\n if (!measurement.isInstrumented()) {\n const rawRun = bench.run;\n bench.run = async () => {\n console.warn(\n `[CodSpeed] ${bench.tasks.length} benches detected but no instrumentation found, falling back to tinybench`\n );\n return await rawRun.bind(bench)();\n };\n return bench;\n }\n initCore();\n const callingFile = getCallingFile();\n bench.run = async () => {\n console.log(`[CodSpeed] running with @codspeed/tinybench v${__VERSION__}`);\n for (const task of bench.tasks) {\n const uri = callingFile + \"::\" + task.name;\n await optimizeFunction(task.fn);\n measurement.startInstrumentation();\n await task.fn();\n measurement.stopInstrumentation(uri);\n console.log(` ✔ Measured ${uri}`);\n }\n console.log(`[CodSpeed] Done running ${bench.tasks.length} benches.`);\n return bench.tasks;\n };\n return bench;\n}\n\nfunction getCallingFile(): string {\n const stack = getStackTrace();\n const callingFile = stack[2].getFileName(); // [here, withCodSpeed, actual caller]\n const gitDir = getGitDir(callingFile);\n if (gitDir === undefined) {\n throw new Error(\"Could not find a git repository\");\n }\n return path.relative(gitDir, callingFile);\n}\n\nfunction getGitDir(path: string): string | undefined {\n const dotGitPath = findUpSync(\".git\", {\n cwd: path,\n type: \"directory\",\n } as Options);\n return dotGitPath ? dirname(dotGitPath) : undefined;\n}\n"],"names":["toPath","fileURLToPath","measurement","initCore","optimizeFunction","getStackTrace","path","dirname"],"mappings":";;;;;;;;;AAMA,MAAM,YAAY,GAAG;AACrB,CAAC,SAAS,EAAE,aAAa;AACzB,CAAC,IAAI,EAAE,QAAQ;AACf,CAAC,CAAC;AACF;AACA,SAAS,SAAS,CAAC,IAAI,EAAE;AACzB,CAAC,IAAI,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,EAAE;AACrD,EAAE,OAAO;AACT,EAAE;AACF;AACA,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC,wBAAwB,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AACD;AACA,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;AAC7D;AACA,MAAMA,QAAM,GAAG,SAAS,IAAI,SAAS,YAAY,GAAG,GAAGC,sBAAa,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;AA0B5F;AACO,SAAS,cAAc;AAC9B,CAAC,KAAK;AACN,CAAC;AACD,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE;AACrB,EAAE,IAAI,GAAG,MAAM;AACf,EAAE,aAAa,GAAG,IAAI;AACtB,EAAE,GAAG,EAAE;AACP,EAAE;AACF,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AACjB,CAAC,GAAG,GAAGD,QAAM,CAAC,GAAG,CAAC,CAAC;AACnB;AACA,CAAC,MAAM,YAAY,GAAG,aAAa,GAAG,EAAE,CAAC,QAAQ,GAAG,EAAE,CAAC,SAAS,CAAC;AACjE;AACA,CAAC,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE;AAC5B,EAAE,IAAI;AACN,GAAG,MAAM,IA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13 @@ function locatePathSync(
37
37
 
38
38
  for (const path_ of paths) {
39
39
  try {
40
- const stat = statFunction(path.resolve(cwd, path_));
40
+ const stat = statFunction(path.resolve(cwd, path_), {
41
+ throwIfNoEntry: false,
42
+ });
43
+
44
+ if (!stat) {
45
+ continue;
46
+ }
41
47
 
42
48
  if (matchType(type, stat)) {
43
49
  return path_;
@@ -170,7 +176,7 @@ function withCodSpeed(bench) {
170
176
  initCore();
171
177
  const callingFile = getCallingFile();
172
178
  bench.run = async () => {
173
- console.log(`[CodSpeed] running with @codspeed/tinybench v${"1.0.1"}`);
179
+ console.log(`[CodSpeed] running with @codspeed/tinybench v${"1.1.0"}`);
174
180
  for (const task of bench.tasks) {
175
181
  const uri = callingFile + "::" + task.name;
176
182
  await optimizeFunction(task.fn);
@@ -1 +1 @@
1
- {"version":3,"file":"index.es5.js","sources":["../../../node_modules/.pnpm/locate-path@7.1.1/node_modules/locate-path/index.js","../../../node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.js","../../../node_modules/.pnpm/stack-trace@1.0.0-pre1/node_modules/stack-trace/index.js","../src/index.ts"],"sourcesContent":["import process from 'node:process';\nimport path from 'node:path';\nimport fs, {promises as fsPromises} from 'node:fs';\nimport {fileURLToPath} from 'node:url';\nimport pLocate from 'p-locate';\n\nconst typeMappings = {\n\tdirectory: 'isDirectory',\n\tfile: 'isFile',\n};\n\nfunction checkType(type) {\n\tif (Object.hasOwnProperty.call(typeMappings, type)) {\n\t\treturn;\n\t}\n\n\tthrow new Error(`Invalid type specified: ${type}`);\n}\n\nconst matchType = (type, stat) => stat[typeMappings[type]]();\n\nconst toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n\nexport async function locatePath(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t\tconcurrency,\n\t\tpreserveOrder,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fsPromises.stat : fsPromises.lstat;\n\n\treturn pLocate(paths, async path_ => {\n\t\ttry {\n\t\t\tconst stat = await statFunction(path.resolve(cwd, path_));\n\t\t\treturn matchType(type, stat);\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}, {concurrency, preserveOrder});\n}\n\nexport function locatePathSync(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fs.statSync : fs.lstatSync;\n\n\tfor (const path_ of paths) {\n\t\ttry {\n\t\t\tconst stat = statFunction(path.resolve(cwd, path_));\n\n\t\t\tif (matchType(type, stat)) {\n\t\t\t\treturn path_;\n\t\t\t}\n\t\t} catch {}\n\t}\n}\n","import path from 'node:path';\nimport {fileURLToPath} from 'node:url';\nimport {locatePath, locatePathSync} from 'locate-path';\n\nconst toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n\nexport const findUpStop = Symbol('findUpStop');\n\nexport async function findUpMultiple(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) || '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, options.stopAt || root);\n\tconst limit = options.limit || Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = async locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePath(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = await name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePath([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tconst foundPath = await runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport function findUpMultipleSync(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) || '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = options.stopAt || root;\n\tconst limit = options.limit || Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePathSync(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePathSync([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\tconst foundPath = runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport async function findUp(name, options = {}) {\n\tconst matches = await findUpMultiple(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport function findUpSync(name, options = {}) {\n\tconst matches = findUpMultipleSync(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport {\n\tpathExists,\n\tpathExistsSync,\n} from 'path-exists';\n","export function get(belowFn) {\r\n const oldLimit = Error.stackTraceLimit;\r\n Error.stackTraceLimit = Infinity;\r\n\r\n const dummyObject = {};\r\n\r\n const v8Handler = Error.prepareStackTrace;\r\n Error.prepareStackTrace = function(dummyObject, v8StackTrace) {\r\n return v8StackTrace;\r\n };\r\n Error.captureStackTrace(dummyObject, belowFn || get);\r\n\r\n const v8StackTrace = dummyObject.stack;\r\n Error.prepareStackTrace = v8Handler;\r\n Error.stackTraceLimit = oldLimit;\r\n\r\n return v8StackTrace;\r\n}\r\n\r\nexport function parse(err) {\r\n if (!err.stack) {\r\n return [];\r\n }\r\n\r\n const lines = err.stack.split('\\n').slice(1);\r\n return lines\r\n .map(function(line) {\r\n if (line.match(/^\\s*[-]{4,}$/)) {\r\n return createParsedCallSite({\r\n fileName: line,\r\n lineNumber: null,\r\n functionName: null,\r\n typeName: null,\r\n methodName: null,\r\n columnNumber: null,\r\n 'native': null,\r\n });\r\n }\r\n\r\n const lineMatch = line.match(/at (?:(.+?)\\s+\\()?(?:(.+?):(\\d+)(?::(\\d+))?|([^)]+))\\)?/);\r\n if (!lineMatch) {\r\n return;\r\n }\r\n\r\n let object = null;\r\n let method = null;\r\n let functionName = null;\r\n let typeName = null;\r\n let methodName = null;\r\n let isNative = (lineMatch[5] === 'native');\r\n\r\n if (lineMatch[1]) {\r\n functionName = lineMatch[1];\r\n let methodStart = functionName.lastIndexOf('.');\r\n if (functionName[methodStart-1] == '.')\r\n methodStart--;\r\n if (methodStart > 0) {\r\n object = functionName.substr(0, methodStart);\r\n method = functionName.substr(methodStart + 1);\r\n const objectEnd = object.indexOf('.Module');\r\n if (objectEnd > 0) {\r\n functionName = functionName.substr(objectEnd + 1);\r\n object = object.substr(0, objectEnd);\r\n }\r\n }\r\n }\r\n\r\n if (method) {\r\n typeName = object;\r\n methodName = method;\r\n }\r\n\r\n if (method === '<anonymous>') {\r\n methodName = null;\r\n functionName = null;\r\n }\r\n\r\n const properties = {\r\n fileName: lineMatch[2] || null,\r\n lineNumber: parseInt(lineMatch[3], 10) || null,\r\n functionName: functionName,\r\n typeName: typeName,\r\n methodName: methodName,\r\n columnNumber: parseInt(lineMatch[4], 10) || null,\r\n 'native': isNative,\r\n };\r\n\r\n return createParsedCallSite(properties);\r\n })\r\n .filter(function(callSite) {\r\n return !!callSite;\r\n });\r\n}\r\n\r\nfunction CallSite(properties) {\r\n for (const property in properties) {\r\n this[property] = properties[property];\r\n }\r\n}\r\n\r\nconst strProperties = [\r\n 'this',\r\n 'typeName',\r\n 'functionName',\r\n 'methodName',\r\n 'fileName',\r\n 'lineNumber',\r\n 'columnNumber',\r\n 'function',\r\n 'evalOrigin'\r\n];\r\n\r\nconst boolProperties = [\r\n 'topLevel',\r\n 'eval',\r\n 'native',\r\n 'constructor'\r\n];\r\n\r\nstrProperties.forEach(function (property) {\r\n CallSite.prototype[property] = null;\r\n CallSite.prototype['get' + property[0].toUpperCase() + property.substr(1)] = function () {\r\n return this[property];\r\n }\r\n});\r\n\r\nboolProperties.forEach(function (property) {\r\n CallSite.prototype[property] = false;\r\n CallSite.prototype['is' + property[0].toUpperCase() + property.substr(1)] = function () {\r\n return this[property];\r\n }\r\n});\r\n\r\nfunction createParsedCallSite(properties) {\r\n return new CallSite(properties);\r\n}\r\n","import { initCore, measurement, optimizeFunction } from \"@codspeed/core\";\nimport { findUpSync, Options } from \"find-up\";\nimport path, { dirname } from \"path\";\nimport { get as getStackTrace } from \"stack-trace\";\nimport { Bench } from \"tinybench\";\n\ndeclare const __VERSION__: string;\n\nexport function withCodSpeed(bench: Bench): Bench {\n if (!measurement.isInstrumented()) {\n const rawRun = bench.run;\n bench.run = async () => {\n console.warn(\n `[CodSpeed] ${bench.tasks.length} benches detected but no instrumentation found, falling back to tinybench`\n );\n return await rawRun.bind(bench)();\n };\n return bench;\n }\n initCore();\n const callingFile = getCallingFile();\n bench.run = async () => {\n console.log(`[CodSpeed] running with @codspeed/tinybench v${__VERSION__}`);\n for (const task of bench.tasks) {\n const uri = callingFile + \"::\" + task.name;\n await optimizeFunction(task.fn);\n measurement.startInstrumentation();\n await task.fn();\n measurement.stopInstrumentation(uri);\n console.log(` ✔ Measured ${uri}`);\n }\n console.log(`[CodSpeed] Done running ${bench.tasks.length} benches.`);\n return bench.tasks;\n };\n return bench;\n}\n\nfunction getCallingFile(): string {\n const stack = getStackTrace();\n const callingFile = stack[2].getFileName(); // [here, withCodSpeed, actual caller]\n const gitDir = getGitDir(callingFile);\n if (gitDir === undefined) {\n throw new Error(\"Could not find a git repository\");\n }\n return path.relative(gitDir, callingFile);\n}\n\nfunction getGitDir(path: string): string | undefined {\n const dotGitPath = findUpSync(\".git\", {\n cwd: path,\n type: \"directory\",\n } as Options);\n return dotGitPath ? dirname(dotGitPath) : undefined;\n}\n"],"names":["toPath","getStackTrace","path"],"mappings":";;;;;;;AAMA,MAAM,YAAY,GAAG;AACrB,CAAC,SAAS,EAAE,aAAa;AACzB,CAAC,IAAI,EAAE,QAAQ;AACf,CAAC,CAAC;AACF;AACA,SAAS,SAAS,CAAC,IAAI,EAAE;AACzB,CAAC,IAAI,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,EAAE;AACrD,EAAE,OAAO;AACT,EAAE;AACF;AACA,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC,wBAAwB,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AACD;AACA,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;AAC7D;AACA,MAAMA,QAAM,GAAG,SAAS,IAAI,SAAS,YAAY,GAAG,GAAG,aAAa,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;AA0B5F;AACO,SAAS,cAAc;AAC9B,CAAC,KAAK;AACN,CAAC;AACD,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE;AACrB,EAAE,IAAI,GAAG,MAAM;AACf,EAAE,aAAa,GAAG,IAAI;AACtB,EAAE,GAAG,EAAE;AACP,EAAE;AACF,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AACjB,CAAC,GAAG,GAAGA,QAAM,CAAC,GAAG,CAAC,CAAC;AACnB;AACA,CAA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":3,"file":"index.es5.js","sources":["../../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js","../../../node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.js","../../../node_modules/.pnpm/stack-trace@1.0.0-pre1/node_modules/stack-trace/index.js","../src/index.ts"],"sourcesContent":["import process from 'node:process';\nimport path from 'node:path';\nimport fs, {promises as fsPromises} from 'node:fs';\nimport {fileURLToPath} from 'node:url';\nimport pLocate from 'p-locate';\n\nconst typeMappings = {\n\tdirectory: 'isDirectory',\n\tfile: 'isFile',\n};\n\nfunction checkType(type) {\n\tif (Object.hasOwnProperty.call(typeMappings, type)) {\n\t\treturn;\n\t}\n\n\tthrow new Error(`Invalid type specified: ${type}`);\n}\n\nconst matchType = (type, stat) => stat[typeMappings[type]]();\n\nconst toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n\nexport async function locatePath(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t\tconcurrency,\n\t\tpreserveOrder,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fsPromises.stat : fsPromises.lstat;\n\n\treturn pLocate(paths, async path_ => {\n\t\ttry {\n\t\t\tconst stat = await statFunction(path.resolve(cwd, path_));\n\t\t\treturn matchType(type, stat);\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}, {concurrency, preserveOrder});\n}\n\nexport function locatePathSync(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fs.statSync : fs.lstatSync;\n\n\tfor (const path_ of paths) {\n\t\ttry {\n\t\t\tconst stat = statFunction(path.resolve(cwd, path_), {\n\t\t\t\tthrowIfNoEntry: false,\n\t\t\t});\n\n\t\t\tif (!stat) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (matchType(type, stat)) {\n\t\t\t\treturn path_;\n\t\t\t}\n\t\t} catch {}\n\t}\n}\n","import path from 'node:path';\nimport {fileURLToPath} from 'node:url';\nimport {locatePath, locatePathSync} from 'locate-path';\n\nconst toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n\nexport const findUpStop = Symbol('findUpStop');\n\nexport async function findUpMultiple(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) || '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, options.stopAt || root);\n\tconst limit = options.limit || Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = async locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePath(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = await name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePath([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tconst foundPath = await runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport function findUpMultipleSync(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) || '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = options.stopAt || root;\n\tconst limit = options.limit || Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePathSync(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePathSync([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\tconst foundPath = runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport async function findUp(name, options = {}) {\n\tconst matches = await findUpMultiple(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport function findUpSync(name, options = {}) {\n\tconst matches = findUpMultipleSync(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport {\n\tpathExists,\n\tpathExistsSync,\n} from 'path-exists';\n","export function get(belowFn) {\r\n const oldLimit = Error.stackTraceLimit;\r\n Error.stackTraceLimit = Infinity;\r\n\r\n const dummyObject = {};\r\n\r\n const v8Handler = Error.prepareStackTrace;\r\n Error.prepareStackTrace = function(dummyObject, v8StackTrace) {\r\n return v8StackTrace;\r\n };\r\n Error.captureStackTrace(dummyObject, belowFn || get);\r\n\r\n const v8StackTrace = dummyObject.stack;\r\n Error.prepareStackTrace = v8Handler;\r\n Error.stackTraceLimit = oldLimit;\r\n\r\n return v8StackTrace;\r\n}\r\n\r\nexport function parse(err) {\r\n if (!err.stack) {\r\n return [];\r\n }\r\n\r\n const lines = err.stack.split('\\n').slice(1);\r\n return lines\r\n .map(function(line) {\r\n if (line.match(/^\\s*[-]{4,}$/)) {\r\n return createParsedCallSite({\r\n fileName: line,\r\n lineNumber: null,\r\n functionName: null,\r\n typeName: null,\r\n methodName: null,\r\n columnNumber: null,\r\n 'native': null,\r\n });\r\n }\r\n\r\n const lineMatch = line.match(/at (?:(.+?)\\s+\\()?(?:(.+?):(\\d+)(?::(\\d+))?|([^)]+))\\)?/);\r\n if (!lineMatch) {\r\n return;\r\n }\r\n\r\n let object = null;\r\n let method = null;\r\n let functionName = null;\r\n let typeName = null;\r\n let methodName = null;\r\n let isNative = (lineMatch[5] === 'native');\r\n\r\n if (lineMatch[1]) {\r\n functionName = lineMatch[1];\r\n let methodStart = functionName.lastIndexOf('.');\r\n if (functionName[methodStart-1] == '.')\r\n methodStart--;\r\n if (methodStart > 0) {\r\n object = functionName.substr(0, methodStart);\r\n method = functionName.substr(methodStart + 1);\r\n const objectEnd = object.indexOf('.Module');\r\n if (objectEnd > 0) {\r\n functionName = functionName.substr(objectEnd + 1);\r\n object = object.substr(0, objectEnd);\r\n }\r\n }\r\n }\r\n\r\n if (method) {\r\n typeName = object;\r\n methodName = method;\r\n }\r\n\r\n if (method === '<anonymous>') {\r\n methodName = null;\r\n functionName = null;\r\n }\r\n\r\n const properties = {\r\n fileName: lineMatch[2] || null,\r\n lineNumber: parseInt(lineMatch[3], 10) || null,\r\n functionName: functionName,\r\n typeName: typeName,\r\n methodName: methodName,\r\n columnNumber: parseInt(lineMatch[4], 10) || null,\r\n 'native': isNative,\r\n };\r\n\r\n return createParsedCallSite(properties);\r\n })\r\n .filter(function(callSite) {\r\n return !!callSite;\r\n });\r\n}\r\n\r\nfunction CallSite(properties) {\r\n for (const property in properties) {\r\n this[property] = properties[property];\r\n }\r\n}\r\n\r\nconst strProperties = [\r\n 'this',\r\n 'typeName',\r\n 'functionName',\r\n 'methodName',\r\n 'fileName',\r\n 'lineNumber',\r\n 'columnNumber',\r\n 'function',\r\n 'evalOrigin'\r\n];\r\n\r\nconst boolProperties = [\r\n 'topLevel',\r\n 'eval',\r\n 'native',\r\n 'constructor'\r\n];\r\n\r\nstrProperties.forEach(function (property) {\r\n CallSite.prototype[property] = null;\r\n CallSite.prototype['get' + property[0].toUpperCase() + property.substr(1)] = function () {\r\n return this[property];\r\n }\r\n});\r\n\r\nboolProperties.forEach(function (property) {\r\n CallSite.prototype[property] = false;\r\n CallSite.prototype['is' + property[0].toUpperCase() + property.substr(1)] = function () {\r\n return this[property];\r\n }\r\n});\r\n\r\nfunction createParsedCallSite(properties) {\r\n return new CallSite(properties);\r\n}\r\n","import { initCore, measurement, optimizeFunction } from \"@codspeed/core\";\nimport { findUpSync, Options } from \"find-up\";\nimport path, { dirname } from \"path\";\nimport { get as getStackTrace } from \"stack-trace\";\nimport { Bench } from \"tinybench\";\n\ndeclare const __VERSION__: string;\n\nexport function withCodSpeed(bench: Bench): Bench {\n if (!measurement.isInstrumented()) {\n const rawRun = bench.run;\n bench.run = async () => {\n console.warn(\n `[CodSpeed] ${bench.tasks.length} benches detected but no instrumentation found, falling back to tinybench`\n );\n return await rawRun.bind(bench)();\n };\n return bench;\n }\n initCore();\n const callingFile = getCallingFile();\n bench.run = async () => {\n console.log(`[CodSpeed] running with @codspeed/tinybench v${__VERSION__}`);\n for (const task of bench.tasks) {\n const uri = callingFile + \"::\" + task.name;\n await optimizeFunction(task.fn);\n measurement.startInstrumentation();\n await task.fn();\n measurement.stopInstrumentation(uri);\n console.log(` ✔ Measured ${uri}`);\n }\n console.log(`[CodSpeed] Done running ${bench.tasks.length} benches.`);\n return bench.tasks;\n };\n return bench;\n}\n\nfunction getCallingFile(): string {\n const stack = getStackTrace();\n const callingFile = stack[2].getFileName(); // [here, withCodSpeed, actual caller]\n const gitDir = getGitDir(callingFile);\n if (gitDir === undefined) {\n throw new Error(\"Could not find a git repository\");\n }\n return path.relative(gitDir, callingFile);\n}\n\nfunction getGitDir(path: string): string | undefined {\n const dotGitPath = findUpSync(\".git\", {\n cwd: path,\n type: \"directory\",\n } as Options);\n return dotGitPath ? dirname(dotGitPath) : undefined;\n}\n"],"names":["toPath","getStackTrace","path"],"mappings":";;;;;;;AAMA,MAAM,YAAY,GAAG;AACrB,CAAC,SAAS,EAAE,aAAa;AACzB,CAAC,IAAI,EA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AAkB,GAAK,CAAA,CAAA,CAAA,CAAA;AAAA,KACrC;AACA,IAAA,OAAA,CAAQ,GAAI,CAAA,CAAA,wBAAA,EAA2B,KAAM,CAAA,KAAA,CAAM,MAAiB,CAAA,SAAA,CAAA,CAAA,CAAA;AACpE,IAAA,OAAO,KAAM,CAAA,KAAA,CAAA;AAAA,GACf,CAAA;AACA,EAAO,OAAA,KAAA,CAAA;AACT,CAAA;AAEA,SAAS,cAAyB,GAAA;AAChC,EAAA,MAAM,QAAQC,GAAc,EAAA,CAAA;AAC5B,EAAA,MAAM,WAAc,GAAA,KAAA,CAAM,CAAC,CAAA,CAAE,WAAY,EAAA,CAAA;AACzC,EAAM,MAAA,MAAA,GAAS,UAAU,WAAW,CAAA,CAAA;AACpC,EAAA,IAAI,WAAW,KAAW,CAAA,EAAA;AACxB,IAAM,MAAA,IAAI,MAAM,iCAAiC,CAAA,CAAA;AAAA,GACnD;AACA,EAAO,OAAAC,MAAA,CAAK,QAAS,CAAA,MAAA,EAAQ,WAAW,CAAA,CAAA;AAC1C,CAAA;AAEA,SAAS,UAAUA,KAAkC,EAAA;AACnD,EAAM,MAAA,UAAA,GAAa,WAAW,MAAQ,EAAA;AAAA,IACpC,GAAKA,EAAAA,KAAAA;AAAA,IACL,IAAM,EAAA,WAAA;AAAA,GACI,CAAA,CAAA;AACZ,EAAO,OAAA,UAAA,GAAa,OAAQ,CAAA,UAAU,CAAI,GAAA,KAAA,CAAA,CAAA;AAC5C;;;;","x_google_ignoreList":[0,1,2]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codspeed/tinybench-plugin",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "tinybench compatibility layer for CodSpeed",
5
5
  "keywords": [
6
6
  "codspeed",
@@ -21,11 +21,11 @@
21
21
  "devDependencies": {
22
22
  "@types/find-up": "^4.0.0",
23
23
  "@types/stack-trace": "^0.0.30",
24
- "jest-mock-extended": "^3.0.1",
25
- "tinybench": "^2.3.0"
24
+ "jest-mock-extended": "^3.0.4",
25
+ "tinybench": "^2.4.0"
26
26
  },
27
27
  "dependencies": {
28
- "@codspeed/core": "^1.0.1",
28
+ "@codspeed/core": "^1.1.0",
29
29
  "find-up": "^6.3.0",
30
30
  "stack-trace": "1.0.0-pre1"
31
31
  },