<commit_before>define([
    "dojo/query",
    "dojo/request",
    "esri/geometry/Polygon",
    "dojo/_base/declare"
    ], function(query, request, Polygon,declare)
    {
    "use strict";
    return declare("O.esri.Tiles.OfflineTilesEnabler",[],{
            /**
             * Utility method to get the basemap layer reference
             * @param map
             * @returns {Number} layerId
             */
            getBasemapLayer: function(map)
            {
                var layerId = map.layerIds[0];
                return map.getLayer(layerId);
            },

            /**
             * Method that extends a layer object with the offline capability.
             * After extending one layer, you can call layer.goOffline() or layer.goOnline()
             * @param layer
             * @param callback
             * @param state Optional Recommended. Pre-sets whether or not the application is online or offline.
             * Specifically used for applications that need to protect against browser reload/restart while offline.
             * @param dbConfig is an optional object that can be used to customize the database name (`dbName`) and
             * the object store (`objectStoreName`) name. Example: `{dbName: "TILES_TEST", objectStoreName: "TILES"}`.
             * @returns {callback} callback(boolean, string)
             */
            extend: function(layer,callback,/* boolean */ state,/* Object */ dbConfig)
            {
                console.log("extending layer", layer.url);

                layer._tilesCore = new O.esri.Tiles.TilesCore();
                layer._lastTileUrl = "";
                layer._imageType = "";
                layer._minZoom = null;
                layer._maxZoom = null;

                if( dbConfig === "undefined" || dbConfig === null){
                    // Database properties
                    layer.DB_NAME = "offline_tile_store";       // Sets the database name.
                    layer.DB_OBJECTSTORE_NAME = "tilepath"; // Represents an object store that allows access to a set of data in the IndexedDB database
                }
                else {
                    layer.DB_NAME = dbConfig.dbName;
                    layer.DB_OBJECTSTORE_NAME = dbConfig.objectStoreName;
                }

                /* we add some methods to the layer object */
                /* we don't want to extend the tiled layer class, as it is a capability that we want to add only to one instance */
                /* we also add some additional attributes inside an "offline" object */

                layer._getTileUrl = layer.getTileUrl;
<commit_msg>destringify undefined<commit_after>define([
    "dojo/query",
    "dojo/request",
    "esri/geometry/Polygon",
    "dojo/_base/declare"
    ], function(query, request, Polygon,declare)
    {
    "use strict";
    return declare("O.esri.Tiles.OfflineTilesEnabler",[],{
            /**
             * Utility method to get the basemap layer reference
             * @param map
             * @returns {Number} layerId
             */
            getBasemapLayer: function(map)
            {
                var layerId = map.layerIds[0];
                return map.getLayer(layerId);
            },

            /**
             * Method that extends a layer object with the offline capability.
             * After extending one layer, you can call layer.goOffline() or layer.goOnline()
             * @param layer
             * @param callback
             * @param state Optional Recommended. Pre-sets whether or not the application is online or offline.
             * Specifically used for applications that need to protect against browser reload/restart while offline.
             * @param dbConfig is an optional object that can be used to customize the database name (`dbName`) and
             * the object store (`objectStoreName`) name. Example: `{dbName: "TILES_TEST", objectStoreName: "TILES"}`.
             * @returns {callback} callback(boolean, string)
             */
            extend: function(layer,callback,/* boolean */ state,/* Object */ dbConfig)
            {
                console.log("extending layer", layer.url);

                layer._tilesCore = new O.esri.Tiles.TilesCore();
                layer._lastTileUrl = "";
                layer._imageType = "";
                layer._minZoom = null;
                layer._maxZoom = null;

                if( dbConfig === undefined || dbConfig === null){
                    // Database properties
                    layer.DB_NAME = "offline_tile_store";       // Sets the database name.
                    layer.DB_OBJECTSTORE_NAME = "tilepath"; // Represents an object store that allows access to a set of data in the IndexedDB database
                }
                else {
                    layer.DB_NAME = dbConfig.dbName;
                    layer.DB_OBJECTSTORE_NAME = dbConfig.objectStoreName;
                }

                /* we add some methods to the layer object */
                /* we don't want to extend the tiled layer class, as it is a capability that we want to add only to one instance */
                /* we also add some additional attributes inside an "offline" object */

                layer._getTileUrl = layer.getTileUrl;

{'fraction_non_alphanumeric': 0.08963691376701967, 'fraction_numerical': 0.00037821482602118004, 'mean_word_length': 1.6766194331983806, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6252899', 'n_tokens_mistral': 1348, 'n_tokens_neox': 1273, 'n_words': 423}