How to use the dojo/_base/lang.exists function in dojo

To help you get started, we’ve selected a few dojo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hpcc-systems / HPCC-Platform / esp / src / src / WsTopology.ts View on Github external
}).then(lang.hitch(this, function (response) {
                var data = [];
                if (lang.exists("TpLogFileResponse.LogData", response)) {
                    this.lastPage = response.TpLogFileResponse.LogData;
                    this.emit("pageLoaded", this.lastPage);
                    arrayUtil.forEach(response.TpLogFileResponse.LogData.split("\n"), function (item, idx) {
                        if (options.start === 0 || idx > 0) {
                            //  Throw away first line as it will probably only be a partial line  ---
                            var itemParts = item.split(" ");
                            var lineNo, date, time, pid, tid, details;
                            if (itemParts.length) lineNo = nextItem(itemParts);
                            if (itemParts.length) date = nextItem(itemParts);
                            if (itemParts.length) time = nextItem(itemParts);
                            if (itemParts.length) pid = nextItem(itemParts);
                            if (itemParts.length) tid = nextItem(itemParts);
                            if (itemParts.length) details = itemParts.join(" ");
                            data.push({
                                __hpcc_id: response.TpLogFileResponse.PageNumber + "_" + idx,
                                lineNo: lineNo,
github hpcc-systems / HPCC-Platform / esp / src / src / ESPWorkunit.ts View on Github external
}).then(function (response) {
            if (lang.exists("WUInfoResponse.Workunit", response)) {
                if (!args.onGetText && lang.exists("WUInfoResponse.Workunit.Query", response)) {
                    //  A truncated version of ECL just causes issues  ---
                    delete response.WUInfoResponse.Workunit.Query;
                }
                if (lang.exists("WUInfoResponse.ResultViews", response) && lang.exists("WUInfoResponse.Workunit.Results", response)) {
                    lang.mixin(response.WUInfoResponse.Workunit.Results, {
                        ResultViews: response.WUInfoResponse.ResultViews
                    });
                }
                if (args.onGetWUExceptions && !lang.exists("WUInfoResponse.Workunit.Exceptions.ECLException", response)) {
                    lang.mixin(response.WUInfoResponse.Workunit, {
                        Exceptions: {
                            ECLException: []
                        }
                    })
                }
                context.updateData(response.WUInfoResponse.Workunit);

                if (args.onGetText) {
                    args.onGetText(lang.exists("Query.Text", context) ? context.Query.Text : "");
                }
github hpcc-systems / HPCC-Platform / esp / src / src / GraphTreeWidget.ts View on Github external
isWorkunit() {
        return lang.exists("params.Wuid", this);
    }
github hpcc-systems / HPCC-Platform / esp / src / src / Graph7Widget.ts View on Github external
isWorkunit() {
        return lang.exists("params.Wuid", this);
    }
github hpcc-systems / HPCC-Platform / esp / src / src / ESPWorkunit.ts View on Github external
_StateIDSetter: function (StateID) {
        this.StateID = StateID;
        var actionEx = lang.exists("ActionEx", this) ? this.ActionEx : null;
        this.set("hasCompleted", WsWorkunits.isComplete(this.StateID, actionEx));
    },
    _ActionExSetter: function (ActionEx) {
github hpcc-systems / HPCC-Platform / esp / src / src / ESPLogicalFile.ts View on Github external
WsDfu.DFUArrayAction([this], "Delete").then(function (response) {
            if (lang.exists("DFUArrayActionResponse.ActionResults.DFUActionInfo", response) &&
                response.DFUArrayActionResponse.ActionResults.DFUActionInfo.length &&
                !response.DFUArrayActionResponse.ActionResults.DFUActionInfo[0].Failed) {
                context.updateData({ StateID: 999, State: "deleted" })
            } else {
                context.refresh();
            }
        });
    },
github hpcc-systems / HPCC-Platform / esp / src / src / GraphTreeWidget.ts View on Github external
}).then(function (response) {
            context.main.setMessage("");
            if (lang.exists("WUQueryGetGraphResponse.Graphs.ECLGraphEx", response)) {
                if (response.WUQueryGetGraphResponse.Graphs.ECLGraphEx.length > 0) {
                    context.loadGraphFromXGMML(response.WUQueryGetGraphResponse.Graphs.ECLGraphEx[0].Graph);
                }
            }
        });
    }
github hpcc-systems / HPCC-Platform / esp / src / src / GraphTree7Widget.ts View on Github external
isQuery() {
        return lang.exists("params.QueryId", this);
    }
github hpcc-systems / HPCC-Platform / esp / src / src / ESPDFUWorkunit.ts View on Github external
}).then(function (response) {
            if (lang.exists("GetDFUWorkunitResponse.result", response)) {
                context.updateData(response.GetDFUWorkunitResponse.result);

                if (args.onAfterSend) {
                    args.onAfterSend(context);
                }
            }
        });
    },
github hpcc-systems / HPCC-Platform / esp / src / src / ESPResult.ts View on Github external
preProcessResponse: function (response, request) {
        if (response.Total === -1 || response.Total === 9223372036854776000 || response.Total === Number.MAX_VALUE) {
            response.Total = response.Start + response.Count + 1000;
        }
        if (lang.exists("Result.Row", response)) {
            var context = this;
            var retVal = context._structure ? this.formatRows(context._structure, response.Result.Row) : response.Result.Row;
            arrayUtil.forEach(retVal, function (item, index) {
                item.__hpcc_rowNum = request.Start + index + 1;
                item.__hpcc_id = context.idPrefix + "_" + item.__hpcc_rowNum;
            });
            response.Result = retVal;
        }
    },
    formatRows: function (columns, rows) {

dojo

Dojo core is a powerful, lightweight library that makes common tasks quicker and easier. Animate elements, manipulate the DOM, and query with easy CSS syntax, all without sacrificing performance.

BSD-3-Clause OR AFL-2.1
Latest version published 2 years ago

Package Health Score

59 / 100
Full package analysis