profile
viewpoint

dabreve/keystone 0

node.js cms and web app framework

dabreve/keystone-storage-adapter-s3 0

S3 Storage Adapter for KeystoneJS

steevsachs/babel-plugin-react-component-data-attribute 0

Babel plugin to add a data attribute containing its component’s name to the top-level DOM node

steevsachs/circleci-test 0

Testing Circle-CI

steevsachs/desktop 0

Mattermost Desktop application for Windows, Mac and Linux

steevsachs/GitHub-Dark 0

:octocat: Dark GitHub style

steevsachs/graphql-network 0

Chrome Devtool that provides a "network"-style tab for GraphQL requests to allow developers to debug more easily.

steevsachs/hackernewsfeed 0

Infinite scrolling Hacker News feed in React

steevsachs/ioredis 0

🚀A robust, performance-focused and full-featured Redis client for Node.js.

steevsachs/lacewing-website 0

Lacewing Floral homepage

push eventsteevsachs/remeda

Stephen Sachs

commit sha ac1904d8cd5784b65ebcd751fc6ab42ae5f87552

Fix types and add tests confirming inference from pred

view details

push time in 18 days

push eventsteevsachs/remeda

Stephen Sachs

commit sha c63aac987e3f2b6240ba471cf63fcde6c17947a5

Run prettier

view details

Stephen Sachs

commit sha 8f8ba5a934fdf3c14bb384debfd73af0b68bf6cf

Update types * Update type definition to allow specifying only value type * Add typing tests

view details

push time in 18 days

Pull request review commentremeda/remeda

Add `zip` utility

+import { purry } from './purry'++/**+ * Creates a new list from two supplied lists by pairing up equally-positioned items.+ * The length of the returned list will match the shortest of the two inputs.+ * @param first the first input list+ * @param second the second input list+ * @signature+ *   R.zip(first, second)+ * @example+ *   R.zip([1, 2], ['a', 'b']) // => [1, 'a'], [2, 'b']+ * @data_first+ * @category Array+ */+export function zip<F extends unknown, S extends unknown>(first: Array<F>, second: Array<S>): Array<[F, S]>

Added those. Thank you for your patience and the detailed reviews. I have a few PRs open here--I'm planning to apply the takeaways here to those PRs since I think many of these items will apply.

steevsachs

comment created time in 18 days

PullRequestReviewEvent

push eventsteevsachs/remeda

Stephen Sachs

commit sha 476ff02df1ec3fb90c7b9df77626043898b9d6cc

Fix second typing test block name

view details

push time in 18 days

push eventsteevsachs/remeda

Stephen Sachs

commit sha f85066f2554859f35a2373846e4b77e363d6f277

Fix typings and run prettier * Use ReadonlyArray for fn args * Fix typing on data second signature * Add typings tests * run prettier

view details

push time in 18 days

Pull request review commentremeda/remeda

Add `zip` utility

+import { purry } from './purry'++/**+ * Creates a new list from two supplied lists by pairing up equally-positioned items.+ * The length of the returned list will match the shortest of the two inputs.+ * @param first the first input list+ * @param second the second input list+ * @signature+ *   R.zip(first, second)+ * @example+ *   R.zip([1, 2], ['a', 'b']) // => [1, 'a'], [2, 'b']+ * @data_first+ * @category Array+ */+export function zip<F extends Array<unknown>, S extends Array<unknown>>(first: F, second: S): Array<[F, S]>++/**+ * Creates a new list from two supplied lists by pairing up equally-positioned items.+ * The length of the returned list will match the shortest of the two inputs.+ * @param second the second input list+ * @signature+ *   R.zip(second)(first)+ * @example+ *   R.zip(['a', 'b'])([1, 2]) // => [[1, 'a'], [2, 'b']+ * @data_last+ * @category Array+ */+export function zip<F extends Array<unknown>, S extends Array<unknown>>(second: S): (first: F) => Array<[F, S]>

Yeah, I've been banging my head against this and I can't seem to get it to infer the exact types of returned tuples. If you do have any ideas, suggestions definitely welcome!

steevsachs

comment created time in 18 days

PullRequestReviewEvent

push eventsteevsachs/remeda

Stephen Sachs

commit sha 010ff10fba972831c6bfb9ff3560e4f58c699eb6

Clean up types in zip

view details

push time in 20 days

Pull request review commentremeda/remeda

Add `zip` utility

+import { purry } from './purry'++/**+ * Creates a new list from two supplied lists by pairing up equally-positioned items.+ * The length of the returned list will match the shortest of the two inputs.+ * @param first the first input list+ * @param second the second input list+ * @signature+ *   R.zip(first, second)+ * @example+ *   R.zip([1, 2], ['a', 'b']) // => [1, 'a'], [2, 'b']+ * @data_first+ * @category Array+ */+export function zip<F extends Array<unknown>, S extends Array<unknown>>(first: F, second: S): Array<[F, S]>++/**+ * Creates a new list from two supplied lists by pairing up equally-positioned items.+ * The length of the returned list will match the shortest of the two inputs.+ * @param second the second input list+ * @signature+ *   R.zip(second)(first)+ * @example+ *   R.zip(['a', 'b'])([1, 2]) // => [[1, 'a'], [2, 'b']+ * @data_last+ * @category Array+ */+export function zip<F extends Array<unknown>, S extends Array<unknown>>(second: S): (first: F) => Array<[F, S]>

Ok, so I was working from the ramda implementation https://ramdajs.com/docs/#zip. It appears to be quite different from lodash.

Is there a preference here of which to match when they disagree?

IMO, the zipObj/zipObject implementation of ramda/lodash is more consistent with the ramda definition of zip than the lodash definition.

steevsachs

comment created time in 20 days

PullRequestReviewEvent

Pull request review commentremeda/remeda

Add `zip` utility

+import { purry } from './purry'++/**+ * Creates a new list from two supplied lists by pairing up equally-positioned items.+ * The length of the returned list will match the shortest of the two inputs.+ * @param first the first input list+ * @param second the second input list+ * @signature+ *   R.zip(first, second)+ * @example+ *   R.zip([1, 2], ['a', 'b']) // => [1, 'a'], [2, 'b']+ * @data_first+ * @category Array+ */+export function zip<F extends Array<unknown>, S extends Array<unknown>>(first: F, second: S): Array<[F, S]>++/**+ * Creates a new list from two supplied lists by pairing up equally-positioned items.+ * The length of the returned list will match the shortest of the two inputs.+ * @param second the second input list+ * @signature+ *   R.zip(second)(first)+ * @example+ *   R.zip(['a', 'b'])([1, 2]) // => [[1, 'a'], [2, 'b']+ * @data_last+ * @category Array+ */+export function zip<F extends Array<unknown>, S extends Array<unknown>>(second: S): (first: F) => Array<[F, S]>

Wow, you're right, that type's not correct, I'll revise that.

The logic here does handle first and second being different lengths--can you provide inputs for a test case that would produce undefined values?

steevsachs

comment created time in 20 days

PullRequestReviewEvent

pull request commenttypeorm/typeorm

fix for reading custom env files (for e.g. ormconfig.env)

This PR seems way out of sync, but I'm pretty sure a viable fix for master is

if (PlatformTools.fileExist(this.baseFilePath)) {
   PlatformTools.dotenv(this.baseFilePath);
} else if (PlatformTools.fileExist(`${this.baseFilePath}.env`)) {
   PlatformTools.dotenv(`${this.baseFilePath}.env`);
}

on line 98 of ConnectionOptionsReader.

There's definitely other ways to handle this, but I think this one will restore compat without breaking anything.

I don't know that I'll have time to refamiliarize myself with this repo enough to get testing working in the short term, so anyone else please feel free to run with this! If no one does, I'll try to make some time in the next couple weeks.

pdeszynski

comment created time in 20 days

push eventsteevsachs/remeda

Stephen Sachs

commit sha d4d930296350d6ffe47ff4d6e287ee92433b01e0

Export zipWith from index

view details

push time in 24 days

push eventsteevsachs/remeda

Stephen Sachs

commit sha 107d1563482bee213f3c3e32fa21eeab658fa4a4

Export zip from index

view details

push time in 24 days

push eventsteevsachs/remeda

Stephen Sachs

commit sha defdfd5c71f9f68c4c0e8eff99671b609a61e7e0

Respond to @lstkz PR review * Mutate in reduce instead of returning new object * Export from index file

view details

push time in 24 days

Pull request review commentremeda/remeda

Add fromPairs utility

+/**+ * Creates a new object from an array of tuples by pairing up first and second elements as {[key]: value}.+ * If a tuple is not supplied for any element in the array, the element will be ignored+ * If duplicate keys exist, the tuple with the greatest index in the input array will be preferred.+ * @param tuples the list of input tuples+ * @signature+ *   R.fromPairs(tuples)+ * @example+ *   R.fromPairs([['a', 'b'], ['c', 'd']]) // => {a: 'b', c: 'd'}+ * @category Object+ */+export function fromPairs<K extends string | number | symbol, V>(tuples: Array<[K, V]>): Record<K, V>+++export function fromPairs(tuples: Array<[string | number | symbol, unknown]>) {+  return tuples.reduce((acc, curr) => curr && curr.length === 2 ? ({

It actually currently does throw a type error. This handling is present to prevent errors in case someone ignores the type error. image

steevsachs

comment created time in 24 days

PullRequestReviewEvent

pull request commentremeda/remeda

Add fromPairs utility

Thank you for the thorough review, @lstkz ; I'll get these changes over to you this evening.

Note, I opened a few PRs that probably include these same issues; I'll review all of them for similar fixes.

steevsachs

comment created time in 24 days

issue commentremeda/remeda

Add "zipObj" function

Created the ingredients I think we need to get to zipObj. If these PRs land, zipObj (I think just a pipe through zip (or zipWith for zipObjWith?) and then fromPairs should hopefully be pretty straightforward).

dodas

comment created time in a month

push eventsteevsachs/remeda

Steev Sachs

commit sha 4b944d81061987bd14a9416a46543cf972d50b2a

Clean up comments and test terminology

view details

push time in a month

PR opened remeda/remeda

Add fromPairs utility

Per #72 adds fromPairs utility

R.fromPairs([['a', 'b'], ['c', 'd']]) // => {a: 'b', c: 'd'}
+42 -0

0 comment

2 changed files

pr created time in a month

push eventsteevsachs/remeda

Steev Sachs

commit sha 78b973e40597daa4a2af3bd3147d96516bed7df7

Update comment

view details

push time in a month

create barnchsteevsachs/remeda

branch : feature/fromPairs

created branch time in a month

PR opened remeda/remeda

Add zipWith utility

Per #72 adds zipWith utility

Data first

R.zipWith(['1', '2', '3'], ['a', 'b', 'c'], (a, b) => a + b) // => ['1a', '2b', '3c']

Data last

R.zipWith((a, b) => a + b)(['1', '2', '3'], ['a', 'b', 'c']) // => ['1a', '2b', '3c']

Data last with initial arg

R.zipWith((a, b) => a + b, ['a', 'b', 'c'])(['1', '2', '3']) // => ['1a', '2b', '3c']
+114 -0

0 comment

2 changed files

pr created time in a month

push eventsteevsachs/remeda

Steev Sachs

commit sha b78bd063542e6a655f158c25b23d9de1c032e226

Add zipWith utility

view details

push time in a month

create barnchsteevsachs/remeda

branch : feature/zipWith

created branch time in a month

PR opened remeda/remeda

Add `zip` utility

Per remeda/remeda#72, adds the zip utility:

Data first

R.zip([1, 2], ['c', 'd']) // => [[1, 'c'], [2, 'd']

Data last

R.zip(['c', 'd'])([1, 2]) // => [[1, 'c'], [2, 'd']
+72 -0

0 comment

2 changed files

pr created time in a month

push eventsteevsachs/remeda

Steev Sachs

commit sha 99dcf278d6384e640163513ee127aaec0acb4f6e

Add `zip` utility

view details

push time in a month

push eventsteevsachs/remeda

Steev Sachs

commit sha 3a86fb7075ed123428e1c4ebdf11ccff0458546e

Fix comment for data_last

view details

push time in a month

create barnchsteevsachs/remeda

branch : feature/zip

created branch time in a month

PR opened remeda/remeda

[remeda/remeda#81] Do not return nonexistent source properties from pick

Test for existence of object property before including it in returned object.

As part of this PR I upgraded jest and @types/jest in order to pick up the toStrictEqual matcher (since toEqual treats undefined the same as nonexistent).

I ran all tests and compiled to confirm no adverse impact of the library upgrades.

+2183 -1875

0 comment

4 changed files

pr created time in a month

create barnchsteevsachs/remeda

branch : bug/81

created branch time in a month

fork steevsachs/remeda

A utility library for JavaScript and TypeScript.

http://remedajs.com

fork in a month

more