keys()

in public/dexie.js [1768:1807]


        keys(stores).forEach(function (tableName) {
          if (stores[tableName] !== null) {
            var instanceTemplate = {};
            var indexes = parseIndexSyntax(stores[tableName]);
            var primKey = indexes.shift();
            if (primKey.multi)
              throw new exceptions.Schema("Primary key cannot be multi-valued");
            if (primKey.keyPath)
              setByKeyPath(
                instanceTemplate,
                primKey.keyPath,
                primKey.auto ? 0 : primKey.keyPath
              );
            indexes.forEach(function (idx) {
              if (idx.auto)
                throw new exceptions.Schema(
                  "Only primary key can be marked as autoIncrement (++)"
                );
              if (!idx.keyPath)
                throw new exceptions.Schema(
                  "Index must have a name and cannot be an empty string"
                );
              setByKeyPath(
                instanceTemplate,
                idx.keyPath,
                idx.compound
                  ? idx.keyPath.map(function () {
                      return "";
                    })
                  : ""
              );
            });
            outSchema[tableName] = new TableSchema(
              tableName,
              primKey,
              indexes,
              instanceTemplate
            );
          }
        });