Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7435545
ve.dm.DataString.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
928 B
Referenced Files
None
Subscribers
None
ve.dm.DataString.js
View Options
/*!
* VisualEditor DataString class.
*
* @copyright See AUTHORS.txt
*/
/**
* Wrapper class to read document data as a plain text string.
*
* @class
* @extends unicodeJS.TextString
* @constructor
* @param {ve.dm.LinearData.Item[]} data Document data
*/
ve
.
dm
.
DataString
=
function
VeDmDataString
(
data
)
{
this
.
data
=
data
;
};
/* Inheritance */
OO
.
inheritClass
(
ve
.
dm
.
DataString
,
unicodeJS
.
TextString
);
/**
* Reads the character from the specified position in the data.
*
* @param {number} position Position in data to read from
* @return {string|null} Character at position, or null if not text
*/
ve
.
dm
.
DataString
.
prototype
.
read
=
function
(
position
)
{
const
dataAt
=
this
.
data
[
position
];
// Check data is present at position and is not an element
if
(
dataAt
!==
undefined
&&
dataAt
.
type
===
undefined
)
{
return
typeof
dataAt
===
'string'
?
dataAt
:
dataAt
[
0
];
}
else
{
return
null
;
}
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 22, 12:58 (1 d, 8 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
52/27/12ec2b24c92be5759bea825de0c2
Default Alt Text
ve.dm.DataString.js (928 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment