@samitouri / QOS-React-2 / commits / f10f32aaaf

Remove objMapKeyVal

Christoph Pojer committed Mar 25, 2014 at 12:30 UTC f10f32aaafc29992bc250ba001b4ac0b54a38f01
3 files changed +5 -52
src/browser/ReactDOM.js
+3 -3
@@ -22,7 +22,7 @@
22 var ReactDOMComponent = require('ReactDOMComponent');
23
24 var mergeInto = require('mergeInto');
25 -var objMapKeyVal = require('objMapKeyVal');
25 +var mapObject = require('mapObject');
26
27 /**
28 * Creates a new React class that is idempotent and capable of containing other
@@ -39,7 +39,7 @@ var objMapKeyVal = require('objMapKeyVal');
39 * @param {boolean} omitClose True if the close tag should be omitted.
40 * @private
41 */
42 -function createDOMComponentClass(tag, omitClose) {
42 +function createDOMComponentClass(omitClose, tag) {
43 var Constructor = function() {};
44 Constructor.prototype = new ReactDOMComponent(tag, omitClose);
45 Constructor.prototype.constructor = Constructor;
@@ -68,7 +68,7 @@ function createDOMComponentClass(tag, omitClose) {
68 *
69 * @public
70 */
71 -var ReactDOM = objMapKeyVal({
71 +var ReactDOM = mapObject({
72 a: false,
73 abbr: false,
74 address: false,
src/core/__tests__/ReactMultiChildReconcile-test.js
+2 -2
@@ -25,7 +25,7 @@ var React = require('React');
25 var ReactTestUtils = require('ReactTestUtils');
26 var ReactMount = require('ReactMount');
27
28 -var objMapKeyVal = require('objMapKeyVal');
28 +var mapObject = require('mapObject');
29
30 var stripEmptyValues = function(obj) {
31 var ret = {};
@@ -126,7 +126,7 @@ var FriendsStatusDisplay = React.createClass({
126
127
128 function getInteralStateByUserName(statusDisplays) {
129 - return objMapKeyVal(statusDisplays, function(key, statusDisplay) {
129 + return mapObject(statusDisplays, function(statusDisplay, key) {
130 return statusDisplay.getInternalState();
131 });
132 }
src/utils/objMapKeyVal.js deleted
-47
@@ -1,47 +0,0 @@
1 -/**
2 - * Copyright 2013-2014 Facebook, Inc.
3 - *
4 - * Licensed under the Apache License, Version 2.0 (the "License");
5 - * you may not use this file except in compliance with the License.
6 - * You may obtain a copy of the License at
7 - *
8 - * http://www.apache.org/licenses/LICENSE-2.0
9 - *
10 - * Unless required by applicable law or agreed to in writing, software
11 - * distributed under the License is distributed on an "AS IS" BASIS,
12 - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 - * See the License for the specific language governing permissions and
14 - * limitations under the License.
15 - *
16 - * @providesModule objMapKeyVal
17 - */
18 -
19 -"use strict";
20 -
21 -/**
22 - * Behaves the same as `objMap` but invokes func with the key first, and value
23 - * second. Use `objMap` unless you need this special case.
24 - * Invokes func as:
25 - *
26 - * func(key, value, iteration)
27 - *
28 - * @param {?object} obj Object to map keys over
29 - * @param {!function} func Invoked for each key/val pair.
30 - * @param {?*} context
31 - * @return {?object} Result of mapping or null if obj is falsey
32 - */
33 -function objMapKeyVal(obj, func, context) {
34 - if (!obj) {
35 - return null;
36 - }
37 - var i = 0;
38 - var ret = {};
39 - for (var key in obj) {
40 - if (obj.hasOwnProperty(key)) {
41 - ret[key] = func.call(context, key, obj[key], i++);
42 - }
43 - }
44 - return ret;
45 -}
46 -
47 -module.exports = objMapKeyVal;