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 compoundIndexNoString(): CompoundIndexNoStringDocumentType {
return {
passportId: randomToken(12),
passportCountry: { [randomToken(12)]: randomToken(12) },
age: randomInt(10, 50)
};
}
export function human(
passportId: string = randomToken(12)
): HumanDocumentType {
return {
passportId: passportId,
firstName: faker.name.firstName(),
lastName: faker.name.lastName(),
age: randomInt(10, 50)
};
}
export function bigHumanDocumentType(): BigHumanDocumentType {
return {
passportId: randomToken(12),
dnaHash: randomToken(12),
firstName: faker.name.firstName(),
lastName: faker.name.lastName(),
age: randomInt(10, 50)
};
}
export function compoundIndex(): CompoundIndexDocumentType {
return {
passportId: randomToken(12),
passportCountry: randomToken(12),
age: randomInt(10, 50)
};
}
export function simpleHumanV3(): SimpleHumanV3DocumentType {
return {
passportId: randomToken(12),
age: randomInt(10, 50)
};
}
mouseDown = (e) => {
this.props.deselectItem()
const paper = e.tool._scope
const rectangle = new paper.Path.Rectangle({
center: e.point,
fillColor: randomColor(),
size: randomInt(20,120),
})
const item = this.props.addItem(rectangle.layer, {
type: 'Rectangle',
pathData: rectangle.getPathData(),
fillColor: rectangle.fillColor.toCSS(true),
})
console.log(rectangle)
console.log(rectangle.getPathData())
rectangle.remove()
this.props.selectItem(item)
}
for (const c in keyboard) {
if (!keyboard.hasOwnProperty(c) || c === ch) continue;
p = keyboard[c];
if (
Math.abs(charPosition.x - p.x) <= threshold &&
Math.abs(charPosition.y - p.y) <= threshold
) {
nearbyChars.push(c);
}
}
let randomChar =
nearbyChars.length > 0
? nearbyChars[randomInt(0, nearbyChars.length - 1)]
: this.randomChar(locale);
if (uppercase) {
randomChar = randomChar.toUpperCase();
}
return randomChar;
},
constructor(props) {
super(props)
this.state = {
imageLoaded: false,
loaded: false,
showLayers: true,
size: [randomInt(40,320),randomInt(40,320)],
open: false,
}
this._view = null
}
function draw () {
const blockCount = randomInt(10, 40)
const blockSize = width / blockCount
const cols = width / blockSize
const count = blockCount * (height + blockCount * 2)
const rows = Math.ceil(count / cols)
const half = blockSize / 2
ctx.beginPath()
ctx.translate(half, half)
for (let i = 0; i < (rows * cols); i++) {
const x = Math.floor(i % cols) * blockSize
const y = Math.floor(i / cols) * blockSize
let s = random(0.01, 0.05)
let n = simplex.noise3D(x * s, y * s, Date.now() / 1000)
if (x === 0) ctx.moveTo(x, y)
else ctx.lineTo(x, y)
ctx.lineTo(x, y + blockSize / 2 * n)
}
randomChar(locale) {
if (!this.supports(locale)) {
throw new Error(`locale "${locale}" is not supported`);
}
const chars = keyboards[locale].list.join("");
return chars.charAt(randomInt(0, chars.length - 1));
}
};