source: imaps-frontend/node_modules/es-abstract/2022/IsStringPrefix.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 463 bytes
Line 
1'use strict';
2
3var $TypeError = require('es-errors/type');
4
5var StringIndexOf = require('./StringIndexOf');
6
7// https://262.ecma-international.org/13.0/#sec-isstringprefix
8
9module.exports = function IsStringPrefix(p, q) {
10 if (typeof p !== 'string') {
11 throw new $TypeError('Assertion failed: "p" must be a String');
12 }
13
14 if (typeof q !== 'string') {
15 throw new $TypeError('Assertion failed: "q" must be a String');
16 }
17
18 return StringIndexOf(q, p, 0) === 0;
19};
Note: See TracBrowser for help on using the repository browser.