plist: Support building from ReadonlyArray (#30119)

This commit is contained in:
Andy
2018-10-29 11:56:25 -07:00
committed by GitHub
parent 3b647f0a80
commit f7c79778d9
2 changed files with 9 additions and 2 deletions
+2 -2
View File
@@ -20,9 +20,9 @@ export type PlistValue =
string | number | boolean |
Date | Buffer | PlistObject | PlistArray;
export interface PlistObject {
[x: string]: PlistValue;
readonly [x: string]: PlistValue;
}
export interface PlistArray extends Array<PlistValue> { }
export interface PlistArray extends ReadonlyArray<PlistValue> { }
// PlistBuildOptions
// The instance of this type is passed to 'xmlbuilder' module as it is.
+7
View File
@@ -79,3 +79,10 @@ console.log(plistString1);
const plistString2 = plist.build(plistValue2, {pretty: false});
console.log(plistString2);
function f(a: ReadonlyArray<string>) {
plist.build(a);
}
// $ExpectError
plist.build(() => 0);