export function parseSelector(selector) { if (isNull(selector)) return new Set(); if (!isString(selector)) throw new Error(`Failed to execute 'parseSelector': Parameter 1 is not a string.`); if (!selector.match(/^(:[a-z]+([A-Z][a-z]+)*)+$/)) throw new Error(`Failed to execute 'parseSelector': '${selector}' is not a valid selector.`); return new Set(selector.match(/[a-zA-Z]+/g)); }
if (!isNull(child.style.$.zIndex)) { subContexts.push(child); } else if (child.style.$.position.isAbsolutelyPositioned) {
describe('Test the exercise function', () => { it('should generate 10 integers', () => { expect(s.exercise(isInteger)).to.have.length(10); }); it('should generate 10 booleans', () => { expect(s.exercise(isBoolean)).to.have.length(10).to.satisfy(sample => every(sample, ([b]) => isBoolean(b))); }); it('should generate 5 random values from a set', () => { s.def('::color', ['Red', 'Blue', 'Dun']); expect(s.exercise('::color', 5)).to.have.length(5); }); it('should generate 7 random values from a named spec', () => { s.def('::pairs', s.cat(':n', isInteger, ':s', isString)); expect(s.exercise('::pairs', 7)).to.have.length(7).to.satisfy(sample => every(sample, ([[n, s]]) => isInteger(n) && isString(s))); }); it('should generate 10 random values from a spec object', () => { expect(s.exercise(s.nilable(isString))).to.have.length(10).to.satisfy(sample => every(sample, ([s]) => isNull(s) || isString(s))); }); it('should throw an exception', () => { s.def('::impossible', s.and(isInteger, isString)); expect(() => s.exercise('::impossible')).to.throw(Error, /sampleFromSpec failed.*/); }); });
case 'biginteger': case 'decimal': return !isNull(value) ? toString(value) : '-'; case 'boolean': return value !== null ? toString(value) : '-';
const entryLink = (isNull(value) || isUndefined(value) || excludeModel ? '' : onSelectResetsInput={false} simpleValue value={isNull(value) || isUndefined(value) ? null : { value: isFunction(value.toJS) ? value.toJS() : value, label: templateObject({ mainField: this.props.relation.displayedAttribute }, isFunction(value.toJS) ? value.toJS() : value).mainField || (isFunction(value.toJS) ? get(value.toJS(), 'id') : get(value, 'id')),
return isNull(value) || isString(value);
/** * Converts value to hex representation * * @public * @static * @method numberToHex * @param {String|Number|BN} value * @returns {String} */ const numberToHex = value => { if (isNull(value) || typeof value === 'undefined') { return value; } // eslint-disable-next-line no-restricted-globals if (!isFinite(value) && !isHex(value)) { throw new Error(`Given input "${value}" is not a number.`); } const number = toBN(value); const result = number.toString(16); return number.lt(new BN(0)) ? `-0x${result.substr(1)}` : `0x${result}`; }
if (validationValue === 'json') { try { if (isObject(value) || isBoolean(value) || isNumber(value) || isArray(value) || isNaN(value) || isNull(value)) { value = JSON.parse(JSON.stringify(value)); } else {
.to.satisfy(sample => _.every(sample, ([v]) => isNull(v) || isString(v))); });
if (!isNull(name) && isUndefined(this.grammar.registry.get(name))) throw new Error(`Failed to execute 'grammar.use': '${name}' is not a valid grammar name.`); if (!isNull(name)) this.grammar.active = this.grammar.registry.get(name); else if (!isNull(name) && isUndefined(this.theme.registry.get(name))) throw new Error(`Failed to execute 'theme.use': '${name}' is not a valid theme name.`); if (!isNull(name)) this.theme.active = this.theme.registry.get(name); else let props = isNull(this.theme.active) ? {} : merge({}, ... this.theme.active.settings.filter(({ scope }) => { return isNil(scope) || scopes.some(other => scope === other || other.startsWith(`${scope}.`)); }).map(({ settings }) => {
<SortableList items={ isNull(value) || isUndefined(value) || value.size === 0 ? null : value.map(item => {
isFunction(mapProps) || isNull(mapProps), 'Expected mapProps to be a function, undefined or null.', );