Skip to content

Commit f7acb07

Browse files
committed
Fixed issue on type.Delete.encode and added version to the bundle
1 parent a84c0ff commit f7acb07

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dop",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"main": "dist/dop.js",
55
"browser": "dist/dop.umd.js",
66
"license": "MIT",
@@ -33,6 +33,7 @@
3333
"dependencies": {},
3434
"devDependencies": {
3535
"@rollup/plugin-buble": "^0.20.0",
36+
"@rollup/plugin-json": "^4.0.1",
3637
"ava": "^2.4.0",
3738
"ejson": "^2.2.0",
3839
"esm": "^3.2.25",

rollup.config.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import pkg from './package.json'
22
import minify from 'rollup-plugin-babel-minify'
33
import buble from '@rollup/plugin-buble'
4+
import json from '@rollup/plugin-json'
45

56
export default [
67
// dop.js
@@ -11,17 +12,13 @@ export default [
1112
{ file: pkg.main, format: 'cjs' }
1213
// { file: pkg.module, format: 'es' }
1314
],
14-
plugins: [buble()]
15+
plugins: [json(), buble()]
1516
},
1617

1718
// dop.umd.js
1819
{
1920
input: 'src/index',
20-
output: {
21-
name: 'dop',
22-
file: pkg.browser,
23-
format: 'umd'
24-
},
25-
plugins: [buble(), minify({ comments: false })]
21+
output: { name: 'dop', file: pkg.browser, format: 'umd' },
22+
plugins: [json(), buble(), minify({ comments: false })]
2623
}
2724
]

src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { version } from '../package.json'
12
import merge from './util/merge'
23
import converter from './util/converter'
34
import { isFunction } from './util/is'
@@ -26,6 +27,7 @@ function factory() {
2627
const createNode = createNodeFactory({ encoders, decoders })
2728

2829
return {
30+
version,
2931
factory,
3032
merge,
3133
encode,

src/types/Delete.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Delete.patch = function({ origin, destiny, prop, oldValue, had_prop }) {
1919
}
2020

2121
Delete.encode = function({ value }) {
22-
if (value instanceof Delete) {
22+
if (value instanceof Delete || value === Delete) {
2323
return { [DELETE_KEY]: 0 } // we don't go deeper
2424
} else if (isValidToDecode({ value })) {
2525
return { [ESCAPE_KEY]: value } // we don't go deeper

test/api.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import dop from '../'
33
import { createNode } from '../'
44

55
const exported = [
6+
'version',
67
'factory',
78
'merge',
89
'encode',

0 commit comments

Comments
 (0)