示例#1
0
function removeDuplicateWpcomRecords( domain, records ) {
	const rootARecords = filter( records, isRootARecord( domain ) ),
		wpcomRecord = find( rootARecords, isWpcomRecord ),
		customRecord = find( rootARecords, negate( isWpcomRecord ) );

	if ( wpcomRecord && customRecord ) {
		return without( records, wpcomRecord );
	}

	return records;
}
示例#2
0
		const dropMatches = records => filter( records,
			negate( matchesProperty( 'key', key ) )
		);
示例#3
0
    }),

    ...( className && { 
      className : (elementKeys.length === 0 ?
        [ className, ...toModifierClassNames(modifierKeys) ] :
        toElementClassNames(elementKeys)
      ).join(' ')
    })

  }

}

const isModifier = key => key[0] === '&'
const isPseudoOrMedia = key => key[0] === ':' || key[0] === '@'
const isElement = negate(isModifier)

const pickNestedStyles = (style, keysToPick) => {
  const camelizedKeysToPick = map(camelize, keysToPick)
  const styleKeys = keys(style)
  const result = {}
  for(let i=0, l=styleKeys.length; i<l; ++i) {
    const key = styleKeys[i]
    if(keysToPick.indexOf(key) >= 0 || camelizedKeysToPick.indexOf(camelize(key)) >= 0) {
      result[key] = style[key]
    }
  }
  return result
}

const camelize = key => key.replace(/-(\w)/g, (m, c) => c.toUpperCase())
示例#4
0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import _ from 'lodash';

import negate from 'lodash/negate';
import isNil from 'lodash/isNil';
import isEmpty from 'lodash/isEmpty';
import mixin from 'lodash/mixin';

const nonNil = negate(isNil);
const nonEmpty = negate(isEmpty);

mixin({
    nonNil,
    nonEmpty
});

export class EmptyBean {
    /**
     * @param {String} clsName
     */
    constructor(clsName) {
        this.properties = [];
        this.arguments = [];
import isString from 'lodash/isString'
import join from 'lodash/join'
import map from 'lodash/map'
import negate from 'lodash/negate'
import omit from 'lodash/omit'
import pick from 'lodash/pick'
import without from 'lodash/without'
import {isWrapDate} from './is-wrap-date'
import {getEmptyModuleMessage} from './get-empty-module-message'
import {createTask} from './queue-hard-lift'
import orderBy from 'lodash/orderBy'
import {prettyNumber} from './pretty-number'
import set from 'lodash/set'

const isEntityId = d => d === 'id' || d === 'name'
const notEntityId = negate(isEntityId)
const cropped = comment => size(comment) > 100
  ? comment.substr(0, 100) + '...'
  : comment

const mockEntity = {name: '---'}
const types = {
  linear: {
    type: 'linear'
  },
  datetime: {
    type: 'datetime',
    headerFormat: '%a %d, %B, %Y',
    sortable: true
  },
  time: {