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 * from './types' | |
| import { setHost, setApiKey } from './req' | |
| import * as auth from './api/auth' | |
| import * as blocks from './api/blocks' | |
| import * as costCodes from './api/cost-codes' | |
| import * as equipment from './api/equipment' | |
| import * as reporting from './api/reporting' | |
| import * as sites from './api/sites' |
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
| // exported types will be available for you to import from compiled files | |
| // to distinguish between objects ({}) and blocks, blocks have a colon before the opening brace (:{}) | |
| export type parseRoute = (route: string) => :{ | |
| // assign computations to variables like this | |
| let parts = route.split("/"); // -> ["users", "<id:string>", "posts", "<index:number>"] | |
| // last expression is the return value, like in Rust | |
| parts | |
| // method chaining! | |
| .filter((part) => part.startsWith("<")) // -> ["<id:string>", "<index:number>"] |
OlderNewer