New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ciam-commons

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ciam-commons - npm Package Compare versions

Comparing version 1.3.0 to 1.4.1

2

dist/main.d.ts
export declare namespace Check {
const objectIdRegex: RegExp;
const discordIdRegex: RegExp;
const flagRegex: RegExp;
const strictFlagRegex: RegExp;
function objectId(id: string, message?: string): void;
function discordId(id: string, message?: string): void;
function flag(flag: string, message?: string): void;

@@ -7,0 +9,0 @@ function strictFlag(flag: string, message?: string): void;

export var Check;
(function (Check) {
Check.objectIdRegex = /[a-f0-9]{24}/;
Check.discordIdRegex = /\d{16,20}/;
Check.flagRegex = /^(?:([a-z0-9]+|\?)(?:\.(?:[a-z0-9]+|\?))*(\.\*)?|\*)$/;

@@ -11,2 +12,7 @@ Check.strictFlagRegex = /^[a-z0-9]+(\.[a-z0-9]+)*$/;

Check.objectId = objectId;
function discordId(id, message = 'Invalid discordId') {
if (!id.match(Check.discordIdRegex))
throw new Error(`${message} "${id}"`);
}
Check.discordId = discordId;
function flag(flag, message = 'Invalid permission flag') {

@@ -13,0 +19,0 @@ if (!flag.match(Check.flagRegex))

2

package.json
{
"name": "ciam-commons",
"version": "1.3.0",
"version": "1.4.1",
"description": "Common types and functions for CIAM",

@@ -5,0 +5,0 @@ "scripts": {

export namespace Check {
export const objectIdRegex: RegExp = /[a-f0-9]{24}/;
export const discordIdRegex: RegExp = /\d{16,20}/;
export const flagRegex: RegExp = /^(?:([a-z0-9]+|\?)(?:\.(?:[a-z0-9]+|\?))*(\.\*)?|\*)$/;

@@ -11,2 +12,6 @@ export const strictFlagRegex: RegExp = /^[a-z0-9]+(\.[a-z0-9]+)*$/;

export function discordId(id: string, message: string = 'Invalid discordId') {
if (!id.match(discordIdRegex)) throw new Error(`${message} "${id}"`);
}
export function flag(flag: string, message: string = 'Invalid permission flag') {

@@ -13,0 +18,0 @@ if (!flag.match(flagRegex)) throw new Error(`${message} "${flag}"`);

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