Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createRandomItem(docRefType) {
return {
uuid: guid(),
type: docRefType,
name: loremIpsum(LOREM_CONFIG),
};
}
import loremIpsum from 'lorem-ipsum';
const getRandomInt = (min, max) => Math.floor(Math.random() * (max - min)) + min;
const LOREM_CONFIG = { count: 3, units: 'words' };
const minimalTracker_undefinedLastPollAge = {
filterId: 1,
enabled: true,
lastPollAge: undefined,
pipelineName: loremIpsum(LOREM_CONFIG),
priority: getRandomInt(1, 99),
filter: '',
createUser: 'tester',
createdOn: 87134234234,
};
const minimalTracker_nullLastPollAge = {
filterId: 2,
enabled: true,
lastPollAge: null,
pipelineName: loremIpsum(LOREM_CONFIG),
priority: getRandomInt(1, 99),
filter: '',
createUser: 'tester',
createdOn: 87134234234,
};
const createLoremPropertyRecord = (column: ColumnDescription) => {
const lorem = new LoremIpsum();
const value = lorem.generateWords(5);
const v: PropertyValue = {
valueFormat: PropertyValueFormat.Primitive,
value,
displayValue: value,
};
const pd: PropertyDescription = {
typename: "text",
name: column.key,
displayLabel: column.label,
};
column.propertyDescription = pd;
return new PropertyRecord(v, pd);
};
}
function randomBoolean () {
return Math.random() > 0.5;
}
function randomString () {
return randomkey([10, 20]);
}
Autocreate.add({
text: { type: String, index: true, default: randomString },
number: { type: Number, index: true, default: randomNumber },
boolean: { type: Boolean, index: true, default: randomBoolean },
datetime: { type: Date, index: true, default: Date.now },
html: { type: String, default: lipsum.bind(null, { count: 2, units: 'paragraphs' }) },
markdown: { type: String, index: true, default: lipsum },
});
transform.toJSON(Autocreate);
Autocreate.defaultColumns = 'text, number, boolean, datetime';
Autocreate.register();
onLoad: () => {
console.log('Photo loaded');
},
status: status,
date: +new Date(),
avatar: `data:image/png;base64,${this.photo()}`,
};
case 'chat':
return {
id: String(Math.random()),
avatar: `data:image/png;base64,${this.photo()}`,
avatarFlexible: true,
statusColor: 'lightgreen',
statusColorType: parseInt(Math.random() * 100 % 2) === 1 ? 'encircle' : undefined,
alt: loremIpsum({ count: 2, units: 'words' }),
title: loremIpsum({ count: 2, units: 'words' }),
date: new Date(),
subtitle: loremIpsum({ count: 1, units: 'sentences' }),
unread: parseInt(Math.random() * 10 % 3),
dropdownMenu: (
,
size: 24,
}
}}
items={[
export const generatePinDetails = (pin: IMapPin): IMapPinDetail => {
const randomDate = new Date()
randomDate.setSeconds(randomDate.getSeconds() - Math.random() * 10000)
const lastActive = randomDate.toISOString()
return {
name: loremIpsum({ count: 2, units: 'words' })
.split(' ')
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
.join(' '),
shortDescription: loremIpsum({ count: 2, units: 'sentences' }),
lastActive,
profilePicUrl: 'https://picsum.photos/50/50',
profileUrl: '/testing',
heroImageUrl: `https://picsum.photos/seed/${lastActive}/285/175`,
}
}
export const generatePinDetails = (pin: IMapPin): IMapPinDetail => {
const randomDate = new Date()
randomDate.setSeconds(randomDate.getSeconds() - Math.random() * 10000)
const lastActive = randomDate.toISOString()
return {
name: loremIpsum({ count: 2, units: 'words' })
.split(' ')
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
.join(' '),
shortDescription: loremIpsum({ count: 2, units: 'sentences' }),
lastActive,
profilePicUrl: 'https://picsum.photos/50/50',
profileUrl: '/testing',
heroImageUrl: `https://picsum.photos/seed/${lastActive}/285/175`,
}
}
import React, { useState, useEffect } from 'react'
import { EditorState } from '@zettel/core'
import Editor from '@zettel/react'
const { LoremIpsum } = require("lorem-ipsum")
const lorem = new LoremIpsum({
sentencesPerParagraph: {
max: 4,
min: 2
},
wordsPerSentence: {
max: 10,
min: 4
}
});
const text = `[${lorem.generateParagraphs(3000).split('\n').join('][')}]`
const App = () => {
const [editorState, setEditorState] = useState(() => EditorState.fromJSON({
text,
ranges: [],
function homePageView() {
return div([
h1('Welcome to History Examples!'),
p(placeholderText())
])
}
_reload(numItems) {
const tableData = [];
for (var i = 0; i < numItems; i++) {
tableData.push({
id: i,
name: {
first: loremIpsum({ count: 1, units: "words" }),
last: loremIpsum({ count: 2, units: "words" }),
},
age: Math.round(Math.random() * 100),
status: loremIpsum({ count: 1, units: "words" }),
notes: loremIpsum({ count: 2, units: "sentences" }),
});
}
this.setState({ tableData });
if (this._lazyTable) {
this._lazyTable.lazyReset();
}
}