@kubb/agent 4.27.4 → 4.28.1
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/.output/nitro.json +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +278 -140
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +5 -0
- package/.output/server/chunks/routes/api/health.get.mjs.map +1 -1
- package/.output/server/index.mjs +6 -1
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/node_modules/anymatch/index.js +104 -0
- package/.output/server/node_modules/anymatch/package.json +48 -0
- package/.output/server/node_modules/chokidar/handler.js +632 -0
- package/.output/server/node_modules/chokidar/index.js +822 -0
- package/.output/server/node_modules/chokidar/package.json +63 -0
- package/.output/server/node_modules/normalize-path/index.js +35 -0
- package/.output/server/node_modules/normalize-path/package.json +77 -0
- package/.output/server/node_modules/picomatch/index.js +3 -0
- package/.output/server/node_modules/picomatch/lib/constants.js +179 -0
- package/.output/server/node_modules/picomatch/lib/parse.js +1091 -0
- package/.output/server/node_modules/picomatch/lib/picomatch.js +342 -0
- package/.output/server/node_modules/picomatch/lib/scan.js +391 -0
- package/.output/server/node_modules/picomatch/lib/utils.js +64 -0
- package/.output/server/node_modules/picomatch/package.json +81 -0
- package/.output/server/node_modules/readdirp/index.js +272 -0
- package/.output/server/node_modules/readdirp/package.json +66 -0
- package/.output/server/package.json +6 -1
- package/README.md +98 -42
- package/package.json +16 -23
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nitro.mjs","sources":["../../../../../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs","../../../../../../node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs","../../../../../../node_modules/.pnpm/radix3@1.1.2/node_modules/radix3/dist/index.mjs","../../../../../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs","../../../../../../node_modules/.pnpm/node-mock-http@1.0.4/node_modules/node-mock-http/dist/index.mjs","../../../../../../node_modules/.pnpm/h3@1.15.5/node_modules/h3/dist/index.mjs","../../../../../../node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs","../../../../../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/native.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/dist/shared/unstorage.zVDD2mZo.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/dist/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/drivers/utils/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/drivers/utils/node-fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/drivers/fs-lite.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/storage.mjs","../../../../../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/hash.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/cache.mjs","../../../../../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/dist/index.mjs","../../../../../../node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/utils.env.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/config.mjs","../../../../../../node_modules/.pnpm/unctx@2.5.0/node_modules/unctx/dist/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/context.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/route-rules.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/error/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/error/prod.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/plugin.mjs","../../../../server/utils/logger.ts","../../../../server/plugins/fetch-logger.ts","../../../../../core/dist/chunk-iVr_oF3V.js","../../../../../core/dist/fs-Parec-wn.js","../../../../../core/dist/transformers-8ju9ixkG.js","../../../../../core/dist/getBarrelFiles-gRyVPFBP.js","../../../../../core/dist/utils.js","../../../../server/types/agent.ts","../../../../server/utils/
|
|
1
|
+
{"version":3,"file":"nitro.mjs","sources":["../../../../../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs","../../../../../../node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs","../../../../../../node_modules/.pnpm/radix3@1.1.2/node_modules/radix3/dist/index.mjs","../../../../../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs","../../../../../../node_modules/.pnpm/node-mock-http@1.0.4/node_modules/node-mock-http/dist/index.mjs","../../../../../../node_modules/.pnpm/h3@1.15.5/node_modules/h3/dist/index.mjs","../../../../../../node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs","../../../../../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/native.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/dist/shared/unstorage.zVDD2mZo.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/dist/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/drivers/utils/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/drivers/utils/node-fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/drivers/fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.4_db0@0.3.4_ioredis@5.9.3/node_modules/unstorage/drivers/fs-lite.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/storage.mjs","../../../../../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/hash.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/cache.mjs","../../../../../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/dist/index.mjs","../../../../../../node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/utils.env.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/config.mjs","../../../../../../node_modules/.pnpm/unctx@2.5.0/node_modules/unctx/dist/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/context.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/route-rules.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/error/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/error/prod.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/plugin.mjs","../../../../server/utils/logger.ts","../../../../server/plugins/fetch-logger.ts","../../../../../core/dist/chunk-iVr_oF3V.js","../../../../../core/dist/fs-Parec-wn.js","../../../../../core/dist/transformers-8ju9ixkG.js","../../../../../core/dist/getBarrelFiles-gRyVPFBP.js","../../../../../core/dist/utils.js","../../../../server/types/agent.ts","../../../../server/utils/getSessionKey.ts","../../../../server/utils/isSessionValid.ts","../../../../server/utils/token.ts","../../../../server/utils/api.ts","../../../../../core/dist/index.js","../../../../server/utils/executeHooks.ts","../../../../server/utils/generate.ts","../../../../server/utils/getCosmiConfig.ts","../../../../../plugin-client/dist/chunk-Cd3iupn7.js","../../../../../plugin-oas/dist/SchemaMapper-Bq_JVBfF.js","../../../../../oas/dist/chunk-BdfDOGov.js","../../../../../oas/dist/index.js","../../../../../plugin-oas/dist/requestBody-C0kGxql5.js","../../../../../plugin-oas/dist/getFooter-flVUU6wg.js","../../../../../plugin-oas/dist/utils.js","../../../../../plugin-client/dist/StaticClassClient-uqlvmwoJ.js","../../../../../plugin-oas/dist/generators-C86kmpzf.js","../../../../../plugin-oas/dist/index.js","../../../../../plugin-zod/dist/components-DJvhXrHc.js","../../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/typescript.js","../../../../../plugin-ts/dist/components-L5LzwAP7.js","../../../../../core/dist/hooks.js","../../../../../plugin-oas/dist/hooks.js","../../../../../plugin-ts/dist/plugin-CEOKHgBY.js","../../../../../plugin-zod/dist/generators-CcTPAM8G.js","../../../../../plugin-zod/dist/ToZod.source-B0uyS5aq.js","../../../../../plugin-zod/dist/index.js","../../../../../plugin-client/dist/generators-C3iBxAkk.js","../../../../../plugin-client/dist/axios.source-CDcg9aL-.js","../../../../../plugin-client/dist/fetch.source-DkBhuGC1.js","../../../../../plugin-client/dist/config.source-VWEtFolK.js","../../../../../plugin-client/dist/index.js","../../../../../plugin-cypress/dist/components-BlvQKb3f.js","../../../../../plugin-cypress/dist/generators-BMwRo8o2.js","../../../../../plugin-cypress/dist/index.js","../../../../../plugin-faker/dist/components-nXhowywN.js","../../../../../plugin-faker/dist/fakerGenerator-Dn1bSdX2.js","../../../../../plugin-faker/dist/index.js","../../../../../plugin-mcp/dist/Server-CI0jUJHC.js","../../../../../plugin-mcp/dist/generators-stveWfzc.js","../../../../../plugin-mcp/dist/index.js","../../../../../plugin-msw/dist/components-r7XTqwE7.js","../../../../../plugin-msw/dist/generators-CKxCewx3.js","../../../../../plugin-msw/dist/index.js","../../../../../plugin-react-query/dist/chunk-eQyhnF5A.js","../../../../../plugin-react-query/dist/components-DcRvg3r2.js","../../../../../plugin-react-query/dist/generators-D9wuuYX2.js","../../../../../plugin-react-query/dist/index.js","../../../../../plugin-redoc/dist/index.js","../../../../../plugin-solid-query/dist/chunk-eQyhnF5A.js","../../../../../plugin-solid-query/dist/components-DoLcWp4p.js","../../../../../plugin-solid-query/dist/generators-DRR19Vs8.js","../../../../../plugin-solid-query/dist/index.js","../../../../../plugin-svelte-query/dist/chunk-eQyhnF5A.js","../../../../../plugin-svelte-query/dist/components-D4pnmo3U.js","../../../../../plugin-svelte-query/dist/generators-CRv2JC_a.js","../../../../../plugin-svelte-query/dist/index.js","../../../../../plugin-swr/dist/chunk-eQyhnF5A.js","../../../../../plugin-swr/dist/components-DMM0j8AI.js","../../../../../plugin-swr/dist/generators-DoEN_HsS.js","../../../../../plugin-swr/dist/index.js","../../../../../plugin-vue-query/dist/chunk-eQyhnF5A.js","../../../../../plugin-vue-query/dist/components-BU-Odm8Y.js","../../../../../plugin-vue-query/dist/generators-C1k1sfKK.js","../../../../../plugin-vue-query/dist/index.js","../../../../server/utils/resolvePlugins.ts","../../../../server/utils/studioConfig.ts","../../../../server/utils/ws.ts","../../../../server/plugins/studio.ts","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/app.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/lib/http-graceful-shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/runtime/internal/shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.1_encoding@0.1.13_rolldown@1.0.0-rc.1/node_modules/nitropack/dist/presets/node/runtime/node-server.mjs"],"names":["createRouter","f","h","i","l","createError","mergeHeaders","s","nodeFetch","Headers","Headers$1","AbortController$1","stringify","normalizeKey","defineDriver","DRIVER_NAME","fsPromises","PATH_TRAVERSE_RE","fsp","snakeCase","_inlineAppConfig","createRadixRouter","__defProp","__name","fs","merge","_head","_tail","_size","_a","_options","_b","Node","__publicField","Queue","__privateAdd","__privateGet","__privateSet","__privateWrapper","pLimit","validateConcurrency","path","__privateMethod","performance","_c","_d","_e","_f","trimExtName","os","version","error","process","exports","Kind","YAMLException","ScalarType","Comments","isPlainObject","parse","transformers","getParams$1","Function","getParams","Operations","Type","require","global","operationsGenerator","source","source$2","Response","getTransformer$1","QueryKey","getParams$9","QueryOptions","getParams$8","InfiniteQuery","getParams$7","InfiniteQueryOptions","getParams$6","getTransformer","MutationKey","getParams$5","getParams$4","Mutation","getParams$3","Query","getParams$2","infiniteQueryGenerator","mutationGenerator","queryGenerator","__filename","__dirname","nitroApp","callNodeRequestHandler","fetchNodeRequestHandler","gracefulShutdown","HttpsServer","HttpServer"],"mappings":"","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,58,108,109,110,111]}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import process from 'node:process';globalThis._importMeta_=globalThis._importMeta_||{url:"file:///_entry.js",env:process.env};import urlNode from 'node:url'
|
|
2
|
+
import pathNode from 'node:path'
|
|
3
|
+
const __filename = urlNode.fileURLToPath(globalThis._importMeta_.url)
|
|
4
|
+
const __dirname = pathNode.dirname(__filename)
|
|
1
5
|
import { d as defineEventHandler, v as version } from '../../nitro/nitro.mjs';
|
|
2
6
|
import 'node:http';
|
|
3
7
|
import 'node:https';
|
|
@@ -5,6 +9,7 @@ import 'node:events';
|
|
|
5
9
|
import 'node:buffer';
|
|
6
10
|
import 'node:fs';
|
|
7
11
|
import 'node:path';
|
|
12
|
+
import 'anymatch';
|
|
8
13
|
import 'node:crypto';
|
|
9
14
|
import 'node:process';
|
|
10
15
|
import 'natural-orderby';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"health.get.mjs","sources":["../../../../../server/routes/api/health.get.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"health.get.mjs","sources":["../../../../../server/routes/api/health.get.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAAA,CACA;AACA,CAAA,CAAA;;"}
|
package/.output/server/index.mjs
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import process from 'node:process';globalThis._importMeta_={url:import.meta.url,env:process.env};import 'node:
|
|
1
|
+
import process from 'node:process';globalThis._importMeta_={url:import.meta.url,env:process.env};import urlNode from 'node:url'
|
|
2
|
+
import pathNode from 'node:path'
|
|
3
|
+
const __filename = urlNode.fileURLToPath(globalThis._importMeta_.url)
|
|
4
|
+
const __dirname = pathNode.dirname(__filename)
|
|
5
|
+
import 'node:http';
|
|
2
6
|
import 'node:https';
|
|
3
7
|
export { n as default } from './chunks/nitro/nitro.mjs';
|
|
4
8
|
import 'node:events';
|
|
5
9
|
import 'node:buffer';
|
|
6
10
|
import 'node:fs';
|
|
7
11
|
import 'node:path';
|
|
12
|
+
import 'anymatch';
|
|
8
13
|
import 'node:crypto';
|
|
9
14
|
import 'node:process';
|
|
10
15
|
import 'natural-orderby';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
|
|
5
|
+
const picomatch = require('picomatch');
|
|
6
|
+
const normalizePath = require('normalize-path');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {(testString: string) => boolean} AnymatchFn
|
|
10
|
+
* @typedef {string|RegExp|AnymatchFn} AnymatchPattern
|
|
11
|
+
* @typedef {AnymatchPattern|AnymatchPattern[]} AnymatchMatcher
|
|
12
|
+
*/
|
|
13
|
+
const BANG = '!';
|
|
14
|
+
const DEFAULT_OPTIONS = {returnIndex: false};
|
|
15
|
+
const arrify = (item) => Array.isArray(item) ? item : [item];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @param {AnymatchPattern} matcher
|
|
19
|
+
* @param {object} options
|
|
20
|
+
* @returns {AnymatchFn}
|
|
21
|
+
*/
|
|
22
|
+
const createPattern = (matcher, options) => {
|
|
23
|
+
if (typeof matcher === 'function') {
|
|
24
|
+
return matcher;
|
|
25
|
+
}
|
|
26
|
+
if (typeof matcher === 'string') {
|
|
27
|
+
const glob = picomatch(matcher, options);
|
|
28
|
+
return (string) => matcher === string || glob(string);
|
|
29
|
+
}
|
|
30
|
+
if (matcher instanceof RegExp) {
|
|
31
|
+
return (string) => matcher.test(string);
|
|
32
|
+
}
|
|
33
|
+
return (string) => false;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @param {Array<Function>} patterns
|
|
38
|
+
* @param {Array<Function>} negPatterns
|
|
39
|
+
* @param {String|Array} args
|
|
40
|
+
* @param {Boolean} returnIndex
|
|
41
|
+
* @returns {boolean|number}
|
|
42
|
+
*/
|
|
43
|
+
const matchPatterns = (patterns, negPatterns, args, returnIndex) => {
|
|
44
|
+
const isList = Array.isArray(args);
|
|
45
|
+
const _path = isList ? args[0] : args;
|
|
46
|
+
if (!isList && typeof _path !== 'string') {
|
|
47
|
+
throw new TypeError('anymatch: second argument must be a string: got ' +
|
|
48
|
+
Object.prototype.toString.call(_path))
|
|
49
|
+
}
|
|
50
|
+
const path = normalizePath(_path, false);
|
|
51
|
+
|
|
52
|
+
for (let index = 0; index < negPatterns.length; index++) {
|
|
53
|
+
const nglob = negPatterns[index];
|
|
54
|
+
if (nglob(path)) {
|
|
55
|
+
return returnIndex ? -1 : false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const applied = isList && [path].concat(args.slice(1));
|
|
60
|
+
for (let index = 0; index < patterns.length; index++) {
|
|
61
|
+
const pattern = patterns[index];
|
|
62
|
+
if (isList ? pattern(...applied) : pattern(path)) {
|
|
63
|
+
return returnIndex ? index : true;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return returnIndex ? -1 : false;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @param {AnymatchMatcher} matchers
|
|
72
|
+
* @param {Array|string} testString
|
|
73
|
+
* @param {object} options
|
|
74
|
+
* @returns {boolean|number|Function}
|
|
75
|
+
*/
|
|
76
|
+
const anymatch = (matchers, testString, options = DEFAULT_OPTIONS) => {
|
|
77
|
+
if (matchers == null) {
|
|
78
|
+
throw new TypeError('anymatch: specify first argument');
|
|
79
|
+
}
|
|
80
|
+
const opts = typeof options === 'boolean' ? {returnIndex: options} : options;
|
|
81
|
+
const returnIndex = opts.returnIndex || false;
|
|
82
|
+
|
|
83
|
+
// Early cache for matchers.
|
|
84
|
+
const mtchers = arrify(matchers);
|
|
85
|
+
const negatedGlobs = mtchers
|
|
86
|
+
.filter(item => typeof item === 'string' && item.charAt(0) === BANG)
|
|
87
|
+
.map(item => item.slice(1))
|
|
88
|
+
.map(item => picomatch(item, opts));
|
|
89
|
+
const patterns = mtchers
|
|
90
|
+
.filter(item => typeof item !== 'string' || (typeof item === 'string' && item.charAt(0) !== BANG))
|
|
91
|
+
.map(matcher => createPattern(matcher, opts));
|
|
92
|
+
|
|
93
|
+
if (testString == null) {
|
|
94
|
+
return (testString, ri = false) => {
|
|
95
|
+
const returnIndex = typeof ri === 'boolean' ? ri : false;
|
|
96
|
+
return matchPatterns(patterns, negatedGlobs, testString, returnIndex);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return matchPatterns(patterns, negatedGlobs, testString, returnIndex);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
anymatch.default = anymatch;
|
|
104
|
+
module.exports = anymatch;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "anymatch",
|
|
3
|
+
"version": "3.1.3",
|
|
4
|
+
"description": "Matches strings against configurable strings, globs, regular expressions, and/or functions",
|
|
5
|
+
"files": [
|
|
6
|
+
"index.js",
|
|
7
|
+
"index.d.ts"
|
|
8
|
+
],
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"normalize-path": "^3.0.0",
|
|
11
|
+
"picomatch": "^2.0.4"
|
|
12
|
+
},
|
|
13
|
+
"author": {
|
|
14
|
+
"name": "Elan Shanker",
|
|
15
|
+
"url": "https://github.com/es128"
|
|
16
|
+
},
|
|
17
|
+
"license": "ISC",
|
|
18
|
+
"homepage": "https://github.com/micromatch/anymatch",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/micromatch/anymatch"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"match",
|
|
25
|
+
"any",
|
|
26
|
+
"string",
|
|
27
|
+
"file",
|
|
28
|
+
"fs",
|
|
29
|
+
"list",
|
|
30
|
+
"glob",
|
|
31
|
+
"regex",
|
|
32
|
+
"regexp",
|
|
33
|
+
"regular",
|
|
34
|
+
"expression",
|
|
35
|
+
"function"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"test": "nyc mocha",
|
|
39
|
+
"mocha": "mocha"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"mocha": "^6.1.3",
|
|
43
|
+
"nyc": "^14.0.0"
|
|
44
|
+
},
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">= 8"
|
|
47
|
+
}
|
|
48
|
+
}
|