1
0
mirror of https://github.com/ascribe/onion.git synced 2025-02-14 21:10:27 +01:00

Correct misleading comments in utils

This commit is contained in:
Brett Sun 2015-10-22 11:12:41 +02:00
parent 0c51eb374e
commit de3c5bca14

View File

@ -131,7 +131,8 @@ export function mergeOptions(...l) {
} }
/** /**
* Merges a number of objects even if there're having duplicates. * Merges a number of objects even if there're having duplicates,
* taking the last given value for the key.
* *
* DOES NOT RETURN AN ERROR! * DOES NOT RETURN AN ERROR!
* *
@ -141,8 +142,6 @@ export function mergeOptions(...l) {
* @return {[type]} [description] * @return {[type]} [description]
*/ */
export function mergeOptionsWithDuplicates(...l) { export function mergeOptionsWithDuplicates(...l) {
// If the objects submitted in the list have duplicates,in their key names,
// abort the merge and tell the function's user to check his objects.
let newObj = {}; let newObj = {};
for(let i = 1; i < l.length; i++) { for(let i = 1; i < l.length; i++) {
@ -174,7 +173,7 @@ export function update(a, ...l) {
*/ */
function _mergeOptions(obj1, obj2) { function _mergeOptions(obj1, obj2) {
let obj3 = {}; let obj3 = {};
for (let attrname in obj1) { for (let attrname in obj1) {
obj3[attrname] = obj1[attrname]; obj3[attrname] = obj1[attrname];
} }
@ -232,4 +231,4 @@ export function getSubdomain() {
let { host } = window.location; let { host } = window.location;
let tokens = host.split('.'); let tokens = host.split('.');
return tokens.length > 2 ? tokens[0] : 'www'; return tokens.length > 2 ? tokens[0] : 'www';
} }