Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
Andrey Mikhaylov (lolmaus)

@koistya validator seems to be only for strings? My goal is a universal assertion library with extremely agile syntax (e. g. you can use and, or, satisfy, etc.) and automatically generated error messages (with optional manually provided messages).

I'm not aware of an assertion library that can do this:

Assertron({name}, {           // Uses key in error messages, e. g. "name must be of length between 5 and 7, was 9"
  optional: true,             // Will not perform checks if the value is undefined
  length:   {min: 5, max: 7}, // For a POJO will count own keys.
  or: {                       // Will be true if one of the requirements is true. Keys mean type checks.
    string: {match:         /foo|bar/},
    array:  {containsOneOf: ['foo', 'bar']},
    object: {hasOneOfKeys:  ['foo', 'bar']}

Imagine writing that in Chai or validator or whatever assertion library you like the most. you'll end up with nested ifs, it will look terrible and unreadable. And the necessity to wrap it into dev-expression makes it even worse.

Andrey Mikhaylov (lolmaus)
@koistya Whatcha say?
Konstantin Tarkus
@lolmaus something similar to what used in React (PropTypes)?
Andrey Mikhaylov (lolmaus)

@koistya Probably, except for my approach is not limited to checking types. You can add whatever checks you want.

I draw inspiration from this library's assertions collection and plugins: http://unexpected.js.org/assertions/any/to-be/

I don't use Chai and Unexpected because their API is method chaining, and method chaining:

  • does not allow the or operand;
  • does not allow swapping the main assertion object with a noop.

I find a JSON-like API to be the most powerful.

What do you think?
Konstantin Tarkus
Andrey Mikhaylov (lolmaus)
@koistya Any news on debugging babel-starter-kit modules in Chrome?
Konstantin Tarkus
@lolmaus I'm not sure if it's a good idea to include that into the kit, maybe on a separate branch..
@lolmaus it might depend to much on what exactly you're building... e.g. if you're developing React components, it might be a great idea to use react-storybook for testing in a browser
Andrey Mikhaylov (lolmaus)
@koistya I'm building a generic library, useful in both Node and browser.
And I HATE developing with terminal output as the only way of debugging.
Francisco Pena
Any one can help me with this
Joel Alejandro Villarreal Bertoldi
Hey there, just left a PR for an issue I discovered with a colleague in package.json: kriasoft/babel-starter-kit#100
Andrey Mikhaylov (lolmaus)
@bala020304 Sending to every channel out of desperation?
Mitch Zelmanovich
I just want to use babel so I can use import and export in node js
but it appears not to be working
any assistance i coudl get would be great
Andrey Mikhaylov (lolmaus)
@mzelmanovich In order to receive help, you must be very specific and explicit about your issue.
Robert Butler
so can I use this from a simple html file that includes the correct scripts and everything?
Kirk Kohler
off topic but searching the net I stumbled here.
anyone know if "web-starter-kit" by google is a dead project?
suggestions on the "replacement." not sure I need react, angular for a 1 page website i'm trying to create
Is this repo still alive?
Andrey Mikhaylov (lolmaus)
@vinaybedre Doesn't look like it. No contributions for over a year.
Vladimir Kutepov
would be nice to update it but maybe it make sense to wait babel 7 release

Hi, I use babel but eslint shows error 'Unexpected token :' here:

function feature (features: string | Array<string>)

How to learn Eslint that is is es6 syntax ?

Vladimir Kutepov
but it is not valid javascript syntax, probably it is flow or typescript
Marco Faustinelli
Very naive question... I am writing a library that will run in browsers. AFAIS the formats created by babel-start-kit are all meant for server-side libraries.
Or am I wrong?
Marco Faustinelli
OK, using the umd version
but stil... I cannot see how the final "exports" is made available in the global namespace
last line in my es6 index.js is: export crosspromo from './crosspromo.js';

in the umd file it gets translated to

exports.crosspromo = crosspromo$1;
Object.defineProperty(exports, '__esModule', { value: true });

I see there is a window.exports object
but it's empty
can you see where I am doing wrong?
Marco Faustinelli
found the answer
please disregard
Christian Ahidjo
hi there, I'm using babel 7 and webpack. I would like to transform arrow function so that IE 11 doesn't throw any syntax error here are my configs http://jsbin.com/cikeluzequ/edit?js
Andrey Mikhaylov (lolmaus)
Wow, open source spam.