@mintlify/common 1.0.301 → 1.0.303

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.
@@ -0,0 +1,3 @@
1
+ import { AsyncAPIDocumentV3, AsyncAPIDocumentInterface } from '@asyncapi/parser';
2
+ export type AsyncAPIDocument = AsyncAPIDocumentV3;
3
+ export type { AsyncAPIDocumentInterface };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ export declare function isString(val: unknown): val is string;
2
+ export declare function isNumber(val: unknown): val is number;
3
+ export declare function isInteger(val: unknown): val is number;
4
+ export declare function isObject(val: unknown): val is Record<string, unknown>;
5
+ export declare function isArray(val: unknown): val is Array<unknown>;
6
+ export declare function isBoolean(val: unknown): val is boolean;
7
+ export declare function isNull(val: unknown): val is null;
8
+ /** File is a web API - must do window check to avoid server-side error */
9
+ export declare function isFile(val: unknown): val is File;
@@ -0,0 +1,27 @@
1
+ export function isString(val) {
2
+ return typeof val === 'string';
3
+ }
4
+ export function isNumber(val) {
5
+ const num = Number(val);
6
+ return typeof num === 'number' && !isNaN(num);
7
+ }
8
+ export function isInteger(val) {
9
+ const num = Number(val);
10
+ return typeof num === 'number' && !isNaN(num) && num % 1 === 0;
11
+ }
12
+ export function isObject(val) {
13
+ return !!val && typeof val === 'object' && !Array.isArray(val);
14
+ }
15
+ export function isArray(val) {
16
+ return !!val && typeof val === 'object' && Array.isArray(val);
17
+ }
18
+ export function isBoolean(val) {
19
+ return typeof val === 'boolean';
20
+ }
21
+ export function isNull(val) {
22
+ return val === null;
23
+ }
24
+ /** File is a web API - must do window check to avoid server-side error */
25
+ export function isFile(val) {
26
+ return typeof window !== 'undefined' && val instanceof File;
27
+ }
@@ -1,2 +1,3 @@
1
1
  export type { PathItemObject, OperationObject, SecuritySchemeObject, Parameter, Response, Server, Example, Schema, SchemaV3, ResponseV3, DocumentV3, } from './openapi.js';
2
2
  export * from './mdx/index.js';
3
+ export * from './guards.js';
@@ -1 +1,2 @@
1
1
  export * from './mdx/index.js';
2
+ export * from './guards.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintlify/common",
3
- "version": "1.0.301",
3
+ "version": "1.0.303",
4
4
  "description": "Commonly shared code within Mintlify",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -8,6 +8,10 @@
8
8
  "files": [
9
9
  "dist"
10
10
  ],
11
+ "exports": {
12
+ ".": "./dist/index.js",
13
+ "./asyncapi": "./dist/asyncapi.js"
14
+ },
11
15
  "type": "module",
12
16
  "publishConfig": {
13
17
  "access": "public",
@@ -28,6 +32,7 @@
28
32
  "author": "Mintlify, Inc.",
29
33
  "license": "ISC",
30
34
  "dependencies": {
35
+ "@asyncapi/parser": "^3.4.0",
31
36
  "@mintlify/mdx": "^1.0.1",
32
37
  "@mintlify/models": "0.0.177",
33
38
  "@mintlify/openapi-parser": "^0.0.7",
@@ -79,5 +84,5 @@
79
84
  "typescript": "^5.5.3",
80
85
  "vitest": "^2.0.4"
81
86
  },
82
- "gitHead": "cc2c1c610c9e5e8136285b7712382d15fe7adee8"
87
+ "gitHead": "d004f146e1244b6ed977cb9ce2668738d7b6f42f"
83
88
  }