Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimize Lodash Footprint #210

Merged
merged 1 commit into from
Jul 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SlatePlugin } from '@udecode/slate-plugins-core';
import { castArray } from 'lodash';
import castArray from 'lodash/castArray';
import { Editor } from 'slate';

export interface WithInlineVoidOptions {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { castArray } from 'lodash';
import castArray from 'lodash/castArray';
import { Editor } from 'slate';
import { EditorNodesOptions } from '../types/Editor.types';
import { getNodes } from './getNodes';
Expand Down
3 changes: 2 additions & 1 deletion packages/slate-plugins/src/common/queries/getPointBefore.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable no-constant-condition */
import { castArray, map } from 'lodash';
import castArray from 'lodash/castArray';
import map from 'lodash/map';
import { Editor, Location, Path, Point } from 'slate';

export interface BeforeOptions {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { merge } from 'lodash';
import merge from 'lodash/merge';
import { Descendant, Node, NodeEntry } from 'slate';
import { isAncestor, isNodeType } from '../queries';
import { QueryOptions } from '../types/QueryOptions.types';
Expand Down
2 changes: 1 addition & 1 deletion packages/slate-plugins/src/common/transforms/toggleMark.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { castArray } from 'lodash';
import castArray from 'lodash/castArray';
import { Editor } from 'slate';
import { isMarkActive } from '../queries/isMarkActive';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { castArray } from 'lodash';
import castArray from 'lodash/castArray';
import { Editor, Transforms } from 'slate';
import { WrapOptions } from '../types/Transforms.types';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DeserializeNode } from '@udecode/slate-plugins-core';
import { castArray } from 'lodash';
import castArray from 'lodash/castArray';

export interface GetNodeDeserializerRule {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { pickBy } from 'lodash';
import pickBy from 'lodash/pickBy';
import { RenderElementProps } from 'slate-react';
import { RenderNodeOptions } from '../types/PluginOptions.types';

Expand Down
2 changes: 1 addition & 1 deletion packages/slate-plugins/src/common/utils/getRenderLeaf.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { pickBy } from 'lodash';
import pickBy from 'lodash/pickBy';
import { RenderLeafProps } from 'slate-react';
import { RenderNodeOptions } from '../types/PluginOptions.types';

Expand Down
2 changes: 1 addition & 1 deletion packages/slate-plugins/src/common/utils/setDefaults.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defaultsDeep } from 'lodash';
import defaultsDeep from 'lodash/defaultsDeep';

/**
* Deep merge the default object properties that are not defined in the destination object.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { castArray } from 'lodash';
import castArray from 'lodash/castArray';
import { Editor, Range } from 'slate';
import { getRangeFromBlockStart } from '../../common/queries';
import { getText } from '../../common/queries/getText';
Expand Down