Skip to content

Commit

Permalink
v0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
taichunmin committed Apr 16, 2024
1 parent 0c28169 commit 2ac96ad
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@ Use jsdelivr CDN to include the package.
```html
<!-- script -->
<script src="https://cdn.jsdelivr.net/npm/@taichunmin/buffer@0/dist/buffer.global.js"></script>
<script>
const { Buffer } = window?.taichunmin?.buffer
</script>
<!-- module -->
<script type="module">
import { Buffer } from 'https://cdn.jsdelivr.net/npm/@taichunmin/buffer@0/dist/buffer.global.js'
</script>
<!-- module + importmap -->
<!-- importmap + module -->
<script type="importmap">
{
"imports": {
Expand Down
2 changes: 1 addition & 1 deletion lib/buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export interface EnumLike {
[nu: number]: string
}

export function createIsEnum <T extends EnumLike> (e: T): (val: any) => val is T[keyof T] {
function createIsEnum <T extends EnumLike> (e: T): (val: any) => val is T[keyof T] {
const ev = new Set(_.chain(e).toPairs().filter(([k, v]) => !_.isNumber(e[v])).map(1).value())
return (val: any): val is T[keyof T] => ev.has(val)
}
Expand Down
2 changes: 1 addition & 1 deletion tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default defineConfig((options) => ({
dts: true,
entry: ['lib/buffer.ts'],
format: ['cjs', 'esm', 'iife'],
globalName: 'Buffer',
globalName: 'taichunmin.buffer',
keepNames: true,
minify: !options.watch,
sourcemap: true,
Expand Down

0 comments on commit 2ac96ad

Please sign in to comment.