/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format * @flow strict-local * @emails oncall+draft_js */ 'use strict'; import type { DraftInlineStyle } from "./DraftInlineStyle"; const CharacterMetadata = require("./CharacterMetadata"); const Immutable = require("immutable"); const { List } = Immutable; function createCharacterList(inlineStyles: Array, entities: Array): List { const characterArray = inlineStyles.map((style, ii) => { const entity = entities[ii]; return CharacterMetadata.create({ style, entity }); }); return List(characterArray); } module.exports = createCharacterList;