當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript util.exists函數代碼示例

本文整理匯總了TypeScript中@hpcc-js/util.exists函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript exists函數的具體用法?TypeScript exists怎麽用?TypeScript exists使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了exists函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: it

    it("deepMixin", function () {
        expect(exists("a", { a: "a" })).to.be.true;
        expect(exists("b", { a: "a" })).to.be.false;
        expect(exists("a.b", { a: { b: "b" } })).to.be.true;
        expect(exists("a.b.c.d", { a: { b: { c: { d: "d" } } } })).to.be.true;
        expect(exists("a.b.c.e", { a: { b: { c: { d: "d" } } } })).to.be.false;
        expect(exists("e.b.c.d", { a: { b: { c: { d: "d" } } } })).to.be.false;
        expect(exists("", { a: { b: { c: { d: "d" } } } })).to.be.false;
        expect(exists("a", undefined)).to.be.false;
        expect(exists(undefined as any, {})).to.be.false;
        expect(exists("a", "a")).to.be.false;

        expect(() => exists("a", null)).to.throw(Error);
    });
開發者ID:GordonSmith,項目名稱:Visualization,代碼行數:14,代碼來源:object.spec.ts

示例2: parseXSD

 return this.WUResult(from, count, !includeSchema, filter).then((response) => {
     const result = response.Result;
     delete response.Result; //  Do not want it in "set"
     this.set({
         ...response
     } as any);
     if (exists("XmlSchema.xml", result)) {
         this.xsdSchema = parseXSD(result.XmlSchema.xml);
     }
     if (exists("Row", result)) {
         return result.Row;
     } else if (this.ResultName && exists(this.ResultName, result)) {
         return result[this.ResultName].Row;
     }
     return [];
 });
開發者ID:GordonSmith,項目名稱:Visualization,代碼行數:16,代碼來源:result.ts

示例3:

 return this.connection.TpServiceQuery({}).then(response => {
     const rootProtocol = this.connection.protocol();
     const ip = this.connection.ip();
     let port = rootProtocol === "https:" ? "18002" : "8002";
     if (exists("ServiceList.TpEspServers.TpEspServer", response)) {
         for (const item of response.ServiceList.TpEspServers.TpEspServer) {
             if (exists("TpBindings.TpBinding", item)) {
                 for (const binding of item.TpBindings.TpBinding) {
                     if (binding.Service === type && binding.Protocol + ":" === rootProtocol) {
                         port = binding.Port;
                     }
                 }
             }
         }
     }
     return `${rootProtocol}//${ip}:${port}/`;
 });
開發者ID:GordonSmith,項目名稱:Visualization,代碼行數:17,代碼來源:topology.ts

示例4: exists

 }).then(response => {
     return exists("TargetClusterUsages.TargetClusterUsage", response) ? response.TargetClusterUsages.TargetClusterUsage : [];
 });
開發者ID:GordonSmith,項目名稱:Visualization,代碼行數:3,代碼來源:wsMachine.ts

示例5: expect

 expect(() => exists("a", null)).to.throw(Error);
開發者ID:GordonSmith,項目名稱:Visualization,代碼行數:1,代碼來源:object.spec.ts


注:本文中的@hpcc-js/util.exists函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。