🏃♂️
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable no-template-curly-in-string */ | |
const gitlabUrl = 'https://gitlab.com' | |
const gitlabApiPathPrefix = '/api/v4' | |
const assets = [ | |
{ path: 'index.js', label: 'JS distribution' } | |
] | |
const verifyConditions = [ | |
['@semantic-release/changelog'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it("should get the client timezone as a string", () => { | |
const DateTimeFormat = Intl.DateTimeFormat; | |
vi.spyOn(global.Intl, "DateTimeFormat").mockImplementation( | |
(locale, options) => | |
new DateTimeFormat(locale, { ...options, timeZone: "Asia/Tehran" }) | |
); | |
const date: MyDate = new MyDate("2023-03-28T11:06:48+00:00"); | |
expect(date.getClientTZ()).toEqual("Asia/Tehran"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Consistent version of `useMutableSource`, Inspired by https://github.com/pmndrs/valtio/blob/master/src/useMutableSource.ts | |
import { useEffect, useRef, useState } from 'react'; | |
const TARGET = Symbol('target'); | |
const GET_VERSION = Symbol('getVersion'); | |
export type Source<TargetType extends any, VersionType extends any> = { | |
[TARGET]: TargetType; | |
[GET_VERSION]: (target: TargetType) => VersionType; | |
}; |