mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-22 17:38:10 +01:00
Qualify CJS-only module imports
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { ipcRenderer as ipc } from 'electron';
|
||||
import { groupBy, isTypedArray, last, map, omit } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import type { ReadonlyDeep } from 'type-fest';
|
||||
|
||||
@@ -69,6 +69,8 @@ import {
|
||||
updateBackupMediaDownloadProgress,
|
||||
} from '../util/updateBackupMediaDownloadProgress.js';
|
||||
|
||||
const { groupBy, isTypedArray, last, map, omit } = lodash;
|
||||
|
||||
const log = createLogger('Client');
|
||||
|
||||
const ERASE_SQL_KEY = 'erase-sql-key';
|
||||
|
||||
@@ -13,22 +13,7 @@ import type { ReadonlyDeep } from 'type-fest';
|
||||
import { z } from 'zod';
|
||||
|
||||
import type { Dictionary } from 'lodash';
|
||||
import {
|
||||
forEach,
|
||||
fromPairs,
|
||||
groupBy,
|
||||
isBoolean,
|
||||
isNil,
|
||||
isNumber,
|
||||
isString,
|
||||
last,
|
||||
map,
|
||||
mapValues,
|
||||
noop,
|
||||
omit,
|
||||
partition,
|
||||
pick,
|
||||
} from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import { parseBadgeCategory } from '../badges/BadgeCategory.js';
|
||||
import {
|
||||
@@ -277,6 +262,23 @@ import type {
|
||||
import { sqlLogger } from './sqlLogger.js';
|
||||
import { permissiveMessageAttachmentSchema } from './server/messageAttachments.js';
|
||||
|
||||
const {
|
||||
forEach,
|
||||
fromPairs,
|
||||
groupBy,
|
||||
isBoolean,
|
||||
isNil,
|
||||
isNumber,
|
||||
isString,
|
||||
last,
|
||||
map,
|
||||
mapValues,
|
||||
noop,
|
||||
omit,
|
||||
partition,
|
||||
pick,
|
||||
} = lodash;
|
||||
|
||||
type ConversationRow = Readonly<{
|
||||
json: string;
|
||||
profileLastFetchedAt: null | number;
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { isPlainObject } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { createLogger } from '../logging/log.js';
|
||||
|
||||
import { isIterable } from '../util/iterables.js';
|
||||
|
||||
const { isPlainObject } = lodash;
|
||||
|
||||
const log = createLogger('cleanDataForIpc');
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2025 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { groupBy } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import type { ReadStatus } from '../messages/MessageReadStatus.js';
|
||||
import type { SeenStatus } from '../MessageSeenStatus.js';
|
||||
import type { ServiceIdString } from '../types/ServiceId.js';
|
||||
@@ -34,6 +34,8 @@ import { strictAssert } from '../util/assert.js';
|
||||
import type { MessageAttributesType } from '../model-types.js';
|
||||
import { createLogger } from '../logging/log.js';
|
||||
|
||||
const { groupBy } = lodash;
|
||||
|
||||
export const ROOT_MESSAGE_ATTACHMENT_EDIT_HISTORY_INDEX = -1;
|
||||
|
||||
const log = createLogger('hydrateMessage');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { omit } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import type { LoggerType } from '../../types/Logging.js';
|
||||
import type { AciString, ServiceIdString } from '../../types/ServiceId.js';
|
||||
@@ -16,6 +16,8 @@ import {
|
||||
} from '../util.js';
|
||||
import type { WritableDB } from '../Interface.js';
|
||||
|
||||
const { omit } = lodash;
|
||||
|
||||
type MessageType = Readonly<{
|
||||
id: string;
|
||||
sourceUuid: string;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { Database } from '@signalapp/sqlcipher';
|
||||
import { omit } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import type { LoggerType } from '../../types/Logging.js';
|
||||
import type {
|
||||
@@ -15,6 +15,8 @@ import { normalizeAci } from '../../util/normalizeAci.js';
|
||||
import type { JSONWithUnknownFields } from '../../types/Util.js';
|
||||
import { isNotNil } from '../../util/isNotNil.js';
|
||||
|
||||
const { omit } = lodash;
|
||||
|
||||
//
|
||||
// Main migration function that does the following:
|
||||
//
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { callIdFromEra } from '@signalapp/ringrtc';
|
||||
import Long from 'long';
|
||||
import { v4 as generateUuid } from 'uuid';
|
||||
import { isObject } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import type { SetOptional } from 'type-fest';
|
||||
import type { LoggerType } from '../../types/Logging.js';
|
||||
@@ -29,6 +29,8 @@ import { missingCaseError } from '../../util/missingCaseError.js';
|
||||
import { isAciString } from '../../util/isAciString.js';
|
||||
import { safeParseStrict } from '../../util/schemas.js';
|
||||
|
||||
const { isObject } = lodash;
|
||||
|
||||
// Legacy type for calls that never had a call id
|
||||
type DirectCallHistoryDetailsType = {
|
||||
callId?: string;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { Database } from '@signalapp/sqlcipher';
|
||||
import { keyBy } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { v4 as generateUuid } from 'uuid';
|
||||
|
||||
import type { LoggerType } from '../../types/Logging.js';
|
||||
@@ -125,6 +125,8 @@ import updateToSchemaVersion1460 from './1460-attachment-duration.js';
|
||||
|
||||
import { DataWriter } from '../Server.js';
|
||||
|
||||
const { keyBy } = lodash;
|
||||
|
||||
function updateToSchemaVersion1(db: Database): void {
|
||||
db.exec(`
|
||||
CREATE TABLE messages(
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
/* eslint-disable max-classes-per-file */
|
||||
|
||||
import { isNumber, last } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
|
||||
import type { ReadableDB, WritableDB } from './Interface.js';
|
||||
import type { LoggerType } from '../types/Logging.js';
|
||||
|
||||
const { isNumber, last } = lodash;
|
||||
|
||||
export type JSONRow = Readonly<{ json: string }>;
|
||||
export type JSONRows = Array<JSONRow>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user