All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.helpers.isPrefixOf.js Maven / Gradle / Ivy

There is a newer version: 1.22.3
Show newest version
'use strict';

var $strSlice = require('call-bind/callBound')('String.prototype.slice');

module.exports = function isPrefixOf(prefix, string) {
	if (prefix === string) {
		return true;
	}
	if (prefix.length > string.length) {
		return false;
	}
	return $strSlice(string, 0, prefix.length) === prefix;
};




© 2015 - 2025 Weber Informatics LLC | Privacy Policy