Skip to content

Missing doc about Arrays #2

@muescha

Description

@muescha

Subject of the issue

i have some diffs, where i get an array for inserted nodes as an array.

Why this his happening?

Your environment

macOS 10.15.3
unist-diff
node v12.13.1
npm 6.14.5

Steps to reproduce

i see it also in the example

Expected behaviour

nodes should have index keys in order like the removed, so

{ '1': { type: 'insert',
       left: null,
       right:
        { type: 'element',
          tagName: 'strong',
          properties: {},
          children: [ { type: 'text', value: 'importance' } ] } },

  '3':
   { type: 'remove',
     left:
      { type: 'element',
        tagName: 'b',
        properties: {},
        children: [ { type: 'text', value: 'importance' } ] },
     right: null },

  '5': { type: 'insert',
       left: null,
       right:
        { type: 'element',
          tagName: 'em',
          properties: {},
          children: [ { type: 'text', value: 'emphasis' } ] } } ],

  '6':
   { type: 'remove',
     left:
      { type: 'element',
        tagName: 'i',
        properties: {},
        children: [ { type: 'text', value: 'emphasis' } ] },
     right: null },

Actual behaviour

somehow other sorted

Documentation

it was not documented in the README in the return types

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions