Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

es.string.starts-with.js 1.5KB

123456789101112131415161718192021222324252627282930313233
  1. 'use strict';
  2. var $ = require('../internals/export');
  3. var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
  4. var toLength = require('../internals/to-length');
  5. var notARegExp = require('../internals/not-a-regexp');
  6. var requireObjectCoercible = require('../internals/require-object-coercible');
  7. var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic');
  8. var IS_PURE = require('../internals/is-pure');
  9. // eslint-disable-next-line es/no-string-prototype-startswith -- safe
  10. var $startsWith = ''.startsWith;
  11. var min = Math.min;
  12. var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith');
  13. // https://github.com/zloirock/core-js/pull/702
  14. var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () {
  15. var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith');
  16. return descriptor && !descriptor.writable;
  17. }();
  18. // `String.prototype.startsWith` method
  19. // https://tc39.es/ecma262/#sec-string.prototype.startswith
  20. $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
  21. startsWith: function startsWith(searchString /* , position = 0 */) {
  22. var that = String(requireObjectCoercible(this));
  23. notARegExp(searchString);
  24. var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length));
  25. var search = String(searchString);
  26. return $startsWith
  27. ? $startsWith.call(that, search, index)
  28. : that.slice(index, index + search.length) === search;
  29. }
  30. });