Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
do_objectID: generateID(),
frame,
isLocked: false,
isVisible: true,
name: 'ShapeGroup',
nameIsFixed: false,
resizingConstraint: makeResizeConstraint(resizingConstraint),
resizingType: FileFormat.ResizeType.Stretch,
rotation: 0,
shouldBreakMaskChain: false,
style: makeStyle(style, fills, shadows),
hasClickThrough: false,
layers,
clippingMaskMode: 0,
hasClippingMask: false,
windingRule: FileFormat.WindingRule.EvenOdd,
isFixedToViewport: false,
exportOptions: {
_class: 'exportOptions',
exportFormats: [],
includedLayerIds: [],
layerOptions: 0,
shouldTrim: false,
},
isFlippedHorizontal: false,
isFlippedVertical: false,
booleanOperation: FileFormat.BooleanOperation.NA,
layerListExpandedType: FileFormat.LayerListExpanded.Undecided,
});
export const makeStyle = (
style?: ViewStyle | TextStyle,
fills?: FileFormat.Fill[],
shadowsProp?: ViewStyle[],
): FileFormat.Style => {
const json: FileFormat.Style = {
_class: 'style',
fills: [],
miterLimit: 10,
innerShadows: [],
shadows: [],
borderOptions: makeBorderOptions('solid', 0, 0, 0),
startMarkerType: FileFormat.MarkerType.OpenArrow,
endMarkerType: FileFormat.MarkerType.OpenArrow,
windingRule: FileFormat.WindingRule.EvenOdd,
colorControls: {
_class: 'colorControls',
isEnabled: false,
brightness: 1,
contrast: 1,
hue: 1,
saturation: 1,
},
};
if (fills && fills.length) {
json.fills = json.fills.concat(fills);
}
if (!style) {
return json;