Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | 20x 20x 20x 1601x 1601x 1601x 1601x 11x 1590x 66x 66x 211x 211x 211x 211x 66x | /**
* Copyright (c) Nicolas Gallagher.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
import ReactNativePropRegistry from './ReactNativePropRegistry';
import flattenStyle from './flattenStyle';
import validate from './validate';
const absoluteFillObject = {
position: 'absolute',
left: 0,
right: 0,
top: 0,
bottom: 0
};
const absoluteFill: number = ReactNativePropRegistry.register(absoluteFillObject);
const StyleSheet = {
absoluteFill,
absoluteFillObject,
compose(style1: any, style2: any): any {
Eif (process.env.NODE_ENV !== 'production') {
/* eslint-disable prefer-rest-params */
const len = arguments.length;
Iif (len > 2) {
const readableStyles = [...arguments].map((a) => flattenStyle(a));
throw new Error(
`StyleSheet.compose() only accepts 2 arguments, received ${len}: ${JSON.stringify(
readableStyles
)}`
);
}
/* eslint-enable prefer-rest-params */
}
if (style1 && style2) {
return [style1, style2];
} else {
return style1 || style2;
}
},
create(styles: Object): {| [key: string]: number |} {
const result = {};
Object.keys(styles).forEach((key) => {
Eif (process.env.NODE_ENV !== 'production') {
validate(key, styles);
}
const id = styles[key] && ReactNativePropRegistry.register(styles[key]);
result[key] = id;
});
return result;
},
flatten: flattenStyle,
// `hairlineWidth` is not implemented using screen density as browsers may
// round sub-pixel values down to `0`, causing the line not to be rendered.
hairlineWidth: 1
};
export default StyleSheet;
|