Module: testUtil/plainObjectToTarget
Functions
plainObjectToTarget
▸ plainObjectToTarget(editor, plainObject): Target
Given a plain object describing a target, constructs a Target object.
Note that the target object today doesn't include a reference to an editor,
because all of our recorded tests are on single editors, so we just construct
a target where the ranges refer to {@link editor}.
Note that this function is just a partial implementation today, throwing an
exception if we try to rehydrate anything other than an UntypedTarget.
Parameters
| Name | Type | Description |
|---|---|---|
editor | TextEditor | The editor where the target ranges are defined |
plainObject | TargetPlainObject | A plain object describing a Target |
Returns
A Target constructed from the given plain object