Comparing version
@@ -20,4 +20,5 @@ import { LowerHttpMethod, AspidaMethodParams } from './'; | ||
doc?: Doc | undefined; | ||
$textForApiTypes: string; | ||
} | null; | ||
export {}; | ||
//# sourceMappingURL=parseInterface.d.ts.map |
@@ -255,17 +255,17 @@ "use strict"; | ||
} | ||
return methods; | ||
return { methods: methods, cursor: cursor }; | ||
}; | ||
var parse = function (text, name) { | ||
var _a; | ||
var interfaceRegExp = new RegExp("(^|\r?\n)export (interface " + name + "|type " + name + " ?=) ?{"); | ||
var interfaceRegExp = new RegExp("(^|\r?\n)(export )(interface " + name + "|type " + name + " ?=)( ?{)"); | ||
if (!interfaceRegExp.test(text)) | ||
return null; | ||
var _b = __read(text.split(interfaceRegExp)), d = _b[0], m = _b.slice(1); | ||
var methods = parseMethods(m[m.length - 1]); | ||
var _c = parseMethods(m[m.length - 1]), methods = _c.methods, cursor = _c.cursor; | ||
var docText = d.slice(d.lastIndexOf('/**')); | ||
return methods.length | ||
? { | ||
methods: methods, | ||
doc: /\/\*\*[\s\S]+\*\/$/.test(d) | ||
? (_a = parseDoc(d.slice(d.lastIndexOf('/**')))) === null || _a === void 0 ? void 0 : _a.values | ||
: undefined | ||
doc: /\/\*\*[\s\S]+\*\/$/.test(d) ? (_a = parseDoc(docText)) === null || _a === void 0 ? void 0 : _a.values : undefined, | ||
$textForApiTypes: "" + docText + m.slice(0, -1).join('') + m[m.length - 1].slice(0, cursor + 1) | ||
} | ||
@@ -272,0 +272,0 @@ : null; |
{ | ||
"name": "aspida", | ||
"version": "1.6.1", | ||
"version": "1.6.2", | ||
"description": "TypeScript friendly HTTP client wrapper for the browser and node.js", | ||
@@ -5,0 +5,0 @@ "author": "Solufa <solufa2020@gmail.com>", |
@@ -278,3 +278,3 @@ # aspida | ||
- [@aspida/swrv](https://github.com/aspida/aspida/tree/master/packages/aspida-swrv) - SWRV (Vue Composition API) wrapper | ||
- [eslint-plugin-aspida](https://github.com/ibuki2003/eslint-plugin-aspida) - Support writing aspida api definition | ||
- [eslint-plugin-aspida](https://github.com/aspida/eslint-plugin-aspida) - Support writing aspida api definition | ||
@@ -357,2 +357,4 @@ ## Tips | ||
```typescript | ||
import type { ReadStream } from 'fs' | ||
export type Methods = { | ||
@@ -359,0 +361,0 @@ post: { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
109545
0.49%1083
0.09%741
0.27%