mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 11:22:15 +00:00
feat(core): Use WebCrypto to generate all random numbers and strings (#9786)
This commit is contained in:
committed by
GitHub
parent
cfc4db00e3
commit
65c5609ab5
@@ -1,9 +1,11 @@
|
||||
import deepEqual from 'deep-equal';
|
||||
import uniqWith from 'lodash/uniqWith';
|
||||
|
||||
import { ExpressionError } from '../errors/expression.error';
|
||||
import { ExpressionExtensionError } from '../errors/expression-extension.error';
|
||||
import type { Extension, ExtensionMap } from './Extensions';
|
||||
import { compact as oCompact } from './ObjectExtensions';
|
||||
import deepEqual from 'deep-equal';
|
||||
import uniqWith from 'lodash/uniqWith';
|
||||
import { randomInt } from '../utils';
|
||||
|
||||
function first(value: unknown[]): unknown {
|
||||
return value[0];
|
||||
@@ -49,7 +51,7 @@ function pluck(value: unknown[], extraArgs: unknown[]): unknown[] {
|
||||
|
||||
function randomItem(value: unknown[]): unknown {
|
||||
const len = value === undefined ? 0 : value.length;
|
||||
return len ? value[Math.floor(Math.random() * len)] : undefined;
|
||||
return len ? value[randomInt(len)] : undefined;
|
||||
}
|
||||
|
||||
function unique(value: unknown[], extraArgs: string[]): unknown[] {
|
||||
|
||||
Reference in New Issue
Block a user