source: frontend/node_modules/es-abstract/2025/IsTimeZoneOffsetString.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 683 bytes
Line 
1'use strict';
2
3var $TypeError = require('es-errors/type');
4
5var regexTester = require('safe-regex-test');
6
7// https://tc39.es/ecma262/#sec-istimezoneoffsetstring
8
9// implementation taken from https://github.com/tc39/proposal-temporal/blob/21ee5b13f0672990c807475ba094092d19dd6dc5/polyfill/lib/ecmascript.mjs#L2140
10
11var OFFSET = /^([+\u2212-])([01][0-9]|2[0-3])(?::?([0-5][0-9])(?::?([0-5][0-9])(?:[.,](\d{1,9}))?)?)?$/;
12
13var testOffset = regexTester(OFFSET);
14
15module.exports = function IsTimeZoneOffsetString(offsetString) {
16 if (typeof offsetString !== 'string') {
17 throw new $TypeError('Assertion failed: `offsetString` must be a String');
18 }
19 return testOffset(offsetString);
20};
Note: See TracBrowser for help on using the repository browser.