Skip to content

Commit

Permalink
feat: rename extension to ext
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k committed Mar 12, 2019
1 parent dc5080c commit 514a889
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ In any file, simply invoke command `Generate Index` to generate a file list.
- Example 4: `assets/index.ts`

```js
// @index('./*.{png,jpg,svg}', pp => `export { default as ${pp.name} } from '${pp.path}${pp.extension}'`)
// @index('./*.{png,jpg,svg}', pp => `export { default as ${pp.name} } from '${pp.path}${pp.ext}'`)
export { default as image1 } from './image1.png'
export { default as image2 } from './image2.jpg'
export { default as image3 } from './image3.svg'
Expand Down Expand Up @@ -67,7 +67,7 @@ interface ParsedPath {
/** The file name without extension, such as `api` */
name: string,
/** The file extension, such as `.js`*/
extension: string,
ext: string,
}

type Pattern = string
Expand Down
4 changes: 2 additions & 2 deletions src/Generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface ParsedPath {
/** The file name without extension, such as `api` */
name: string,
/** The file extension, such as `.js`*/
extension: string,
ext: string,
}

type Pattern = string
Expand Down Expand Up @@ -65,7 +65,7 @@ export default class Generator {
const parsedPath: ParsedPath = {
path: getRelativePath(currentDir, p.join(pp.dir, pp.name)),
name: pp.name,
extension: pp.ext,
ext: pp.ext,
}
const code = marker.codeGenerator(parsedPath, lodash)
return marker.indent + code
Expand Down

0 comments on commit 514a889

Please sign in to comment.