-
Definition - A type
Tis promise-Like iffThas a callablethenmethod that accepts a function as its first argument. -
Definition - The fulfillment type of
Tis the typeVinT.then((value: V) ⇒> {}). -
Definition - The promised type of
T(nee.promised T) is the promised type of the fulfillment type ofTiffTis promise-like; otherwise,T.
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
| 'use strict'; | |
| class MapAsyncIterable<T, R> implements AsyncIterable<R> { | |
| private _source: Iterable<T | PromiseLike<T>> | AsyncIterable<T>; | |
| private _selector: (value: T) => R | PromiseLike<R>; | |
| constructor(source: Iterable<T | PromiseLike<T>> | AsyncIterable<T>, selector: (value: T) => R | PromiseLike<R>) { | |
| this._source = source; | |
| this._selector = selector; | |
| } |
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
| #!/bin/sh | |
| source "$(git --exec-path)/git-sh-setup" | |
| USAGE="<pull> [<branch>]" | |
| function _pr() { | |
| if [[ -n $(git rev-parse --verify --quiet $2) ]]; then | |
| git checkout $2 | |
| else | |
| git fetch origin pull/$1/head:$2 |
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
| const EventEmitter = require('events').EventEmitter; | |
| const fromEventPattern = require('ix/asynciterable/fromeventpattern').fromEventPattern; | |
| // Get Async Iterable | |
| const e = new EventEmitter(); | |
| const ai = fromEventPattern( | |
| h => e.addListener('data', h), | |
| h => e.removeListener('data', h) | |
| ); |
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
| let | |
| CreateDateTable = (StartDate as date, EndDate as date, optional Culture as nullable text) as table => | |
| let | |
| Today = DateTime.Date(DateTime.FixedLocalNow()), | |
| #"Start Of Month" = Date.StartOfMonth(Today), | |
| #"30 Days Ago" = DateTime.Date(Today - #duration(30, 0, 0, 0)), | |
| #"60 Days Ago" = DateTime.Date(Today - #duration(60, 0, 0, 0)), | |
| #"90 Days Ago" = DateTime.Date(Today - #duration(90, 0, 0, 0)), | |
| #"12 Months Prior" = #date(Date.Year(#"Start Of Month") - 1, Date.Month(#"Start Of Month") + 1, 1), | |
| #"Number of Days" = Duration.TotalDays(Date.StartOfDay(EndDate) - Date.StartOfDay(StartDate)), |
const obj = {
y: 1,
method(x) => x + this.y,
get prop() => this.y,
set prop(v) => this.y = v
}
class C {
y = 1;For the purposes of this investigation, I am breaking down the various statements within ECMAScript into several broad categories:
- Leaf Statements:
- Declaration Statements -
class,function,var,let,const,import,export - Abrupt Completion Statements -
throw,return,break,continue - Other -
debugger
- Declaration Statements -
- Branching Statements:
- Control Flow Statements -
if,switch,try
The following is a somewhat loose interpretation of a "friend class"-like feature exposed through decorators:
NOTE: this has been adapted from https://github.com/tc39/proposal-unified-class-features/blob/master/friend.js
// friend.js
export class FriendKey {The following is an interpretation of "protected" state exposed through decorators:
NOTE: this has been adapted from https://github.com/tc39/proposal-unified-class-features/blob/master/friend.js
// protected.js
const protectedMembers = new WeakMap();
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
| const nodeFriend = new FriendKey(); | |
| export class LinkedList { | |
| #head; | |
| #size; | |
| get first() { return this.#head; } | |
| get last() { return this.#head !== undefined ? nodeFriend.get(this.#head, "#previous") : undefined; } | |
| get size() { return this.#size; } |