This repository has been archived by the owner on Jul 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: invoke source map * fix: serverless-invoke tsTmpFile * fix: tmpdir * fix: process exit * fix merge bug * fix bug * fix: fix tmp tsconfig bug * fix: tsc incremental not work (#51) * fix: incremental params pass * chores: remove useless code * fix: incremental no effect * refactor: update clean flag * chore: clean test code * chore: clean test code * chore: update yml md Co-authored-by: Harry Chen <czy88840616@gmail.com> * v0.2.25 * fix: invoke source map * fix: serverless-invoke tsTmpFile * fix: tmpdir * fix: process exit * fix merge bug * fix bug * fix: fix tmp tsconfig bug * fix/remove conflict * chore: update to beta midway-* * fix aggregation deploy * fix: combine tsconfig * fix: ts build error Co-authored-by: Lellansin Huang <Lellansin@gmail.com> Co-authored-by: Harry Chen <czy88840616@gmail.com>
- Loading branch information
1 parent
0f26293
commit 9149d2a
Showing
39 changed files
with
348 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
packages/faas-cli-plugin-package/test/commonPrefix.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { commonPrefix } from '../src/utils'; | ||
import * as assert from 'assert'; | ||
describe('/test/commonPrefix.test.ts', () => { | ||
describe('commonPrefix', () => { | ||
it('/', async () => { | ||
const prefix = commonPrefix(['/api/index', '/api/api2', '/']); | ||
assert(prefix === ''); | ||
}); | ||
it('/*', async () => { | ||
const prefix = commonPrefix(['/api/index', '/api/api2', '//*']); | ||
assert(prefix === ''); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const getType = (v: any) => (({}).toString.call(v).slice(8, -1).toLowerCase()); | ||
export const combineTsConfig = (config, ...tsConfig: any[]) => { | ||
const combined = config || {}; | ||
for (const config of tsConfig || []) { | ||
for (const key in config || {}) { | ||
const value = config[key]; | ||
const valueType = getType(value); | ||
if (valueType === 'object') { | ||
combined[key] = combineTsConfig({}, combined[key], value); | ||
} else if (valueType === 'array') { | ||
if (!combined[key]) { | ||
combined[key] = []; | ||
} | ||
combined[key].push(...value); | ||
} else { | ||
if (value || value === false) { | ||
combined[key] = value; | ||
} | ||
} | ||
} | ||
} | ||
return combined; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.