Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function getASketchPage() {
const stylesheet = document.querySelector('head > link');
let styleGuideVersion = '';
if (stylesheet) {
styleGuideVersion = stylesheet.href.match(/\/([0-9]+\.[0-9]+\.[0-9]+)\//)[1];
}
const page = new Page({
width: document.body.offsetWidth,
// eslint-disable-next-line comma-dangle
height: document.body.offsetHeight
});
page.setName(`Brainly Pencil - Style Guide ${styleGuideVersion}`);
const icons = [];
const maskColors = [];
// SYMBOLS
Array.from(document.querySelectorAll('section > .item, section > .inline-item'))
.map(metaNode => {
const symbolNode = metaNode.firstChild;
const name = metaNode.title;
export const getPage = ({ title, width, height }) => {
const page = new Page({
width,
height
});
page.setName(title);
return page.toJSON();
};
(resolve: (result: string) => void, reject: (error: Error) => void): void => {
const sketchPage: SketchPage = new SketchPage({
width: config.pageWidth,
height: config.pageHeight,
});
sketchPage.setName(config.name);
const flattenedLayers: string[] = symbols.reduce(
(accumulator: string[], currentValue: string[]) => {
return accumulator.concat(currentValue);
},
[]
);
const sketchPageJson: any = sketchPage.toJSON();
sketchPageJson.layers = flattenedLayers;