Merge pull request #27886 from LexSwed/parse-git-config

[@types/parse-git-config] sync with latest api changes
This commit is contained in:
Ron Buckton
2018-08-08 13:33:22 -07:00
committed by GitHub
2 changed files with 5 additions and 3 deletions

View File

@@ -39,7 +39,7 @@ interface Parse {
/**
* Returns an object with only the properties that had ini-style keys converted to objects.
*/
keys(config: Config): Config;
expandKeys(config: Config): Config;
}
// no-empty-interface is disabled for a better debugging experience. Empty interfaces are used to alias a type alias.
@@ -49,6 +49,8 @@ interface Options extends Pick<_Options, keyof _Options> { }
interface _Options {
cwd: string;
path: string;
include?: boolean;
expandKeys?: boolean;
}
type ParseCallback = ((err: Error | null, config: Config) => void);

View File

@@ -99,12 +99,12 @@ function test_sync() {
}
}
function test_keys() {
function test_expandKeys() {
const config = {
'foo "bar"': { doStuff: true },
'foo "baz"': { doStuff: true }
};
const keys = parse.keys(config);
const keys = parse.expandKeys(config);
keys.foo.bar.doStuff === true;
keys.foo.baz.doStuff === true;