GithubHelp home page GithubHelp logo

tomi / fromfrom Goto Github PK

View Code? Open in Web Editor NEW
477.0 477.0 9.0 12.6 MB

A JS library written in TS to transform sequences of data from format to another

License: MIT License

TypeScript 100.00%
collection linq sequence transform typescript

fromfrom's People

Contributors

allcontributors[bot] avatar dependabot[bot] avatar greenkeeper[bot] avatar hollannikas avatar jtenner avatar semantic-release-bot avatar tomi avatar vaaralav avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fromfrom's Issues

An in-range update of css-loader is breaking the build 🚨

The devDependency css-loader was updated from 2.1.0 to 2.1.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

css-loader is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

Release Notes for v2.1.1

2.1.1 (2019-03-07)

Bug Fixes

  • do not break selector with escaping (#896) (0ba8c66)
  • source map generation when sourceRoot is present (#901) (e9ce745)
  • sourcemap generating when previous loader pass sourcemap as string (#905) (3797e4d)
Commits

The new version differs by 13 commits.

  • bc16c3d chore(release): 2.1.1
  • b671db7 fix: don't remove value from attribute selector (#904)
  • 3797e4d fix: sourcemap generating when previous loader pass sourcemap as string (#905)
  • cc81af1 refactor: stuff (#903)
  • e9ce745 fix: source map generation when sourceRoot is present (#901)
  • a49e904 docs: improve documentation for hashPrefix, context, getLocalIdent (#900)
  • c309788 refactor: avoid lodash in favor native implementations
  • 0ba8c66 fix: do not break selector with escaping (#896)
  • 2293eb0 chore: update defaults (#895)
  • 2a2ee7b docs: sourceMaps are disabled by default (#890)
  • 2d45e95 test: base64 (#888)
  • 1fb8948 docs: update README.md (#885)
  • 034f9a3 test: emoji (#881)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

The automated release is failing 🚨

🚨 The automated release from the release branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the release branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two-Factor Authentication, make configure the auth-only level is supported. semantic-release cannot publish with the default auth-and-writes level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

Chosen TSlib is es2015

Are there any particular reasons why the development version of ts is set to es2015 instead of es2018?

An in-range update of ts-jest is breaking the build 🚨

The devDependency ts-jest was updated from 24.0.0 to 24.0.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

ts-jest is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

Commits

The new version differs by 23 commits.

  • b43b3c1 chore(release): 24.0.1
  • 2d91a37 chore: update package-lock
  • 485d3f7 build(deps): bump semver from 5.6.0 to 5.7.0 (#1043)
  • 2bd2534 build(deps-dev): bump @types/node from 10.14.3 to 10.14.4 (#1041)
  • bdba560 build(deps-dev): bump @types/node from 10.14.2 to 10.14.3 (#1038)
  • 08766bf build(deps-dev): bump @types/node from 10.14.1 to 10.14.2 (#1036)
  • 5f92fd2 build(deps-dev): bump js-yaml from 3.12.2 to 3.13.0 (#1034)
  • a9c79e9 build(deps-dev): bump @types/yargs from 12.0.9 to 12.0.10 (#1032)
  • 245ab29 build(deps-dev): bump eslint from 5.15.2 to 5.15.3 (#1031)
  • 4e72e59 build(deps-dev): bump eslint from 5.15.1 to 5.15.2 (#1030)
  • fb7dd55 feat(config): specify package.json location (#823) (#1013)
  • 279edcd build(deps-dev): bump tslint from 5.13.1 to 5.14.0 (#1028)
  • 8b93228 build(deps-dev): bump @types/node from 10.12.30 to 10.14.1 (#1027)
  • b825c7f build(deps-dev): bump @types/lodash.memoize from 4.1.4 to 4.1.6 (#1014)
  • 6f0ab80 build(deps-dev): bump @types/lodash.merge from 4.6.5 to 4.6.6 (#1015)

There are 23 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two-Factor Authentication, make configure the auth-only level is supported. semantic-release cannot publish with the default auth-and-writes level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

how about a simple range generator?

I've come from C# and like your project. Couldn't find much out there (in TypeScript) like it - mystified by that! Would love to see just a simple fromRange(start:number, end:number) and maybe fromInfinite() to get me started. Or is there already some way to do that?

An in-range update of file-loader is breaking the build 🚨

The devDependency file-loader was updated from 4.1.0 to 4.2.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

file-loader is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

Release Notes for v4.2.0

4.2.0 (2019-08-07)

Features

Commits

The new version differs by 3 commits.

  • ba0fd4c chore(release): 4.2.0
  • 642ee74 docs: improve readme (#341)
  • c136f44 feat: postTransformPublicPath option (#334)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of semantic-release is breaking the build 🚨

The devDependency semantic-release was updated from 15.13.20 to 15.13.21.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

semantic-release is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

Release Notes for v15.13.21

15.13.21 (2019-08-12)

Bug Fixes

  • package: update hosted-git-info to version 3.0.0 (391af98)
Commits

The new version differs by 3 commits.

  • 391af98 fix(package): update hosted-git-info to version 3.0.0
  • d45d8b6 docs: fix typo
  • 519df0d chore: remove commitizen from our dependencies

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of ts-node is breaking the build 🚨

The devDependency ts-node was updated from 8.0.2 to 8.0.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

ts-node is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

Release Notes for Relative TypeScript

Added

  • Fall back on resolving relative TypeScript packages (normal resolution is from working directory, these two things can be the same in the case of locally installed packages)
Commits

The new version differs by 10 commits.

  • 8706c31 8.0.3
  • d065dd2 Update README note about relative installations
  • 655c43b Fallback on resolving TypeScript relatively (#793)
  • c2ecc7d Add note about local TypeScript to README (#789)
  • 7414752 Update README with triple-slash directive example (#776)
  • efaf67a Add VS Code env note to README (#738)
  • 2609663 Avoid incrementing memory cache unnecessarily
  • b4bdb08 Specify sensitive file names for document registry
  • c215693 Utilize TypeScript sys better for service host
  • 062254f Conditionally enable .[tj]sx extensions

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

why not write transducers?

The synchronous transformation of data has already been solved elegantly with transducers. You can refer to:

Transducers apply equally to iterators and observable. I don't mean this to belittle your effort, I rather want to attract the attention on prior art and not reinventing (redebugging) the wheel.

One possible advantage of your approach may be the typings. Transducers are pretty hard to type both accurately and concisely.

An in-range update of webpack-dev-server is breaking the build 🚨

The devDependency webpack-dev-server was updated from 3.3.0 to 3.3.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

webpack-dev-server is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

Release Notes for v3.3.1

3.3.1 (2019-04-09)

Bug Fixes

  • regression: always get necessary stats for hmr (#1780) (66b04a9)
  • regression: host and port can be undefined or null (#1779) (028ceee)
  • only add entries after compilers have been created (#1774) (b31cbaa)
Commits

The new version differs by 6 commits.

  • 99b78dc chore(release): 3.3.1
  • f10fd68 docs: fix changelog (#1783)
  • b31cbaa fix: only add entries after compilers have been created (#1774)
  • 66b04a9 fix(regression): always get necessary stats for hmr (#1780)
  • 028ceee fix(regression): host and port can be undefined or null (#1779)
  • f5ea174 docs(contribution): alternative way to test (#1506)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of rollup is breaking the build 🚨

The devDependency rollup was updated from 1.4.1 to 1.4.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

rollup is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

Release Notes for v1.4.2

2019-03-07

Bug Fixes

  • Respect variable identity of exports when hashing (#2741)
  • Resolve a situations where a variable was imported twice with the same name (#2737)

Pull Requests

Commits

The new version differs by 6 commits.

  • adaa23e 1.4.2
  • 2d03a67 Update changelog
  • 858fea4 Resolve a situation where different default exports referencing the same (#2737)
  • 6903425 Update changelog
  • af41561 Fix an issue where the same hash was generated when different variables (#2741)
  • d27c0f6 Docs: Fix return type (#2738)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Performance

Hi there,

This library looks interesting and helpful!

I just want to know how chaining works here regarding with the performance. Since chaining creates a temporary array w/c affects performance. That is why using transducer on a massive list is better.

Any thoughts?

[RFC] Implement Except Set Operation

A first-time contributor here! I would love to open up a pull request and implement some stuff! Looks like the except function might be the lowest hanging fruit, so I'd love to take a stab at it.

On the lodash documentation page, the without function uses a signature like this:

const items = _.without(array, ...items);

How about something like this?

const squares = from([1, 2, 3])
  .except(2) // or maybe name it `without` instead?
  .map(e => e * e)
  .toArray();

An in-range update of replace-in-file is breaking the build 🚨

The devDependency replace-in-file was updated from 3.4.3 to 3.4.4.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

replace-in-file is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

Commits

The new version differs by 2 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Small bug in the type of toObject when a key selector is specified

I think there is a small mistake on the type for toObject function when a selector is introduced.

Currently it's this:

toObject(keySelectorFn: MapFn<TItem, string>): StringKeyedObject<TItem>;
toObject(keySelectorFn: MapFn<TItem, number>): NumberKeyedObject<TItem>;
toObject<TElement>(keySelectorFn: MapFn<TItem, string>, elementSelectorFn: MapFn<TItem, TElement>): StringKeyedObject<TItem>;
toObject<TElement>(keySelectorFn: MapFn<TItem, number>, elementSelectorFn: MapFn<TItem, TElement>): NumberKeyedObject<TItem>;

I think the ones with the element selector should have a keyed object of type TElement.

An in-range update of copy-webpack-plugin is breaking the build 🚨

The devDependency copy-webpack-plugin was updated from 5.0.0 to 5.0.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

copy-webpack-plugin is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

Release Notes for v5.0.1

5.0.1 (2019-03-11)

Bug Fixes

  • respect base of glob for context dependencies (#352) (5b407f1)
Commits

The new version differs by 5 commits.

  • a8fc34e chore(release): 5.0.1
  • 91ba939 chore(deps): update (#354)
  • 5b407f1 fix: respect base of glob for context dependencies (#352)
  • ff1a7be docs: improve logLevel option description (#346)
  • d5788db docs: fix a typo in README.md (#344)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of highlight.js is breaking the build 🚨

The devDependency highlight.js was updated from 9.14.2 to 9.15.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

highlight.js is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

[Question]: Are they plans to use a more FP approach?

I don't know how to formulate the question correctly or if it makes sense.

I love the library, but the first thing that came to mind was if it were possible to use function composition with it. Export the transforms as standalone functions waiting for an Iterator and be able to compose transformations. Is this out of the scope?

Example (comopse):

// from the main example
import { compose, filter, sortBy } from 'fromfrom/transforms';

const activeSortedByName = compose(
  sortByDescending(user => user.age),
  filter(user => user.active)
);

const result = activeSortedByName(users).toArray();

Example (pipe):

// from the main example
import { pipe, filter, sortBy, toArray } from 'fromfrom/transforms';

const activeSortedByName = pipe(
  filter(user => user.active),
  sortByDescending(user => user.age),
  toArray
);

const result = activeSortedByName(users);

Aggregate operations with (and without) groupBy

Hi, I was wondering if there are any plans to add basic aggregate operators, i.e sum, avg, min, max, etc, for a whole collection or as part of a groupBy operation?

Alternatively do you have any suggestions on how to efficiently implement per group aggregation? So far I've come up with this (from your playground examples), but perhaps there's a better approach:

import { from } from "fromfrom";
import data from "./data";

const result = from(data)
  .groupBy(u => u.country)
  .toObject(
    g => g.key,
    g => ({
      items: g.items,
      count: g.items.length,
      sum: g.items.reduce((s, i) => s + i.score, 0),
      avg: g.items.reduce((s, i) => s + i.score, 0) / g.items.length,
      min: g.items.reduce((s, i) => Math.min(s, i.score), Infinity),
      max: g.items.reduce((s, i) => Math.max(s, i.score), -Infinity),
    })
  );

P.s: In case you are interested, I've pitted a number of similar libs and fromfrom consistently comes on top in terms of perf (atleast in Firefox, other browsers are temperamental): https://codesandbox.io/s/angry-wind-zu0gj

The fact that it is also the smallest in size, 100% coverage, type-safe, is admirable.

[Questions] Working with deep nested data and arrays of parameters

Hi,
Thanks for making this library - it looks promising as I'm just creating a project that could use extensive search/filter/morph of data. I'm not a pro dev, so below will be few points from that perspective

  1. I went through documentation but it's written in TS often without practical use examples. This makes it hard to figure out how am I supposed to use each transform. Would you consider providing code examples in documentation akin to how, for example, Lodash does theirs for every transformation?

  2. I've noticed your usage examples on Playground show working with flat data. If I have some objects nested few levels deep, would you expect me to manually destructure object tree and then feed each branch to fromfrom transforms? Ideally I would like to filter the entire object tree in one operation (see example mockup object https://pastebin.com/icBgpV5c), and for example if I want to do .filter(color: "green") and get as output new object with only branches that end with a color: "green" (expected: https://pastebin.com/a8qUnPp0). Could you give example of how you envision a workflow of operations when working with nested data like this? I'm most interested in .filter .sort .groupBy .find .pick

  3. How do you envision us doing operations with multiple parameters/conditions? Let's say I want to filter by two colours and have my filter parameters stored in separate array. Would doing it like this be the best way?:

const fndcolours = ["red", "green"];

from(data)
 .filter(user => fndcolours.includes(user.color))
  .toArray();

Thanks again

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.