🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

nth-check

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nth-check - npm Package Compare versions

Comparing version

to
2.1.1

9

lib/compile.js
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.generate = exports.compile = void 0;
var boolbase_1 = require("boolbase");
var boolbase_1 = __importDefault(require("boolbase"));
/**

@@ -37,3 +40,3 @@ * Returns a function that checks if an elements index matches the given rule

if (b < 0 && a <= 0)
return boolbase_1.falseFunc;
return boolbase_1.default.falseFunc;
// When `a` is in the range -1..1, it matches any element (so only `b` is checked).

@@ -46,3 +49,3 @@ if (a === -1)

if (a === 1)
return b < 0 ? boolbase_1.trueFunc : function (index) { return index >= b; };
return b < 0 ? boolbase_1.default.trueFunc : function (index) { return index >= b; };
/*

@@ -49,0 +52,0 @@ * Otherwise, modulo can be used to check if there is a match.

@@ -1,2 +0,2 @@

import { trueFunc, falseFunc } from "boolbase";
import boolbase from "boolbase";
/**

@@ -34,3 +34,3 @@ * Returns a function that checks if an elements index matches the given rule

if (b < 0 && a <= 0)
return falseFunc;
return boolbase.falseFunc;
// When `a` is in the range -1..1, it matches any element (so only `b` is checked).

@@ -43,3 +43,3 @@ if (a === -1)

if (a === 1)
return b < 0 ? trueFunc : (index) => index >= b;
return b < 0 ? boolbase.trueFunc : (index) => index >= b;
/*

@@ -46,0 +46,0 @@ * Otherwise, modulo can be used to check if there is a match.

@@ -1,3 +0,3 @@

import { parse } from "./parse";
import { compile, generate } from "./compile";
import { parse } from "./parse.js";
import { compile, generate } from "./compile.js";
export { parse, compile, generate };

@@ -4,0 +4,0 @@ /**

@@ -1,3 +0,3 @@

import { parse } from "./parse";
import { compile, generate } from "./compile";
import { parse } from "./parse.js";
import { compile, generate } from "./compile.js";
export { parse, compile, generate };

@@ -4,0 +4,0 @@ /**

@@ -1,3 +0,3 @@

import { parse } from "./parse";
import { compile, generate } from "./compile";
import { parse } from "./parse.js";
import { compile, generate } from "./compile.js";
export { parse, compile, generate };

@@ -4,0 +4,0 @@ /**

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sequence = exports.generate = exports.compile = exports.parse = void 0;
var parse_1 = require("./parse");
Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return parse_1.parse; } });
var compile_1 = require("./compile");
Object.defineProperty(exports, "compile", { enumerable: true, get: function () { return compile_1.compile; } });
Object.defineProperty(exports, "generate", { enumerable: true, get: function () { return compile_1.generate; } });
var parse_js_1 = require("./parse.js");
Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return parse_js_1.parse; } });
var compile_js_1 = require("./compile.js");
Object.defineProperty(exports, "compile", { enumerable: true, get: function () { return compile_js_1.compile; } });
Object.defineProperty(exports, "generate", { enumerable: true, get: function () { return compile_js_1.generate; } });
/**

@@ -33,3 +33,3 @@ * Parses and compiles a formula to a highly optimized function.

function nthCheck(formula) {
return (0, compile_1.compile)((0, parse_1.parse)(formula));
return (0, compile_js_1.compile)((0, parse_js_1.parse)(formula));
}

@@ -68,5 +68,5 @@ exports.default = nthCheck;

function sequence(formula) {
return (0, compile_1.generate)((0, parse_1.parse)(formula));
return (0, compile_js_1.generate)((0, parse_js_1.parse)(formula));
}
exports.sequence = sequence;
//# sourceMappingURL=index.js.map
{
"name": "nth-check",
"version": "2.1.0",
"version": "2.1.1",
"description": "Parses and compiles CSS nth-checks to highly optimized functions.",

@@ -70,3 +70,6 @@ "author": "Felix Boehm <me@feedic.com>",

"preset": "ts-jest",
"testEnvironment": "node"
"testEnvironment": "node",
"moduleNameMapper": {
"^(.*)\\.js$": "$1"
}
},

@@ -73,0 +76,0 @@ "prettier": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet