How to use the prelude-ls.reject function in prelude-ls

To help you get started, we’ve selected a few prelude-ls examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ionutvmi / sublime-jsfmt / node_modules / optionator / lib / parse-type.js View on Github external
(function(){
  var reject, tokenRegex;
  reject = require('prelude-ls').reject;
  function consumeWord(tokens){
    var token;
    token = tokens[0];
    if (!(token != null && /^[a-zA-Z]+$/.test(token))) {
      throw new Error("Exected textual string.");
    }
    return tokens.shift();
  }
  function consumeOp(tokens, op){
    var token;
    token = tokens[0];
    if (token !== op) {
      throw new Error("Expected " + op);
    }
    return tokens.shift();
  }
github ionutvmi / sublime-jsfmt / node_modules / levn / lib / parse.js View on Github external
(function(){
  var reject, special, tokenRegex;
  reject = require('prelude-ls').reject;
  function consumeOp(tokens, op){
    if (tokens[0] === op) {
      return tokens.shift();
    } else {
      throw new Error("Expected '" + op + "', but got '" + tokens[0] + "' instead in " + JSON.stringify(tokens) + ".");
    }
  }
  function maybeConsumeOp(tokens, op){
    if (tokens[0] === op) {
      return tokens.shift();
    }
  }
  function consumeList(tokens, delimiters, hasDelimiters){
    var result;
    if (hasDelimiters) {
      consumeOp(tokens, delimiters[0]);
github ionutvmi / sublime-jsfmt / node_modules / levn / lib / parse-string.js View on Github external
(function(){
  var reject, special, tokenRegex;
  reject = require('prelude-ls').reject;
  function consumeOp(tokens, op){
    if (tokens[0] === op) {
      return tokens.shift();
    } else {
      throw new Error("Expected '" + op + "', but got '" + tokens[0] + "' instead in " + JSON.stringify(tokens) + ".");
    }
  }
  function maybeConsumeOp(tokens, op){
    if (tokens[0] === op) {
      return tokens.shift();
    }
  }
  function consumeList(tokens, arg$, hasDelimiters){
    var open, close, result, untilTest;
    open = arg$[0], close = arg$[1];
    if (hasDelimiters) {

prelude-ls

prelude.ls is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, LiveScript.

MIT
Latest version published 5 years ago

Package Health Score

70 / 100
Full package analysis

Popular prelude-ls functions