Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.

Commit 20a619c

Browse files
mrkevfacebook-github-bot
authored andcommitted
decodeInlineStyleRanges.js
Summary: No changes to behaviour, only types. ez ¯\_(ツ)_/¯ Reviewed By: kedromelon Differential Revision: D16854823 fbshipit-source-id: db211dbd7391f57716775b6f32b6777626771fc1
1 parent aed35d2 commit 20a619c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/model/encoding/decodeInlineStyleRanges.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,32 @@
55
* LICENSE file in the root directory of this source tree.
66
*
77
* @format
8-
* @flow
8+
* @flow strict-local
99
* @emails oncall+draft_js
1010
*/
1111

1212
'use strict';
1313

14+
import type {DraftInlineStyle} from 'DraftInlineStyle';
15+
import type {InlineStyleRange} from 'InlineStyleRange';
16+
1417
const UnicodeUtils = require('UnicodeUtils');
1518

1619
const {OrderedSet} = require('immutable');
17-
1820
const {substr} = UnicodeUtils;
1921

20-
import type {DraftInlineStyle} from 'DraftInlineStyle';
21-
2222
const EMPTY_SET = OrderedSet();
2323

2424
/**
2525
* Convert to native JavaScript string lengths to determine ranges.
2626
*/
2727
function decodeInlineStyleRanges(
2828
text: string,
29-
ranges?: Array<Object>,
29+
ranges?: Array<InlineStyleRange>,
3030
): Array<DraftInlineStyle> {
3131
const styles = Array(text.length).fill(EMPTY_SET);
3232
if (ranges) {
33-
ranges.forEach((/*object*/ range) => {
33+
ranges.forEach(range => {
3434
let cursor = substr(text, 0, range.offset).length;
3535
const end = cursor + substr(text, range.offset, range.length).length;
3636
while (cursor < end) {

0 commit comments

Comments
 (0)