Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

23 строки
678 B

  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @format
  8. * @flow
  9. * @emails oncall+draft_js
  10. */
  11. 'use strict';
  12. import type DraftEntityInstance from "./DraftEntityInstance";
  13. import type { OrderedMap } from "immutable"; // TODO: when removing the deprecated API update this to use the EntityMap type
  14. // instead of OrderedMap
  15. let key = 0;
  16. function addEntityToEntityMap(entityMap: OrderedMap<*, *>, instance: DraftEntityInstance): OrderedMap<*, *> {
  17. return entityMap.set(`${++key}`, instance);
  18. }
  19. module.exports = addEntityToEntityMap;