vue-component-meta 1.0.13 → 1.0.16

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/out/index.js CHANGED
@@ -276,14 +276,24 @@ function createSchemaResolvers(typeChecker, symbolNode, { rawType, schema: optio
276
276
  const enabled = !!options;
277
277
  const ignore = typeof options === 'object' ? [...(_a = options === null || options === void 0 ? void 0 : options.ignore) !== null && _a !== void 0 ? _a : []] : [];
278
278
  function shouldIgnore(subtype) {
279
- const type = typeChecker.typeToString(subtype);
280
- if (type === 'any') {
279
+ const name = typeChecker.typeToString(subtype);
280
+ if (name === 'any') {
281
281
  return true;
282
282
  }
283
283
  if (ignore.length === 0) {
284
284
  return false;
285
285
  }
286
- return ignore.includes(type);
286
+ for (const item of ignore) {
287
+ if (typeof item === 'function') {
288
+ const result = item(name, subtype, typeChecker);
289
+ if (result != null)
290
+ return result;
291
+ }
292
+ else if (name === item) {
293
+ return true;
294
+ }
295
+ }
296
+ return false;
287
297
  }
288
298
  function setVisited(subtype) {
289
299
  const type = typeChecker.typeToString(subtype);
package/out/types.d.ts CHANGED
@@ -58,7 +58,11 @@ export type PropertyMetaSchema = string | {
58
58
  schema?: Record<string, PropertyMeta>;
59
59
  };
60
60
  export type MetaCheckerSchemaOptions = boolean | {
61
- ignore?: string[];
61
+ /**
62
+ * A list of type names to be ignored in expending in schema.
63
+ * Can be functions to ignore types dynamically.
64
+ */
65
+ ignore?: (string | ((name: string, type: ts.Type, typeChecker: ts.TypeChecker) => boolean | void | undefined | null))[];
62
66
  };
63
67
  export interface MetaCheckerOptions {
64
68
  schema?: MetaCheckerSchemaOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-component-meta",
3
- "version": "1.0.13",
3
+ "version": "1.0.16",
4
4
  "main": "out/index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -13,12 +13,12 @@
13
13
  "directory": "vue-language-tools/vue-component-meta"
14
14
  },
15
15
  "dependencies": {
16
- "@volar/language-core": "1.0.13",
17
- "@volar/vue-language-core": "1.0.13",
16
+ "@volar/language-core": "1.0.16",
17
+ "@volar/vue-language-core": "1.0.16",
18
18
  "typesafe-path": "^0.2.2"
19
19
  },
20
20
  "peerDependencies": {
21
21
  "typescript": "*"
22
22
  },
23
- "gitHead": "cba2eba187b2d82e1d45dd86b3edeab0ca7caad6"
23
+ "gitHead": "af476047d8859652254ed36f8aee184f1972a97a"
24
24
  }