Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9125234
es.string.raw.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
976 B
Subscribers
None
es.string.raw.js
View Options
var
$
=
require
(
'../internals/export'
);
var
uncurryThis
=
require
(
'../internals/function-uncurry-this'
);
var
toIndexedObject
=
require
(
'../internals/to-indexed-object'
);
var
toObject
=
require
(
'../internals/to-object'
);
var
toString
=
require
(
'../internals/to-string'
);
var
lengthOfArrayLike
=
require
(
'../internals/length-of-array-like'
);
var
push
=
uncurryThis
([].
push
);
var
join
=
uncurryThis
([].
join
);
// `String.raw` method
// https://tc39.es/ecma262/#sec-string.raw
$
({
target
:
'String'
,
stat
:
true
},
{
raw
:
function
raw
(
template
)
{
var
rawTemplate
=
toIndexedObject
(
toObject
(
template
).
raw
);
var
literalSegments
=
lengthOfArrayLike
(
rawTemplate
);
var
argumentsLength
=
arguments
.
length
;
var
elements
=
[];
var
i
=
0
;
while
(
literalSegments
>
i
)
{
push
(
elements
,
toString
(
rawTemplate
[
i
++
]));
if
(
i
===
literalSegments
)
return
join
(
elements
,
''
);
if
(
i
<
argumentsLength
)
push
(
elements
,
toString
(
arguments
[
i
]));
}
}
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jun 21, 8:19 PM (3 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3409209
Attached To
rDWAPPS Web applications
Event Timeline
Log In to Comment