mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Merge pull request #31817 from rthreei/add-ensure
Add missing "ensure" to @types/xmlpoke's API interface
This commit is contained in:
Vendored
+1
@@ -25,6 +25,7 @@ declare module XmlPoke { // ghost module
|
||||
withBasePath(xpath: string): API;
|
||||
addNamespace(prefix: string, uri: string): API;
|
||||
errorOnNoMatches(): API;
|
||||
ensure(xpath: string): API;
|
||||
}
|
||||
interface CDataValue {
|
||||
value: string;
|
||||
|
||||
@@ -76,3 +76,7 @@ result = xmlpoke('<test><x><![CDATA[hello]]></x></test>', xml =>
|
||||
return 'y';
|
||||
}));
|
||||
assert.equal(result, '<test><x>y</x></test>');
|
||||
|
||||
// ensure
|
||||
result = xmlpoke('</a>', xml => xml.ensure('a/b'));
|
||||
assert.equal(result, '<a><b/></a>');
|
||||
|
||||
Reference in New Issue
Block a user