Skip to content

Commit

Permalink
feat: reorganize into src folder
Browse files Browse the repository at this point in the history
  • Loading branch information
tale committed Jan 21, 2022
1 parent 00cf038 commit ace2451
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
},
"scripts": {
"build": "tsup index.ts --format cjs,esm --dts --clean --minify",
"build": "tsup ./src/index.ts --format cjs,esm --dts --clean --minify",
"prepublishOnly": "pnpm run build",
"push": "np",
"test": "jest"
Expand Down
File renamed without changes.
10 changes: 9 additions & 1 deletion index.ts → src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export * from './release'

export function parseKV(data: string) {
const cleanedData = data.replaceAll(/\r\n|\r|\n/g, '\n').replaceAll(/\0/g, '').normalize().trim()
const lineChunks = cleanedData.split('\n') // We know it will always be \n because of our cleanup
Expand Down Expand Up @@ -35,7 +37,6 @@ export function parseKV(data: string) {
const appendContent = (existingContent + appendLine).replace(/\s+/g, ' ').trim()
fields.set(previousKey, appendContent)
}

}

continue
Expand Down Expand Up @@ -69,6 +70,13 @@ export function parseControl(data: string) {
return parsePackages(data)
}

/**
* Parse raw file contents of a release file and retrieve a map of keys and values
*
* @deprecated Use the `Release` class instead
* @param data Raw string contents from a Release file
* @returns Map of string keys and values
*/
export function parseRelease(data: string) {
const mapped = parseKV(data)

Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"outDir": "dist",
"rootDir": "src",
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Node",
Expand Down

0 comments on commit ace2451

Please sign in to comment.