-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
347 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
import {defineConfig} from 'rollup'; | ||
import typescript from '@rollup/plugin-typescript'; | ||
import pkg from './package.json'; | ||
|
||
export default { | ||
input: 'src/index.js', | ||
external: ['stream-parser'], | ||
export default defineConfig({ | ||
input: 'src/index.ts', | ||
external: ['stream-parser', 'stream'], | ||
plugins: [typescript({tsconfig: './tsconfig.json'})], | ||
output: [ | ||
{ file: pkg.main, format: 'cjs' }, | ||
{ file: pkg.module, format: 'es' } | ||
] | ||
}; | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export {AcbStreamDecoder} from './lib/decoder'; | ||
export {encodeAcb} from './lib/encoder'; | ||
export type {ColorSpace, Color, ColorBook} from './lib/types'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
export function fromAscii(value: string) { | ||
return Buffer.from(value, 'ascii'); | ||
} | ||
|
||
export function fromUInt16BE(value: number) { | ||
const chunk = Buffer.allocUnsafe(2); | ||
chunk.writeUInt16BE(value); | ||
return chunk; | ||
} | ||
|
||
export function fromUInt32BE(value: number) { | ||
const chunk = Buffer.allocUnsafe(4); | ||
chunk.writeUInt32BE(value); | ||
return chunk; | ||
} | ||
|
||
export function fromString(value: string) { | ||
const chunk = Buffer.allocUnsafe(4 + value.length * 2); | ||
chunk.write(value, 4, 'utf16le'); | ||
chunk.swap16(); | ||
chunk.writeUInt32BE(value.length); | ||
return chunk; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.