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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <title>Brachistochrone – Real Gravity Realtime Simulation</title> | |
| <style> | |
| body { font-family: sans-serif; } | |
| canvas { border: 1px solid #ccc; } | |
| </style> | |
| </head> |
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
| #!/usr/bin/env node | |
| // Restore working dir and remove additional argument | |
| const originalCwd = process.argv.length >= 3 ? process.argv[2] : ''; | |
| if(originalCwd.startsWith('$$')) { | |
| process.argv.splice(2, 1); | |
| process.chdir(originalCwd.substring(2)); | |
| } | |
| require('../lib/cli.js')(process) |
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 detect = require('detect-es-version'); | |
| const path = require('path'); | |
| async function main() { | |
| const file = path.resolve('./file-to-be-detect.js'); | |
| const ecmaVersion = await detect.getEntryPointEcmaVersion(file); | |
| console.log(file, ecmaVersion); // prints 2015 | |
| } |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP --> | |
| <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'"> | |
| <link href="./styles.css" rel="stylesheet"> | |
| <title>Hello World!</title> | |
| </head> | |
| <body> |
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
| type JSONPrimitive<T> = number | boolean | string | null | T; | |
| type JSONValue<T> = JSONPrimitive<T> | JSONArray<T> | JSONObject<T>; | |
| type JSONObject<T> = { [k: string]: JSONValue<T>; }; | |
| interface JSONArray<T> extends Array<JSONValue<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
| type PropType<T, Path extends string> = | |
| string extends Path ? never : | |
| Path extends keyof T ? T[Path] : | |
| Path extends `${infer K}.${infer R}` ? K extends keyof T ? PropType<T[K], R> : never : never; | |
| declare function getPropValue<T, P extends string>(obj: T, path: P): PropType<T, P>; | |
| const obj = { | |
| a: | |
| { |
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
| /// <reference types="node" /> | |
| declare module 'server-timings' { | |
| import { RequestHandler, Request, Response, NextFunction } from 'express'; | |
| function ServerTimings(req: Request, res: Response, next: NextFunction): any; | |
| module ServerTimings { | |
| /** | |
| * Record the start time |
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
| interface MessageMap { | |
| method1: { prop1: string }; | |
| method2: { prop2: string }; | |
| method3: { prop3: string }; | |
| } | |
| export type RequestMessage<T> = { | |
| [P in keyof T]: { action: P, data: T[P] } | |
| }[keyof 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
| type JSONified<T> = | |
| JSONifiedValue<T extends { toJSON(): infer U } ? U : T>; | |
| type JSONifiedValue<T> = | |
| T extends string | number | boolean | null ? T : | |
| T extends Function ? undefined : | |
| T extends Array<infer U> ? JSONifiedArray<U> : | |
| T extends object ? JSONifiedObject<T> : | |
| undefined; |
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
| export type TypeFromConstructor<T> = | |
| T extends StringConstructor ? string : | |
| T extends NumberConstructor ? number : | |
| any; | |
| export type MethodDefinition = { | |
| [x: string]: StringConstructor | NumberConstructor; | |
| }; | |
| export type ServiceDefinition = { | |
| [x: string]: MethodDefinition | |
| }; |
NewerOlder