Skip to content

Commit 19b9041

Browse files
Merge pull request #333 from ilovepixelart/feature/esm
ESM
2 parents eafbbf7 + 39e96d7 commit 19b9041

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

src/hooks/delete-hooks.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import isArray from 'lodash/isArray'
2-
import isEmpty from 'lodash/isEmpty'
1+
// Using CJS lodash with .js extensions for ESM compatibility
2+
import isArray from 'lodash/isArray.js'
3+
import isEmpty from 'lodash/isEmpty.js'
34
import { isHookIgnored } from '../helpers'
45
import { deletePatch } from '../patch'
56

src/hooks/update-hooks.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import cloneDeep from 'lodash/cloneDeep'
2-
import forEach from 'lodash/forEach'
3-
import isArray from 'lodash/isArray'
4-
import isEmpty from 'lodash/isEmpty'
5-
import isObjectLike from 'lodash/isObjectLike'
6-
import keys from 'lodash/keys'
1+
// Using CJS lodash with .js extensions for ESM compatibility
2+
import cloneDeep from 'lodash/cloneDeep.js'
3+
import forEach from 'lodash/forEach.js'
4+
import isArray from 'lodash/isArray.js'
5+
import isEmpty from 'lodash/isEmpty.js'
6+
import isObjectLike from 'lodash/isObjectLike.js'
7+
import keys from 'lodash/keys.js'
78
import { assign } from 'power-assign'
89
import { isHookIgnored, toObjectOptions } from '../helpers'
910
import { createPatch, updatePatch } from '../patch'

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import isEmpty from 'lodash/isEmpty'
1+
// Using CJS lodash with .js extension for ESM compatibility
2+
import isEmpty from 'lodash/isEmpty.js'
23
import { toObjectOptions } from './helpers'
34
import { deleteHooksInitialize } from './hooks/delete-hooks'
45
import { saveHooksInitialize } from './hooks/save-hooks'

src/patch.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import jsonpatch from 'fast-json-patch'
2-
import chunk from 'lodash/chunk'
3-
import isEmpty from 'lodash/isEmpty'
4-
import isFunction from 'lodash/isFunction'
2+
// Using CJS lodash with .js extensions for ESM compatibility
3+
import chunk from 'lodash/chunk.js'
4+
import isEmpty from 'lodash/isEmpty.js'
5+
import isFunction from 'lodash/isFunction.js'
56
import omit from 'omit-deep'
67
import em from './em'
78
import { HistoryModel } from './model'

0 commit comments

Comments
 (0)