Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rauschma/helpers

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rauschma/helpers - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

2

dist/src/lang/regexp.d.ts
export declare enum MatchMode {
/** No gaps between matches */
AtLastIndex = "AtLastIndex",
/** There can be gaps between matches */
AtLastIndexOrLater = "AtLastIndexOrLater"

@@ -4,0 +6,0 @@ }

8

dist/src/lang/regexp.js
const { raw } = String;
export var MatchMode;
(function (MatchMode) {
/** No gaps between matches */
MatchMode["AtLastIndex"] = "AtLastIndex";
/** There can be gaps between matches */
MatchMode["AtLastIndexOrLater"] = "AtLastIndexOrLater";

@@ -11,3 +13,3 @@ })(MatchMode || (MatchMode = {}));

if (!regExp.sticky) {
throw new TypeError(`If flag /y is not set, matching ${matchMode} won’t work: ${regExp}`);
throw new TypeError(`Flag /y must be set for matching ${matchMode}: ${regExp}`);
}

@@ -17,6 +19,6 @@ break;

if (!regExp.global) {
throw new TypeError(`If flag /g is not set, matching ${matchMode} won’t work: ${regExp}`);
throw new TypeError(`Flag /g must be set for matching ${matchMode}: ${regExp}`);
}
if (regExp.sticky) {
throw new TypeError(`If flag /y is set, matching ${matchMode} won’t work: ${regExp}`);
throw new TypeError(`Flag /y must be set for matching ${matchMode}: ${regExp}`);
}

@@ -23,0 +25,0 @@ break;

@@ -21,3 +21,3 @@ /**

export declare function assertTrue(value: boolean, message?: string): asserts value;
export declare function assertNonNullable<T>(value: T): asserts value is NonNullable<T>;
export declare function assertNonNullable<T>(value: T, message?: string): asserts value is NonNullable<T>;
type TypeofLookupTable = {

@@ -24,0 +24,0 @@ 'undefined': undefined;

@@ -29,5 +29,6 @@ //#################### Class ####################

}
export function assertNonNullable(value) {
export function assertNonNullable(value, message) {
if (value === undefined || value === null) {
throw new TypeError('Value must not be undefined or null');
message ??= 'Value must not be undefined or null';
throw new TypeError('Failed: ' + message);
}

@@ -34,0 +35,0 @@ }

{
"name": "@rauschma/helpers",
"version": "0.1.0",
"version": "0.2.0",
"type": "module",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/rauschma/helpers.git"
},
"author": "Axel Rauschmayer",
"repository": "github:rauschma/helpers",
"license": "MIT",
"exports": {

@@ -36,2 +39,3 @@ "./*": "./dist/src/*"

"scripts": {
"\n========== Building ==========": "",
"build": "npm run clean && tsc",

@@ -44,5 +48,5 @@ "watch": "tsc --watch",

"\n========== Publishing ==========": "",
"dry-run": "npm publish --dry-run",
"prepublishOnly": "npm run build",
"pack": "npm pack && tar --list --file rauschma-helpers-*.tgz"
"publishd": "npm publish --dry-run",
"packd": "npm pack --dry-run"
},

@@ -49,0 +53,0 @@ "devDependencies": {

const {raw} = String;
export enum MatchMode {
/** No gaps between matches */
AtLastIndex = 'AtLastIndex',
/** There can be gaps between matches */
AtLastIndexOrLater = 'AtLastIndexOrLater',

@@ -12,3 +14,3 @@ }

if (!regExp.sticky) {
throw new TypeError(`If flag /y is not set, matching ${matchMode} won’t work: ${regExp}`);
throw new TypeError(`Flag /y must be set for matching ${matchMode}: ${regExp}`);
}

@@ -18,6 +20,6 @@ break;

if (!regExp.global) {
throw new TypeError(`If flag /g is not set, matching ${matchMode} won’t work: ${regExp}`);
throw new TypeError(`Flag /g must be set for matching ${matchMode}: ${regExp}`);
}
if (regExp.sticky) {
throw new TypeError(`If flag /y is set, matching ${matchMode} won’t work: ${regExp}`);
throw new TypeError(`Flag /y must be set for matching ${matchMode}: ${regExp}`);
}

@@ -24,0 +26,0 @@ break;

@@ -48,5 +48,6 @@ //#################### Class ####################

export function assertNonNullable<T>(value: T): asserts value is NonNullable<T> {
export function assertNonNullable<T>(value: T, message?: string): asserts value is NonNullable<T> {
if (value === undefined || value === null) {
throw new TypeError('Value must not be undefined or null');
message ??= 'Value must not be undefined or null';
throw new TypeError('Failed: ' + message);
}

@@ -53,0 +54,0 @@ }

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc