Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ jobs:
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures

# Explicit build is required: the repo's .npmrc sets `ignore-scripts=true`, which
# suppresses every lifecycle hook — including `prepublishOnly` — during `npm publish`.
# Without this step semantic-release packs an empty `dist/` and ships a broken tarball
# (the cause of the 1.0.0/1.0.1 ERR_MODULE_NOT_FOUND). An explicit `npm run` still
# executes under ignore-scripts, so dependency install scripts stay disabled.
- name: Build
run: npm run build

- name: Create new release
uses: cycjimmy/semantic-release-action@v6
id: semantic
Expand Down
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,20 +177,16 @@ const registry: RegisteredUser[] = []

async function processUserRegistration(input: unknown): Promise<RegisteredUser> {
const data = input as any
if (!data.email || typeof data.email !== 'string') throw new Error('email is required')
if (!data.password || typeof data.password !== 'string') throw new Error('password is required')
const email = data.email.trim().toLowerCase()
if (!email.includes('@')) throw new Error('invalid email')
if (!data.email || typeof data.email !== 'string') throw new Error('email is required');
if (!data.password || typeof data.password !== 'string') throw new Error('password is required');
const email = data.email.trim().toLowerCase();
if (!email.includes('@')) throw new Error('invalid email');
let hash = ''
for (const character of data.password) {
if (typeof character === 'string') {
hash = hash + String(character.charCodeAt(0) * 31 % 255)
}
if (typeof character === 'string') { hash = hash + String(character.charCodeAt(0) * 31 % 255); }
}
for (const existing of registry) {
if (existing.email === email) {
throw new Error('email already registered')
}
if (existing.email === email) { throw new Error('email already registered'); }
}
const user = { id: String(registry.length + 1), email, passwordHash: hash }
registry.push(user)
Expand Down
Loading