source: imaps-frontend/node_modules/es-abstract/helpers/isPrefixOf.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 296 bytes
RevLine 
[d565449]1'use strict';
2
[79a0317]3var $strSlice = require('call-bound')('String.prototype.slice');
[d565449]4
5module.exports = function isPrefixOf(prefix, string) {
6 if (prefix === string) {
7 return true;
8 }
9 if (prefix.length > string.length) {
10 return false;
11 }
12 return $strSlice(string, 0, prefix.length) === prefix;
13};
Note: See TracBrowser for help on using the repository browser.