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

morse-player

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

morse-player - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

2

lib/libs/actions.d.ts

@@ -5,2 +5,3 @@ export declare function set(value: Record<string, any>): Record<string, any>;

export declare function scramble(action: Record<string, any>): string[];
export declare function callsign(action: Record<string, any>): string;
export declare function states(): string[];

@@ -10,2 +11,1 @@ export declare function letters(): string[];

export declare function alphanumeric(): string[];
export declare function callsign(min: number, max: number): string;

@@ -1,6 +0,5 @@

import { scrambleList, randomEntry, toList, toNumber, countMap } from './utils';
import { scrambleList, randomEntry, randCallsign, toList, toNumber, countMap } from './utils';
import { states as stateList } from '../resources/states';
import { letters as letterList } from '../resources/letters';
import { numbers as numberList } from '../resources/numbers';
import { ALPHA, NUMERIC, CALLSIGN_FORMATS } from '../resources/lists';
export function set(value) {

@@ -37,2 +36,7 @@ return value;

}
export function callsign(action) {
const min = parseInt(action.min, 10) || 0;
const max = parseInt(action.max, 10) || 0;
return randCallsign(min, max);
}
export function states() {

@@ -51,9 +55,1 @@ return stateList.map(state => state.value.toLowerCase());

}
export function callsign(min, max) {
return randomEntry(CALLSIGN_FORMATS.filter(format => format.length >= min && format.length <= max))
.split('')
.map(format => randomEntry(format === 'L'
? ALPHA
: NUMERIC))
.join('');
}

@@ -73,6 +73,9 @@ import { CALLSIGN_FORMATS, ALPHA, NUMERIC } from "../resources/lists";

}
return randomEntry(CALLSIGN_FORMATS.filter(format => format.length >= min && format.length <= max))
return randomEntry(CALLSIGN_FORMATS.filter(format => format.length >= min
&& format.length <= max))
.split('')
.map(format => randomEntry(format === 'L' ? ALPHA : NUMERIC))
.map(format => randomEntry(format === 'L'
? ALPHA :
NUMERIC))
.join('');
}

@@ -71,2 +71,14 @@ import { describe, expect, test } from '@jest/globals';

});
test('renders: [callsign min:? max:?]', () => {
const v1 = render('[callsign min:3 max:6]').join('');
expect(v1.length).toBeGreaterThanOrEqual(3);
expect(v1.length).toBeLessThanOrEqual(6);
expect(v1).toMatch(/^[A-Z]{1,2}\d[A-Z]{1,3}$/);
const v2 = render('[callsign min:3 max:3]').join('');
expect(v2.length).toEqual(3);
expect(v2).toMatch(/^[A-Z]{1}\d[A-Z]{1}$/);
const v3 = render('[callsign min:6 max:6]').join('');
expect(v3.length).toEqual(6);
expect(v3).toMatch(/^[A-Z]{2}\d[A-Z]{3}$/);
});
});
{
"name": "morse-player",
"version": "1.0.7",
"version": "1.0.8",
"description": "Browser morse code audio player",

@@ -5,0 +5,0 @@ "author": "Andrew Bunker",

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