minified does not work in the emulator or iOS so move settings iteration to utils.prepareSettingsForAppMessage()

This commit is contained in:
Keegan
2016-03-09 12:24:29 +11:00
parent 34d83de59e
commit 37c64a6e05
4 changed files with 45 additions and 50 deletions
+15
View File
@@ -53,3 +53,18 @@ module.exports.prepareForAppMessage = function(val) {
return result;
};
/**
* Converts a Clay settings dict into one that is compatible with
* Pebble.sendAppMessage();
* @see {prepareForAppMessage}
* @param {Object} settings
* @returns {{}}
*/
module.exports.prepareSettingsForAppMessage = function(settings) {
var result = {};
Object.keys(settings).forEach(function(key) {
result[key] = module.exports.prepareForAppMessage(settings[key]);
});
return result;
};
+2 -42
View File
@@ -1,8 +1,8 @@
// minified.js config start -- use this comment to re-create a configuration in the Builder
// - Only sections add, always, amdsupport, copyobj, dollardollar,
// - each, eachobj, equals, error, extend, find, format, formathtml, get, ht,
// - html, isobject, mapobj, off, on, ready, request, select, set, template,
// - trigger, underscore, wait.
// - html, isobject, off, on, ready, request, select, set, template, trigger,
// - underscore, wait.
// WARNING! This file is autogenerated from minified-master.js and others.
@@ -2774,46 +2774,6 @@ define('minified', function() {
*/
'eachObj': eachObj,
/*$
* @id mapobj
* @group OBJECT
* @requires
* @configurable default
* @name _.mapObj()
* @syntax _.mapObj(obj, callback)
* @syntax _.mapObj(obj, callback, ctx)
* @module UTIL
* Creates a new object with the same properties but different values using the given callback function. The function is called
* for each property of the input object to provice a new value for the property.
*
* @example Increases the values of all properties.
* <pre>
* var r = _.mapObj({a: 1, b: 5, c: 2}, function(key, value) {
* return value + 1;
* });
* // r is now {a: 2, b: 6, c: 2}
* </pre>
*
* @param obj the object to use
* @param callback The callback <code>function(key, value)</code> to invoke for each property.
* <dl><dt>key</dt><dd>The name of the current property.</dd>
* <dt>value</dt><dd>The value of the current property.</dd>
* <dt class="this">this</dt><dd>The given context. If not set, the object itself.</dd>
* <dt class="returnValue">(callback return value)</dt><dd>This value will replace the original value in the new object.</dd></dl>
* @param ctx optional a context to pass to the callback as 'this'.
* @return the new object
*
* @see ##_.filterObj() filters an object.
* @see ##map() maps a list.
*/
'mapObj': function(obj, mapFunc, ctx) {
var result = {};
eachObj(obj, function(key, value) {
result[key] = mapFunc.call(ctx || obj, key, value);
});
return result;
},
/*$
* @id isobject
* @group TYPE