You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-06 23:56:13 +02:00
Chore: Removed lodash package to save space
This commit is contained in:
@ -7,15 +7,13 @@ import time from '../time';
|
||||
import markdownUtils from '../markdownUtils';
|
||||
import { NoteEntity } from '../services/database/types';
|
||||
import Tag from './Tag';
|
||||
|
||||
const { sprintf } = require('sprintf-js');
|
||||
import Resource from './Resource';
|
||||
import syncDebugLog from '../services/synchronizer/syncDebugLog';
|
||||
import { toFileProtocolPath, toForwardSlashes } from '../path-utils';
|
||||
const { pregQuote, substrWithEllipsis } = require('../string-utils.js');
|
||||
const { _ } = require('../locale');
|
||||
const ArrayUtils = require('../ArrayUtils.js');
|
||||
const lodash = require('lodash');
|
||||
import { pull, unique } from '../ArrayUtils';
|
||||
const urlUtils = require('../urlUtils.js');
|
||||
const { isImageMimeType } = require('../resourceUtils');
|
||||
const { MarkupToHtml } = require('@joplin/renderer');
|
||||
@ -59,7 +57,7 @@ export default class Note extends BaseItem {
|
||||
static async serializeAllProps(note: NoteEntity) {
|
||||
const fieldNames = this.fieldNames();
|
||||
fieldNames.push('type_');
|
||||
lodash.pull(fieldNames, 'title', 'body');
|
||||
pull(fieldNames, 'title', 'body');
|
||||
return super.serialize(note, fieldNames);
|
||||
}
|
||||
|
||||
@ -68,25 +66,25 @@ export default class Note extends BaseItem {
|
||||
|
||||
const fieldNames = this.fieldNames();
|
||||
|
||||
if (!n.is_conflict) lodash.pull(fieldNames, 'is_conflict');
|
||||
if (!Number(n.latitude)) lodash.pull(fieldNames, 'latitude');
|
||||
if (!Number(n.longitude)) lodash.pull(fieldNames, 'longitude');
|
||||
if (!Number(n.altitude)) lodash.pull(fieldNames, 'altitude');
|
||||
if (!n.author) lodash.pull(fieldNames, 'author');
|
||||
if (!n.source_url) lodash.pull(fieldNames, 'source_url');
|
||||
if (!n.is_conflict) pull(fieldNames, 'is_conflict');
|
||||
if (!Number(n.latitude)) pull(fieldNames, 'latitude');
|
||||
if (!Number(n.longitude)) pull(fieldNames, 'longitude');
|
||||
if (!Number(n.altitude)) pull(fieldNames, 'altitude');
|
||||
if (!n.author) pull(fieldNames, 'author');
|
||||
if (!n.source_url) pull(fieldNames, 'source_url');
|
||||
if (!n.is_todo) {
|
||||
lodash.pull(fieldNames, 'is_todo');
|
||||
lodash.pull(fieldNames, 'todo_due');
|
||||
lodash.pull(fieldNames, 'todo_completed');
|
||||
pull(fieldNames, 'is_todo');
|
||||
pull(fieldNames, 'todo_due');
|
||||
pull(fieldNames, 'todo_completed');
|
||||
}
|
||||
if (!n.application_data) lodash.pull(fieldNames, 'application_data');
|
||||
if (!n.application_data) pull(fieldNames, 'application_data');
|
||||
|
||||
lodash.pull(fieldNames, 'type_');
|
||||
lodash.pull(fieldNames, 'title');
|
||||
lodash.pull(fieldNames, 'body');
|
||||
lodash.pull(fieldNames, 'created_time');
|
||||
lodash.pull(fieldNames, 'updated_time');
|
||||
lodash.pull(fieldNames, 'order');
|
||||
pull(fieldNames, 'type_');
|
||||
pull(fieldNames, 'title');
|
||||
pull(fieldNames, 'body');
|
||||
pull(fieldNames, 'created_time');
|
||||
pull(fieldNames, 'updated_time');
|
||||
pull(fieldNames, 'order');
|
||||
|
||||
return super.serialize(n, fieldNames);
|
||||
}
|
||||
@ -118,7 +116,7 @@ export default class Note extends BaseItem {
|
||||
|
||||
const links = urlUtils.extractResourceUrls(body);
|
||||
const itemIds = links.map((l: any) => l.itemId);
|
||||
return ArrayUtils.unique(itemIds);
|
||||
return unique(itemIds);
|
||||
}
|
||||
|
||||
static async linkedItems(body: string) {
|
||||
|
Reference in New Issue
Block a user