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
34 changes: 33 additions & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,39 @@
"prerelease": true
}
],
"plugins": [["@semantic-release/npm"], ["@semantic-release/github"]],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"releaseRules": [
{
"type": "breaking",
"release": "major"
},
{
"type": "feat",
"release": "minor"
},
{
"type": "fix",
"release": "patch"
},
{
"type": "perf",
"release": "patch"
},
{
"subject": "*",
"release": "patch"
}
]
}
],
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github"
],
"dryRun": false,
"ci": true
}
7 changes: 4 additions & 3 deletions src/index.serverless.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
// Lightweight serverless version - requires resource loading at runtime
export * from 'libphonenumber-js'

import { type Document, deserialize } from 'bson'
import type { PhoneNumber } from 'libphonenumber-js'
import { type LRU, lru } from 'tiny-lru'
import type { CarrierLocale, GeocoderLocale } from './locales'
import { deserialize, type Document } from 'bson'
import { lru, type LRU } from 'tiny-lru'

const DEFAULT_CACHE_SIZE = 100
let codeDataCache: LRU<Document> = lru<Document>(DEFAULT_CACHE_SIZE)

// Resource loader interface - platforms must implement this
export interface ResourceLoader {
loadResource(path: string): Promise<Uint8Array | null>

loadResourceSync?(path: string): Uint8Array | null
}

Expand Down