123456789101112131415161718192021222324252627282930313233343536373839 |
- var baseClamp = require('./_baseClamp'),
- baseToString = require('./_baseToString'),
- toInteger = require('./toInteger'),
- toString = require('./toString');
- function startsWith(string, target, position) {
- string = toString(string);
- position = position == null
- ? 0
- : baseClamp(toInteger(position), 0, string.length);
- target = baseToString(target);
- return string.slice(position, position + target.length) == target;
- }
- module.exports = startsWith;
|