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

26 строки
655 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 strict-local
  9. * @emails oncall+draft_js
  10. */
  11. 'use strict';
  12. import type { BlockMap } from "./BlockMap";
  13. import type { BlockNodeRecord } from "./BlockNodeRecord";
  14. const Immutable = require("immutable");
  15. const {
  16. OrderedMap
  17. } = Immutable;
  18. const BlockMapBuilder = {
  19. createFromArray: function (blocks: Array<BlockNodeRecord>): BlockMap {
  20. return OrderedMap(blocks.map(block => [block.getKey(), block]));
  21. }
  22. };
  23. module.exports = BlockMapBuilder;