Skip to content

Commit

Permalink
Move isRecord back into the one place it is used
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHahn committed Feb 22, 2024
1 parent 3febedc commit aaf0af5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 38 deletions.
9 changes: 8 additions & 1 deletion src/config-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import yauzl from 'yauzl-promise'
import { validate, valueSchemas } from '@mapeo/schema'
import { json, buffer } from 'node:stream/consumers'
import path from 'node:path'
import { isRecord } from './lib/object.js'

// Throw error if a zipfile contains more than 10,000 entries
const MAX_ENTRIES = 10_000
Expand Down Expand Up @@ -258,6 +257,14 @@ function validatePresetsFile(presetsFile) {
}
}

/**
* @param {unknown} value
* @returns {value is Record<string, unknown>}
*/
function isRecord(value) {
return value !== null && typeof value === 'object' && !Array.isArray(value)
}

/**
* @param {Record<string | symbol, unknown>} obj
* @param {string | symbol} prop
Expand Down
9 changes: 0 additions & 9 deletions src/lib/object.js

This file was deleted.

28 changes: 0 additions & 28 deletions tests/lib/object.js

This file was deleted.

0 comments on commit aaf0af5

Please sign in to comment.