File tree Expand file tree Collapse file tree 3 files changed +5
-6
lines changed
packages/openapi-ts/src/generate Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import { getClientPlugin } from '../plugins/@hey-api/client-core/utils';
9
9
import type { DefinePlugin } from '../plugins/types' ;
10
10
import type { ImportExportItemObject } from '../tsc/utils' ;
11
11
import type { Config } from '../types/config' ;
12
- import { _test } from './file' ;
12
+ import { splitNameAndExtension } from './file' ;
13
13
import { ensureDirSync , relativeModulePath } from './utils' ;
14
14
15
15
// Use require.resolve to find the package root, then construct the path
@@ -121,7 +121,7 @@ const infixDotGenToFiles = (outputPath: string) => {
121
121
for ( const file of coreFiles ) {
122
122
const filePath = path . resolve ( outputPath , file ) ;
123
123
if ( file !== 'index.ts' ) {
124
- const { extension, name } = _test . splitNameAndExtension ( filePath ) ;
124
+ const { extension, name } = splitNameAndExtension ( filePath ) ;
125
125
const newFilePath = path . resolve (
126
126
outputPath ,
127
127
[ name , 'gen' , extension ] . filter ( Boolean ) . join ( '.' ) ,
Original file line number Diff line number Diff line change 1
1
import { describe , expect , it } from 'vitest' ;
2
2
3
- import { _test } from '../index' ;
3
+ import { _test , splitNameAndExtension } from '../index' ;
4
4
import type { Identifiers } from '../types' ;
5
5
6
- const { ensureUniqueIdentifier, parseRef, splitNameAndExtension } = _test ;
6
+ const { ensureUniqueIdentifier, parseRef } = _test ;
7
7
8
8
describe ( 'parseRef' , ( ) => {
9
9
it ( 'should parse simple ref without properties' , ( ) => {
Original file line number Diff line number Diff line change @@ -647,7 +647,7 @@ const ensureUniqueIdentifier = ({
647
647
} ;
648
648
} ;
649
649
650
- const splitNameAndExtension = ( fileName : string ) => {
650
+ export const splitNameAndExtension = ( fileName : string ) => {
651
651
const match = fileName . match ( / \. [ 0 - 9 a - z ] + $ / i) ;
652
652
const extension = match ? match [ 0 ] . slice ( 1 ) : '' ;
653
653
const name = fileName . slice (
@@ -660,5 +660,4 @@ const splitNameAndExtension = (fileName: string) => {
660
660
export const _test = {
661
661
ensureUniqueIdentifier,
662
662
parseRef,
663
- splitNameAndExtension,
664
663
} ;
You can’t perform that action at this time.
0 commit comments