profile
viewpoint
Sasha Koss kossnocorp Teleport ✈️ https://koss.nocorp.me/ 👋 Hi, I'm Sasha, an open-source writer, indie maker, and serial strugglepreneur.

esamattis/underscore.string 3342

String manipulation helpers for javascript

ai/autoprefixer-rails 1169

Autoprefixer for Ruby and Ruby on Rails

appjudo/skim 278

Fat-free client-side templates with Slim and CoffeeScript

backupfire/backupfire-firebase 21

👩‍🏭 Backup Fire Firebase agent

gazay/role-haml 19

Role. With Haml support. Just write @something in your Haml template and use full power of role!

date-fns/date-fns-upgrade-codemod 9

Code mods for upgrading date-fns versions

kossnocorp/backbone.jwerty 8

jwerty integrated into Backbone.js events

date-fns/date-fns-upgrade 5

A tool for upgrading date-fns versions

push eventdate-fns/date-fns

Dan Dascalescu

commit sha a21d40a841f5ec4eb1c1cbed8c98087afac653e8

Fix English in the unicode tokens doc (#1803)

view details

push time in 2 days

PR merged date-fns/date-fns

docs: fix English in unicodeTokens 📃 Docs
+5 -5

1 comment

1 changed file

dandv

pr closed time in 2 days

pull request commentdate-fns/date-fns

docs: fix English in unicodeTokens

Thank you!

dandv

comment created time in 2 days

push eventdate-fns/date-fns.org

Sasha Koss

commit sha a6eae608ddc90a029b88fcb5b260948ca7a8f782

Update the sponsors list

view details

push time in 4 days

issue commentdate-fns/date-fns

Scottish Gaelic language support

@matt-rhys-jones if you're looking for ways to help the project, I would appreciate BBC becoming date-fns sponsors at https://opencollective.com/date-fns.

leedriscoll

comment created time in 6 days

issue commentdate-fns/date-fns

Scottish Gaelic language support

@matt-rhys-jones hey, sorry for the delay. I've been swamped lately. I'll try to merge and ship a new version over the weekends or on the next week. However, I recommend you don't wait and simply copy-paste the locale code to your project and use it from there for the time being.

leedriscoll

comment created time in 6 days

push eventdate-fns/date-fns.org

Sasha Koss

commit sha 1dac9a5877dd36329a070ab96de3c6bbe0206d46

Update the sponsors list

view details

push time in 6 days

issue commentdate-fns/date-fns

wrong startOfToday value

It looks like you output your string in UTC, so JS converts the date from your local timezone hence the time change. Are you in CET?

How do you get 2020-06-29T22:00:00.000Z, please provide the complete code snippet with the environment (if browser then which, if Node.js then what's the version.)

pawel-miczka

comment created time in 8 days

push eventdate-fns/date-fns.org

Sasha Koss

commit sha 62d10cdcb7b76b8d7e38e715f380813f3872ac31

Update the sponsors list

view details

push time in 11 days

issue commentdate-fns/date-fns

create addDuration API

Awesome, looking forward!

pke

comment created time in 12 days

issue commentdate-fns/date-fns

create addDuration API

Sorry, I misread the description of the library. My bad. I though it allows adding one duration to another. The ability to add/subtract duration from dates exists for some time:

What is missing is the ability to parse ISO 8601 duration to a duration object (fitting name for it would beparseISODuration as opposite to formatISODuration).

pke

comment created time in 12 days

issue closeddate-fns/date-fns

Add ISO 8601 duration support

https://en.wikipedia.org/wiki/ISO_8601

PYYYYMMDDThhmmss

closed time in 12 days

benjaminmcdonald

issue commentdate-fns/date-fns

Add ISO 8601 duration support

Closing as outdated

benjaminmcdonald

comment created time in 12 days

issue closeddate-fns/date-fns

Duration support

Functions to work with durations, like http://momentjs.com/docs/#/durations/ also #277

Seems like it is an anticipated feature: https://www.reddit.com/r/javascript/comments/5gl51e/a_modern_javascript_date_utility_library/daucfia/ https://www.reddit.com/r/javascript/comments/5gl51e/a_modern_javascript_date_utility_library/dat91yu/

Not sure about API. If someone has suggestions, please post them here

closed time in 12 days

leshakoss

issue commentdate-fns/date-fns

Duration support

@kossnocorp I'm a little confused by your comment. I also noticed you removed the milestone so there are no more plans to include this functionality?

I'm sorry for that, I just vocalized my frustration with people that feel entitled to post such comments. The author didn't contribute a bit nor say anything meaningful, just "progress shamed" the work I'm doing for many years.

I should have ignored him and now I regret it.

I also noticed you removed the milestone so there are no more plans to include this functionality?

Not at all, just didn't feel we need a milestone for that. We've already added foundation for that: Duration type, formatDuration, formatISODuration, intervalToDuration.

Could my package serve as base for the feature?

I would appreciate your help, but I'd like to see a different API. If you want to help, please start by opening a separate issue for addDuration where we can discuss itit.

I'm closing it as such megaissues aren't helpful as they touch too many things at once, never could be closed and only add noise.

leshakoss

comment created time in 12 days

issue commentdate-fns/date-fns

Duration support

@IonelLupu poor you

leshakoss

comment created time in 12 days

push eventjs-fns/js-fns

Sasha Koss

commit sha eb5a47dbb0e56c130628adf324a81a1edb9f6ba6

Fix messed up package

view details

push time in 16 days

push eventjs-fns/js-fns

Sasha Koss

commit sha 74d67f5750f241ae9dd2146e5eab7164c2dc87f9

Ship v2.5.0

view details

push time in 16 days

push eventjs-fns/js-fns

Sasha Koss

commit sha e5f79b7f4551c850e839a2823cd3b68bf229ca29

Automatically generate index file

view details

push time in 16 days

delete branch js-fns/js-fns

delete branch : generate-index

delete time in 16 days

PR merged js-fns/js-fns

Automatically generate index file

Instead of trying to make us remember adding functions to the index, I moved its generation to the build step.

+20 -25

0 comment

4 changed files

kossnocorp

pr closed time in 16 days

PR opened js-fns/js-fns

Automatically generate index file

Instead of trying to make us remember adding functions to the index, I moved its generation to the build step.

+20 -25

0 comment

4 changed files

pr created time in 16 days

create barnchjs-fns/js-fns

branch : generate-index

created branch time in 16 days

push eventjs-fns/js-fns

Sasha Koss

commit sha ba408cb32511aa7b7f6f77b4f40744a647c62561

Make TypeScript check tests in the strict mode

view details

Sasha Koss

commit sha 7554e739151ce0fe73c095017080e1abbe39cb03

Fix remove returning type mixed with the argument type

view details

push time in 16 days

delete branch js-fns/js-fns

delete branch : fix-remove

delete time in 16 days

Pull request review commentjs-fns/js-fns

Feature/fns

+/**+ * Checks if an array is empty or not+ *+ * @param array - The array to check for+ * @returns A boolean If the given array is empty or not+ *+ * @public+ */+export default function isEmpty<T>(val: T[]): boolean++/**+ * Checks if an object is empty or not+ *+ * @param object - The object to check for+ * @returns A boolean If the given object is empty or not+ *+ * @public+ */+export default function isEmpty<T extends { [key: string]: any }>(+  val: T+): boolean++/**+ * @internal+ */+export default function isEmpty(val: any): boolean {+  if (Array.isArray(val)) {+    return !val.length+  }+  return !Object.keys(val).length+}

Yeah, I like the idea of having elaborate overloads for the ones that always return false, such as null, undefined. 👍

ryands17

comment created time in 16 days

push eventjs-fns/js-fns

Ryan Dsouza

commit sha 99f6d7214343946806c4874d2fdfa4d7ab50dfd6

Add flow function (#50)

view details

push time in 16 days

PR merged js-fns/js-fns

feat: add flow function
  • Add the flow method: https://github.com/js-fns/js-fns/issues/48 with upto typings for 10 flow functions. For functions more than 10 will have type any.
+240 -0

0 comment

2 changed files

ryands17

pr closed time in 16 days

PR opened js-fns/js-fns

Fix remove returning type mixed with the argument type
+24 -8

0 comment

7 changed files

pr created time in 16 days

create barnchjs-fns/js-fns

branch : fix-remove

created branch time in 16 days

push eventdate-fns/date-fns

paulsimk

commit sha 4cf918f6e66499ced4254decf3573bf365e871c8

update `webpack.md` to be up to date with v2

view details

push time in 16 days

PR merged date-fns/date-fns

update `webpack.md` to be up to date with v2 📃 Docs

#1697

+7 -6

0 comment

1 changed file

psimk

pr closed time in 16 days

PR opened hoepel-app/hoepel-app

Fix conflicting dependencies

Hey Thomas!

I've upgraded the Backup Fire agent and resolved conflicting dependencies. This should fix the problem.

Have a great weekend!

+47 -119

0 comment

3 changed files

pr created time in 18 days

push eventkossnocorp/hoepel-app

Sasha Koss

commit sha 81c7dd4b7b9df4678c5eee3648bb1961c34c4aae

Fix conflicting dependencies

view details

push time in 18 days

push eventdate-fns/date-fns.org

Sasha Koss

commit sha b3f9ecf5af51b06e93fba8735588ec5941aec190

Update sponsors again

view details

push time in 18 days

push eventdate-fns/date-fns.org

Sasha Koss

commit sha 71c553efffc8e4fea46a67d7d034bb75144bc2ab

Give 2 extra weeks to sponsors before the link would disappear

view details

push time in 19 days

push eventdate-fns/date-fns.org

Sasha Koss

commit sha 734036e51b9b831e26387d3209aad0281a16c2d3

Update the sponsors list

view details

push time in 19 days

Pull request review commentjs-fns/js-fns

feat: add flow function

+type UnknownFn = (...params: unknown[]) => unknown+type AnyFn = (...params: any[]) => any++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow<First extends unknown, Output>(

No, seems like unknown is needed. However, I would like to see a type test for it using expectType or // @ts-expect-error

ryands17

comment created time in 19 days

Pull request review commentjs-fns/js-fns

Feature/fns

+/**+ * Checks if an array is empty or not+ *+ * @param array - The array to check for+ * @returns A boolean If the given array is empty or not+ *+ * @public+ */+export default function isEmpty<T>(val: T[]): boolean++/**+ * Checks if an object is empty or not+ *+ * @param object - The object to check for+ * @returns A boolean If the given object is empty or not+ *+ * @public+ */+export default function isEmpty<T extends { [key: string]: any }>(+  val: T+): boolean++/**+ * @internal+ */+export default function isEmpty(val: any): boolean {+  if (Array.isArray(val)) {+    return !val.length+  }+  return !Object.keys(val).length+}

@ryands17 yes, please add string, Map, List Set (sorry), and everything else that Lodash considers empty.

ryands17

comment created time in 19 days

push eventbackupfire/backupfire-firebase

Sasha Koss

commit sha 2833ed131af05d1c1705307cc90fe28b1f8ed425

Upgrade firebase-tools to the latest version

view details

push time in 19 days

issue commentkossnocorp/etiquette

Use positive instead of negative phrases

@ghostsquad looking forward!

delucas

comment created time in 20 days

Pull request review commentjs-fns/js-fns

feat: add flow function

+type UnknownFn = (...params: unknown[]) => unknown+type AnyFn = (...params: any[]) => any++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow<First extends unknown, Output>(+  first: (val: First) => Output+): (val: First) => Output++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow<First extends unknown, Second, Output>(+  first: (val: First) => Second,+  second: (val: Second) => Output+): (val: First) => Output++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow<First extends unknown, Second, Third, Output>(+  first: (val: First) => Second,+  second: (val: Second) => Third,+  third: (val: Third) => Output+): (val: First) => Output++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow<+  First extends unknown,+  Second,+  Third,+  Fourth,+  Output+>(+  first: (val: First) => Second,+  second: (val: Second) => Third,+  third: (val: Third) => Fourth,+  fourth: (val: Fourth) => Output+): (val: First) => Output++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow<+  First extends unknown,+  Second,+  Third,+  Fourth,+  Fifth,+  Output+>(+  first: (val: First) => Second,+  second: (val: Second) => Third,+  third: (val: Third) => Fourth,+  fourth: (val: Fourth) => Fifth,+  fifth: (val: Fifth) => Output+): (val: First) => Output++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow<+  First extends unknown,+  Second,+  Third,+  Fourth,+  Fifth,+  Sixth,+  Output+>(+  first: (val: First) => Second,+  second: (val: Second) => Third,+  third: (val: Third) => Fourth,+  fourth: (val: Fourth) => Fifth,+  fifth: (val: Fifth) => Sixth,+  sixth: (val: Sixth) => Output+): (val: First) => Output++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow<+  First extends unknown,+  Second,+  Third,+  Fourth,+  Fifth,+  Sixth,+  Seventh,+  Output+>(+  first: (val: First) => Second,+  second: (val: Second) => Third,+  third: (val: Third) => Fourth,+  fourth: (val: Fourth) => Fifth,+  fifth: (val: Fifth) => Sixth,+  sixth: (val: Sixth) => Seventh,+  seventh: (val: Seventh) => Output+): (val: First) => Output++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow<+  First extends unknown,+  Second,+  Third,+  Fourth,+  Fifth,+  Sixth,+  Seventh,+  Eighth,+  Output+>(+  first: (val: First) => Second,+  second: (val: Second) => Third,+  third: (val: Third) => Fourth,+  fourth: (val: Fourth) => Fifth,+  fifth: (val: Fifth) => Sixth,+  sixth: (val: Sixth) => Seventh,+  seventh: (val: Seventh) => Eighth,+  eighth: (val: Eighth) => Output+): (val: First) => Output++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow<+  First extends unknown,+  Second,+  Third,+  Fourth,+  Fifth,+  Sixth,+  Seventh,+  Eighth,+  Ninth,+  Output+>(+  first: (val: First) => Second,+  second: (val: Second) => Third,+  third: (val: Third) => Fourth,+  fourth: (val: Fourth) => Fifth,+  fifth: (val: Fifth) => Sixth,+  sixth: (val: Sixth) => Seventh,+  seventh: (val: Seventh) => Eighth,+  eighth: (val: Eighth) => Ninth,+  ninth: (val: Ninth) => Output+): (val: First) => Output++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow<+  First extends unknown,+  Second,+  Third,+  Fourth,+  Fifth,+  Sixth,+  Seventh,+  Eighth,+  Ninth,+  Tenth,+  Output+>(+  first: (val: First) => Second,+  second: (val: Second) => Third,+  third: (val: Third) => Fourth,+  fourth: (val: Fourth) => Fifth,+  fifth: (val: Fifth) => Sixth,+  sixth: (val: Sixth) => Seventh,+  seventh: (val: Seventh) => Eighth,+  eighth: (val: Eighth) => Ninth,+  ninth: (val: Ninth) => Tenth,+  tenth: (val: Tenth) => Output+): (val: First) => Output++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow(...fns: AnyFn[]): AnyFn++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public
 * @category Util
 * @public
ryands17

comment created time in 21 days

Pull request review commentjs-fns/js-fns

feat: add flow function

+type UnknownFn = (...params: unknown[]) => unknown+type AnyFn = (...params: any[]) => any++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow<First extends unknown, Output>(+  first: (val: First) => Output+): (val: First) => Output++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow<First extends unknown, Second, Output>(+  first: (val: First) => Second,+  second: (val: Second) => Output+): (val: First) => Output++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow<First extends unknown, Second, Third, Output>(+  first: (val: First) => Second,+  second: (val: Second) => Third,+  third: (val: Third) => Output+): (val: First) => Output++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow<+  First extends unknown,+  Second,+  Third,+  Fourth,+  Output+>(+  first: (val: First) => Second,+  second: (val: Second) => Third,+  third: (val: Third) => Fourth,+  fourth: (val: Fourth) => Output+): (val: First) => Output++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow<+  First extends unknown,+  Second,+  Third,+  Fourth,+  Fifth,+  Output+>(+  first: (val: First) => Second,+  second: (val: Second) => Third,+  third: (val: Third) => Fourth,+  fourth: (val: Fourth) => Fifth,+  fifth: (val: Fifth) => Output+): (val: First) => Output++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow<+  First extends unknown,+  Second,+  Third,+  Fourth,+  Fifth,+  Sixth,+  Output+>(+  first: (val: First) => Second,+  second: (val: Second) => Third,+  third: (val: Third) => Fourth,+  fourth: (val: Fourth) => Fifth,+  fifth: (val: Fifth) => Sixth,+  sixth: (val: Sixth) => Output+): (val: First) => Output++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow<+  First extends unknown,+  Second,+  Third,+  Fourth,+  Fifth,+  Sixth,+  Seventh,+  Output+>(+  first: (val: First) => Second,+  second: (val: Second) => Third,+  third: (val: Third) => Fourth,+  fourth: (val: Fourth) => Fifth,+  fifth: (val: Fifth) => Sixth,+  sixth: (val: Sixth) => Seventh,+  seventh: (val: Seventh) => Output+): (val: First) => Output++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow<+  First extends unknown,+  Second,+  Third,+  Fourth,+  Fifth,+  Sixth,+  Seventh,+  Eighth,+  Output+>(+  first: (val: First) => Second,+  second: (val: Second) => Third,+  third: (val: Third) => Fourth,+  fourth: (val: Fourth) => Fifth,+  fifth: (val: Fifth) => Sixth,+  sixth: (val: Sixth) => Seventh,+  seventh: (val: Seventh) => Eighth,+  eighth: (val: Eighth) => Output+): (val: First) => Output++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow<+  First extends unknown,+  Second,+  Third,+  Fourth,+  Fifth,+  Sixth,+  Seventh,+  Eighth,+  Ninth,+  Output+>(+  first: (val: First) => Second,+  second: (val: Second) => Third,+  third: (val: Third) => Fourth,+  fourth: (val: Fourth) => Fifth,+  fifth: (val: Fifth) => Sixth,+  sixth: (val: Sixth) => Seventh,+  seventh: (val: Seventh) => Eighth,+  eighth: (val: Eighth) => Ninth,+  ninth: (val: Ninth) => Output+): (val: First) => Output++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow<+  First extends unknown,+  Second,+  Third,+  Fourth,+  Fifth,+  Sixth,+  Seventh,+  Eighth,+  Ninth,+  Tenth,+  Output+>(+  first: (val: First) => Second,+  second: (val: Second) => Third,+  third: (val: Third) => Fourth,+  fourth: (val: Fourth) => Fifth,+  fifth: (val: Fifth) => Sixth,+  sixth: (val: Sixth) => Seventh,+  seventh: (val: Seventh) => Eighth,+  eighth: (val: Eighth) => Ninth,+  ninth: (val: Ninth) => Tenth,+  tenth: (val: Tenth) => Output+): (val: First) => Output++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow(...fns: AnyFn[]): AnyFn++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow(...fns: UnknownFn[]): UnknownFn {

Please keep only this TSDoc and make all the rest:

/**
 * @internal
 */
ryands17

comment created time in 21 days

Pull request review commentjs-fns/js-fns

feat: add flow function

+type UnknownFn = (...params: unknown[]) => unknown+type AnyFn = (...params: any[]) => any++/**+ * Lets you perform a flow of function operations sequentially+ *+ * @param functions - The function operations that you want to perform on a given value+ * @returns A function that accepts an initial value to perform the above functions on+ *+ * @public+ */+export default function flow<First extends unknown, Output>(

I'm wondering why does it extend unknown?

ryands17

comment created time in 21 days

Pull request review commentjs-fns/js-fns

Feature/fns

+/**+ * Checks if an array is empty or not
 * Checks if an array is empty or not.
ryands17

comment created time in 21 days

Pull request review commentjs-fns/js-fns

Feature/fns

+/**+ * Checks if an array is empty or not+ *+ * @param array - The array to check for+ * @returns A boolean If the given array is empty or not+ *+ * @public+ */+export default function isEmpty<T>(val: T[]): boolean++/**+ * Checks if an object is empty or not+ *+ * @param object - The object to check for+ * @returns A boolean If the given object is empty or not+ *+ * @public
 * @category Lang
 * @public
ryands17

comment created time in 21 days

Pull request review commentjs-fns/js-fns

Feature/fns

+/**+ * Checks if an array is empty or not+ *+ * @param array - The array to check for+ * @returns A boolean If the given array is empty or not+ *+ * @public+ */+export default function isEmpty<T>(val: T[]): boolean++/**+ * Checks if an object is empty or not+ *+ * @param object - The object to check for+ * @returns A boolean If the given object is empty or not+ *+ * @public+ */+export default function isEmpty<T extends { [key: string]: any }>(+  val: T+): boolean++/**+ * @internal+ */+export default function isEmpty(val: any): boolean {+  if (Array.isArray(val)) {+    return !val.length+  }+  return !Object.keys(val).length+}
  • I think we should also support more native structures: string, Map and List.

  • I also see that Lodash makes an extra step and returns true for false, null, undefined, and others but I don't like this behavior. The same way behave Ruby/Rails. Let do the same.

@ryands17 we're planning to add js-fns/compat submodule that will provide 100% compatibility with Lodash, so we can make API improvements in the main module. However isEmpty is not a case as Ruby/Rails also have this behavior. I'm saying about the compat submodule, so you can keep it in mind.

ryands17

comment created time in 21 days

Pull request review commentjs-fns/js-fns

Feature/fns

+/**+ * Performs a reduce on the elements in reverse order
 * Performs a reduce on the elements in reverse order.
ryands17

comment created time in 21 days

Pull request review commentjs-fns/js-fns

Feature/fns

+/**+ * Performs a reduce on the elements in reverse order+ *+ * @param array - The array to reduce+ * @param callback - The callback function with current output value and current array element+ * @param initialValue - The initial value to start with+ * @returns The reduced array output+ *+ * @category Array+ * @public+ */+export default function reduceRight<ArrayType, InitialVal>(+  arr: ArrayType[],+  cb: (acc: InitialVal, val: ArrayType) => InitialVal,+  initialValue: InitialVal+): InitialVal {

Please use the same type argument naming as in reduce

): AccumulatorType {
ryands17

comment created time in 21 days

Pull request review commentjs-fns/js-fns

Feature/fns

+/**+ * Checks if an array is empty or not+ *+ * @param array - The array to check for+ * @returns A boolean If the given array is empty or not+ *+ * @public+ */+export default function isEmpty<T>(val: T[]): boolean++/**+ * Checks if an object is empty or not
 * Checks if an object is empty or not.
ryands17

comment created time in 21 days

Pull request review commentjs-fns/js-fns

Feature/fns

+/**+ * Checks if an array is empty or not+ *+ * @param array - The array to check for+ * @returns A boolean If the given array is empty or not+ *+ * @public+ */+export default function isEmpty<T>(val: T[]): boolean

Please give type arguments meaningful names (here and everywhere in the PR):

export default function isEmpty<Type>(val: Type[]): boolean
ryands17

comment created time in 21 days

Pull request review commentjs-fns/js-fns

Feature/fns

+export interface Values<Input extends { [key: string]: any }>+  extends Array<Input extends { [key: string]: infer Value } ? Value : never> {}++/**+ * Creates an array of values of the items in the object.+ *+ * @param object - The object to get the values from+ * @returns Array of values+ *+ * @public+ */+export default function values<Input extends { [key: string]: any }>(+  obj: Input+): Values<Input> {+  const arr = []+  for (let i in obj) {+    if (Object.prototype.hasOwnProperty.call(obj, i)) {+      arr.push(obj[i])+    }+  }+  return arr as Values<Input>+}

I see that native Object.values also work for array and string, so I think we should do as well:

Object.values([1, 2, 3])
//=> [1, 2, 3]

Object.values('123')
//=> ["1", "2", "3"]
ryands17

comment created time in 21 days

Pull request review commentjs-fns/js-fns

Feature/fns

+export interface Values<Input extends { [key: string]: any }>+  extends Array<Input extends { [key: string]: infer Value } ? Value : never> {}++/**+ * Creates an array of values of the items in the object.+ *+ * @param object - The object to get the values from+ * @returns Array of values+ *+ * @public
 * @category Collection
 * @public
ryands17

comment created time in 21 days

Pull request review commentjs-fns/js-fns

Feature/fns

+import assert from 'assert'+import isEmpty from '.'++describe('isEmpty test', () => {+  it('checks if isEmpty works properly on arrays', () => {+    assert.equal(isEmpty([1, 2, 3]), false)+    assert.equal(isEmpty([]), true)+  })
  })

ryands17

comment created time in 21 days

Pull request review commentjs-fns/js-fns

Feature/fns

+/**+ * Checks if an array is empty or not+ *+ * @param array - The array to check for+ * @returns A boolean If the given array is empty or not+ *+ * @public
 * @category Collection
 * @public
ryands17

comment created time in 21 days

Pull request review commentjs-fns/js-fns

Feature/fns

+/**+ * Performs a reduce on the elements in reverse order+ *+ * @param array - The array to reduce+ * @param callback - The callback function with current output value and current array element+ * @param initialValue - The initial value to start with+ * @returns The reduced array output+ *+ * @category Array+ * @public+ */+export default function reduceRight<ArrayType, InitialVal>(+  arr: ArrayType[],+  cb: (acc: InitialVal, val: ArrayType) => InitialVal,+  initialValue: InitialVal+): InitialVal {+  let val = initialValue+  for (let i = arr.length - 1; i >= 0; i--) {+    val = cb(val, arr[i])+  }+  return val+}

Please support for the object, like in reduce. I think you could use its implementation as the reference.

ryands17

comment created time in 21 days

Pull request review commentjs-fns/js-fns

Feature/fns

+/**+ * Performs a reduce on the elements in reverse order+ *+ * @param array - The array to reduce+ * @param callback - The callback function with current output value and current array element+ * @param initialValue - The initial value to start with+ * @returns The reduced array output+ *+ * @category Array
 * @category Collection
 * @public
ryands17

comment created time in 21 days

create barnchjs-fns/js-fns

branch : compat

created branch time in 21 days

issue commentkossnocorp/etiquette

thoughts on "Don't be noisy"

I'm all for leaving a reaction. It does help to gauge interest. I'm only arguing against leaving such a comment.

I guess I have to update the section and emphasize it.

bkfarnsworth

comment created time in 22 days

Pull request review commentjs-fns/js-fns

Feature/fns

+export interface Values<Input extends { [key: string]: any }>+  extends Array<Input extends { [key: string]: infer Value } ? Value : never> {}++/**+ * Creates an array of values of the items in the object.+ *+ * @param object - The object to get the values from+ * @returns Array of values+ *+ * @public+ */+export default function values<Input extends { [key: string]: any }>(+  obj: Input+): Values<Input> {+  const arr = []+  for (let i in obj) {+    if (Object.prototype.hasOwnProperty.call(obj, i)) {

I would add a test that checks the usage of Object.prototype.hasOwnProperty.

ryands17

comment created time in 22 days

push eventdate-fns/date-fns.org

Sasha Koss

commit sha 391fbf286bc4be360a82dadb6a19b0922f466227

Update sponsors list

view details

push time in 22 days

issue closeddate-fns/date-fns

wrong month name in Indonesia "id" localize

for example

function someFunction(){ let value = "2020-12-16"; let date =value.toString().split("-"); return format(new Date(date[0],date[1],date[2]),"dd MMMM yyyy",{locale:id}) } should return 16 Desember 2020, but instead return 16 Januari 2020

closed time in 22 days

juliarnasution

issue commentdate-fns/date-fns

wrong month name in Indonesia "id" localize

Months in Date constructor starts at 0, so you should do - 1 before passing it to the constructor:

function someFunction() {
  let value = "2020-12-16";
  let date = value.toString().split("-").map(num => parseInt(num));
  return format(new Date(date[0], date[1] - 1, date[2]), "dd MMMM yyyy", {
    locale: id,
  });
}
``
juliarnasution

comment created time in 22 days

issue closeddate-fns/date-fns

Sub Months is resulting in 1day too many days being subtracted

Months math does not handle February properly,

expect(subMonths(new Date('2016-03-01T00:00:00.000Z'), 1))
  .toEqual(new Date('2016-02-01T00:00:00.000Z'))

// Results in 2016-01-30T00:00:00.000Z

closed time in 22 days

KamalAman

issue commentdate-fns/date-fns

Sub Months is resulting in 1day too many days being subtracted

The problem is that you create a date in UTC instead of locale timezone hence the confusing result.

CleanShot 2020-06-16 at 02 10 31

KamalAman

comment created time in 22 days

issue commentkossnocorp/typesaurus

realtime: to destroy /unsubscribe

Oh, sweet!

joshua1

comment created time in 23 days

issue commentkossnocorp/typesaurus

realtime: to destroy /unsubscribe

Please forgive me again. My email is a mess 😂

I'm wondering if, by any chance, you use React? I have a set of hooks that could make it easier to manage subscriptions.

joshua1

comment created time in 23 days

issue commentkossnocorp/typesaurus

realtime: to destroy /unsubscribe

Hey! Sorry I missed the issue 😵

All of those functions return unsubscribe function that you can use to unsubscribe from the data updates.

joshua1

comment created time in 23 days

issue openedjs-fns/js-fns

Add flow function

const fn = flow(c => c.toLowerCase(), c => c + c)
fn('A')
//=> aa

created time in 25 days

issue openedjs-fns/js-fns

Add values function

values({ a: 1, b: 2, c: 3 })
//=> [1, 2, 3]

created time in 25 days

issue openedjs-fns/js-fns

Add isEmpty function

isEmpty([])
//=> true

isEmpty({})
//=> true

created time in 25 days

issue openedjs-fns/js-fns

Add reduceRight function

reduceRight([1, 2, 3], (acc, item) => acc.concat([item, item * 2]), [])
// => [3, 6, 2, 4, 1, 2]

created time in 25 days

issue openedjs-fns/js-fns

Add shuffle function

shuffle([1, 2, 3])
//=> [2, 3, 1]

Lodash uses fisher–Yates algo, so should we.

created time in 25 days

starteddevelopit/preact-transition-group

started time in a month

starteddanielnixon/eslint-plugin-total-functions

started time in a month

push eventdate-fns/date-fns

Sasha Koss

commit sha 32cef9bc50ea8126aea1ee9a1ae73d607db57993

Adjust add function

view details

Sasha Koss

commit sha ebdebf3bc5d3ab5e1300dd9aa276f0f177bebe01

Adjust Duration type

view details

Sasha Koss

commit sha 26fa6e42d8acb3f421f8556ad8f6f4ce775ef259

omg I'm dumb

view details

Sasha Koss

commit sha 9d20c867cd05e75498ea7634ba2228e3a0b657ff

I can do it!

view details

Sasha Koss

commit sha f304339ca95c2407b3be35508aaa0f36f246f9ff

Adjust add and addBusinessDays

view details

Sasha Koss

commit sha d90f7e72d725a0110754159cebc9f85510561191

Update addDays

view details

Sasha Koss

commit sha 7382ed0e5cbe9021f7c0660b978b3b4cb95ed038

Change a bunch of functions

view details

push time in a month

push eventdate-fns/date-fns.org

Sasha Koss

commit sha 7ef55f1b9450c4b1948ae84aa6984a204722e3aa

Update sponsors list

view details

push time in a month

issue commentkossnocorp/etiquette

Use positive instead of negative phrases

Hey!

I understand and agree with you! When I shared this document on Reddit I got a lot of negative comments from people that were defensive. They were focused on defending their freedom to ask about updates, which is understandable, but that distracts from the more significant point.

I realize that focusing that much on dont's I miss the opportunity to promote better alternative behavior which is the whole point of this initiative.

However, while "Don't be mean!" and "Don't demand" are easier to turn into positives, it's a bit harder to rephrase "Don't be bossy!" and "Don't be noisy!" preserving the idea. Also, these headers are catchy and sparkle debate, which is also good.

Said that I open to suggestions on how I could rewrite this document. I'm open to hearing everything from ideas on how to rephrase the headers to an alternative structure.

delucas

comment created time in a month

push eventkossnocorp/etiquette

Stefano Saitta

commit sha e85e2bdaa0e005d438f8b1ffd833a4445426b73c

Change manager with boss I think that a good manager doesn't ever write something like this, this is the classic either junior manager or very old school bossy style boss.

view details

push time in a month

PR merged kossnocorp/etiquette

Change manager with boss

First of all, thank you so much for sharing the guideline. Much appreciated.

I'd like to propose a simple change since I think that using the word manager in the context of pushy/bossy language is not the best. My proposed change is going from manager to boss which in my humble opinion sounds more appropriate for the context.

Thank you so much again. Bye

+1 -1

1 comment

1 changed file

nerder

pr closed time in a month

pull request commentkossnocorp/etiquette

Change manager with boss

Good point, thank you a lot! Now it's better!

nerder

comment created time in a month

push eventkossnocorp/etiquette

CLASSIFIED

commit sha f28d1dab53e0ae9a748efd107f6c6f033f81aee0

Minor gramatical fixes Although I realize that this is the second pull request that has come unannounced, there were a few minor grammatical mistakes that needed to be fixed. Thanks for making this guide! I think it'll be really helpful, especially to maintainers.

view details

push time in a month

PR merged kossnocorp/etiquette

Minor gramatical fixes

Although I realize that this is the second pull request that has come unannounced, there were a few minor grammatical mistakes that needed to be fixed.

Thanks for making this guide! I think it'll be really helpful, especially to maintainers.

+5 -5

1 comment

1 changed file

2br-2b

pr closed time in a month

pull request commentkossnocorp/etiquette

Minor gramatical fixes

As a maintainer, you must know that this kind of pull-requests that require nothing but pressing "Rebase and merge" are always welcome, including announced 😉

Anyways, I understand and appreciate the joke, and thank you for taking the time to fix my mistakes.

Cheers!

2br-2b

comment created time in a month

create barnchkossnocorp/typesaurus

branch : partial-update

created branch time in a month

issue closeddate-fns/date-fns

indian language support

please add ist timezone

closed time in a month

sitanshu-kumar-vst-au4

issue commentdate-fns/date-fns

indian language support

Closing as I don't see anything actionable

sitanshu-kumar-vst-au4

comment created time in a month

issue closeddate-fns/date-fns

add supports of options for eachWeekendOfInterval (like: eachWeekOfInterval)

Why not eachWeekendOfInterval didn't support options like locale, weekStartsOn?

You already have options for eachWeekOfInterval eachWeekOfInterval(interval, [options])

Please add support for options for eachWeekendOfInterval too. eachWeekendOfInterval(interval)

closed time in a month

irkreja

issue commentdate-fns/date-fns

indian language support

What does this mean "add ist timezone"?

sitanshu-kumar-vst-au4

comment created time in a month

startedlodash/lodash

started time in a month

PR opened js-fns/js-fns

Add reduce function

For the dream!

+121 -2

0 comment

3 changed files

pr created time in a month

create barnchjs-fns/js-fns

branch : reduce

created branch time in a month

delete branch js-fns/js-fns

delete branch : map

delete time in a month

push eventjs-fns/js-fns

Eduard Tsech

commit sha 558d34a3a6dc21a171e05bbf617e1476c5d839bf

Add map (#42)

view details

push time in a month

PR merged js-fns/js-fns

Add map

For the dream.

+149 -0

0 comment

2 changed files

edtsech

pr closed time in a month

push eventjs-fns/js-fns

Sasha Koss

commit sha a4384ea600fa8bb15d83629ed924a87560c9a46e

Improve entries functions

view details

Sasha Koss

commit sha 0df085d21466f847aa714169d6b7df13f128160c

Replace ts-expect with custom helper

view details

push time in a month

delete branch js-fns/js-fns

delete branch : improve-entries

delete time in a month

PR merged js-fns/js-fns

Improve entries function types
  • Now fromEntries restore input type of entries
  • Get rid of unknown in fromEntries
  • Make entries store the input type
+53 -32

0 comment

8 changed files

kossnocorp

pr closed time in a month

more