Using spaces is WAY better for your career.

This is because in JavaScript, there is a HEAVY perception bias against tab users.

Most ES6 developers look down on anyone who uses tabs.
This could easily mean the difference between getting a job offer and being rejected.
It could mean tens of thousands of dollars of salary potential.

https://medium.com/mintbean-io/tabs-or-spaces-for-practical-javascript-developers-the-answer-is-clear-f66c0458aa1e
This commit is contained in:
Luke Curley 2023-05-22 21:49:02 -07:00
parent cc8792da09
commit 7843f8b0e4
29 changed files with 1366 additions and 1387 deletions

View File

@ -1,5 +1,3 @@
{
"useTabs": true,
"tabWidth": 4,
"semi": false
}

View File

@ -226,11 +226,7 @@ declare module "mp4box" {
init(options?: FileOptions): ISOFile
addTrack(options?: TrackOptions): number
addSample(
track: number,
data: ArrayBuffer,
options?: SampleOptions
): Sample
addSample(track: number, data: ArrayBuffer, options?: SampleOptions): Sample
createSingleSampleMoof(sample: Sample): Box

View File

@ -91,11 +91,7 @@ export default class Decoder {
const avcc = sample.description.avcC
if (!avcc) throw new Error("TODO only h264 is supported")
const description = new MP4.Stream(
new Uint8Array(avcc.size),
0,
false
)
const description = new MP4.Stream(new Uint8Array(avcc.size), 0, false)
avcc.write(description)
const videoDecoder = new VideoDecoder({

View File

@ -3,10 +3,7 @@ export default class Reader {
reader: ReadableStream
buffer: Uint8Array
constructor(
reader: ReadableStream,
buffer: Uint8Array = new Uint8Array(0)
) {
constructor(reader: ReadableStream, buffer: Uint8Array = new Uint8Array(0)) {
this.reader = reader
this.buffer = buffer
}
@ -41,9 +38,7 @@ export default class Reader {
if (this.buffer.byteLength == 0) {
this.buffer = buffer
} else {
const temp = new Uint8Array(
this.buffer.byteLength + buffer.byteLength
)
const temp = new Uint8Array(this.buffer.byteLength + buffer.byteLength)
temp.set(this.buffer)
temp.set(buffer, this.buffer.byteLength)
this.buffer = temp
@ -72,9 +67,7 @@ export default class Reader {
if (this.buffer.byteLength == 0) {
this.buffer = buffer
} else {
const temp = new Uint8Array(
this.buffer.byteLength + buffer.byteLength
)
const temp = new Uint8Array(this.buffer.byteLength + buffer.byteLength)
temp.set(this.buffer)
temp.set(buffer, this.buffer.byteLength)
this.buffer = temp
@ -110,9 +103,7 @@ export default class Reader {
if (this.buffer.byteLength == 0) {
this.buffer = buffer
} else {
const temp = new Uint8Array(
this.buffer.byteLength + buffer.byteLength
)
const temp = new Uint8Array(this.buffer.byteLength + buffer.byteLength)
temp.set(this.buffer)
temp.set(buffer, this.buffer.byteLength)
this.buffer = temp

View File

@ -75,9 +75,7 @@ export default class Transport {
if (typ != "warp") throw "expected warp atom"
if (size < 8) throw "atom too small"
const payload = new TextDecoder("utf-8").decode(
await r.bytes(size - 8)
)
const payload = new TextDecoder("utf-8").decode(await r.bytes(size - 8))
const msg = JSON.parse(payload)
if (msg.init) {