09 2023 档案
摘要:import { afterEach, test, expect, vi, beforeEach } from 'vitest'; import { render } from 'test/utilities'; import TimeZone from '.'; beforeEach(() =>
阅读全文
摘要:1. Globally import In vitest, you need to do import { it, expect, test } from 'vitest'; In every test files, If you don't want to do it you can set co
阅读全文
摘要:type WidenLiteral<T> = T extends string | number | boolean ? ReturnType<T["valueOf"]> : T; type Example1 = WidenLiteral<"abc"> // string type Example2
阅读全文
摘要:class Observable { constructor(subscribe) { this._subscribe = subscribe; } subscribe(observer) { return this._subscribe(observer); } static of(value)
阅读全文
摘要:class Observable { constructor(subscribe) { this._subscribe = subscribe; } subscribe(observer) { return this._subscribe(observer); } static concnat(..
阅读全文
摘要:const tasks = of([....]); /** * { * ...{ ...4......5......2} * ...........{3...........2...5} * ..................................{6.... 3} * ........
阅读全文
摘要:function Observable(forEach) { this._forEach = forEach; } Observable.prototype = { forEach: function (onNext, onError, onCompleted) { if (typeof onNex
阅读全文
摘要:Omit on Union type type Union = | { a: "a"; user?: string; } | { b: "b"; user?: string; }; type X = Omit<Union, "user">; // X is {} Using Distributive
阅读全文