mirror of
https://github.com/joelwmale/webhook-action.git
synced 2024-12-01 11:55:20 +01:00
1ada95e04a
- Convert project to Javascript/Typescript - Allow custom headers to be passed in (optional) - Allow body to be optional
13 lines
306 B
JavaScript
13 lines
306 B
JavaScript
'use strict';
|
|
|
|
var $strSlice = require('../helpers/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;
|
|
};
|