PHP 8.2.30
Preview: startsWith.js Size: 974 B
//opt/alt/alt-nodejs9/root/lib/node_modules/npm/node_modules/cli-table2/node_modules/lodash/string/startsWith.js

var baseToString = require('../internal/baseToString');

/* Native method references for those with the same name as other `lodash` methods. */
var nativeMin = Math.min;

/**
 * Checks if `string` starts with the given target string.
 *
 * @static
 * @memberOf _
 * @category String
 * @param {string} [string=''] The string to search.
 * @param {string} [target] The string to search for.
 * @param {number} [position=0] The position to search from.
 * @returns {boolean} Returns `true` if `string` starts with `target`, else `false`.
 * @example
 *
 * _.startsWith('abc', 'a');
 * // => true
 *
 * _.startsWith('abc', 'b');
 * // => false
 *
 * _.startsWith('abc', 'b', 1);
 * // => true
 */
function startsWith(string, target, position) {
  string = baseToString(string);
  position = position == null
    ? 0
    : nativeMin(position < 0 ? 0 : (+position || 0), string.length);

  return string.lastIndexOf(target, position) == position;
}

module.exports = startsWith;

Directory Contents

Dirs: 0 × Files: 23

Name Size Perms Modified Actions
680 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
494 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
1.06 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
1.05 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
1.84 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
1.11 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
649 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
1.28 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
654 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
664 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
1.50 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
1.07 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
626 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
690 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
974 B lrw-r--r-- 2021-09-28 11:28:35
Edit Download
8.89 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
1.36 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
1.32 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
1.05 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
1.08 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
3.18 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
1.06 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download
1.16 KB lrw-r--r-- 2021-09-28 11:28:35
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).