rubico
rubico copied to clipboard
[a]synchronous functional programming
I think it's doing something more manual at the moment and only resolving relative paths. This is to support a feature to inline other projects. TODO: split out the distributor...
```coffeescript isPromise(value any) -> boolean ``` Determine if a value is a Promise by checking for its `.then` function. ```javascript console.log( isPromise('hey'), ) // false console.log( isPromise({ then() {} }),...
```coffeescript forEach.series(callback (item any)=>Promise|())(array Array) -> Promise|() ``` Execute a callback in series for each item of an Array. ```javascript const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))...
https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html
`then` describes a pretty common Promise handling pattern that could be refactored all throughout rubico. I welcome PRs that perform this refactor. ```javascript const then = (value, resolver) => isPromise(value)...
sometimes I like to use these with two arguments. Right now I have to do this. ```javascript const isTraversable = (a, b) => or([ ([a, b]) => is(Array)(a) && is(Array)(b),...
generators and generated iterators should be immutable. right now they are not; methods like `fork` deplete the same shared iterator. ```javascript const generateIncrements = n => function*(s) { for (let...
```coffeescript endsWith(suffix string)(value string) -> boolean ``` Determine whether a string ends with a suffix. ```javascript console.log(endsWith('y')('hey')) // true ```
```coffeescript startsWith(prefix string)(value string) -> boolean ``` Determine whether a string starts with a prefix. ```javascript console.log(startsWith('h')('hey')) // true ```
```coffeescript var value string, replacement string, capturedGroups ...string, replacer (match string, ...capturedGroups)=>replacement replace(pattern RegExp|string, replacement string)(value) -> replaced string replace(pattern RegExp|string, replacer) -> replaced string ``` Replace a pattern denoted...