Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: aegir types generation #7

Merged
merged 2 commits into from
Dec 18, 2020
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
2 changes: 1 addition & 1 deletion concat.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Returns a new Uint8Array created by concatenating the passed ArrayLikes
*
* @param {Array<ArrayLike<number>>} arrays
* @param {Number} length
* @param {Number} [length]
* @returns {Uint8Array}
*/
function concat (arrays, length) {
Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"author": "Alex Potsides <alex@achingbrain.net>",
"homepage": "https://github.com/achingbrain/uint8arrays",
"bugs": "https://github.com/achingbrain/uint8arrays/issues",
"types": "dist/src/index.d.ts",
"typesVersions": {
"*": { "*": ["dist/*", "dist/*/index"] }
},
"files": [
"compare.js",
"concat.js",
Expand All @@ -28,15 +32,15 @@
"release": "aegir release --docs",
"release-minor": "aegir release --type minor --docs",
"release-major": "aegir release --type major --docs",
"build": "aegir build"
"build": "aegir build && aegir ts"
},
"license": "MIT",
"dependencies": {
"multibase": "^3.0.0",
"web-encoding": "^1.0.2"
"web-encoding": "^1.0.5"
},
"devDependencies": {
"aegir": "^25.0.0"
"aegir": "^29.2.0"
},
"contributors": [
"achingbrain <alex@achingbrain.net>"
Expand Down
2 changes: 1 addition & 1 deletion test/from-string.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { TextEncoder } = require('web-encoding')
describe('Uint8Array fromString', () => {
it('creates a Uint8Array from a string', () => {
const str = 'hello world'
const arr = new TextEncoder('utf8').encode(str)
const arr = new TextEncoder().encode(str)

expect(fromString(str)).to.deep.equal(arr)
})
Expand Down
2 changes: 1 addition & 1 deletion test/to-string.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { TextEncoder } = require('web-encoding')
describe('Uint8Array toString', () => {
it('creates a String from a Uint8Array', () => {
const str = 'hello world'
const arr = new TextEncoder('utf8').encode(str)
const arr = new TextEncoder().encode(str)

expect(toString(arr)).to.deep.equal(str)
})
Expand Down
10 changes: 10 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./node_modules/aegir/src/config/tsconfig.aegir.json",
"compilerOptions": {
"outDir": "dist"
},
"include": [
"test", // remove this line if you don't want to type-check tests
"."
]
}