Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
19 lines
567 B
Plaintext
19 lines
567 B
Plaintext
'use strict';
|
|
|
|
// lib/types/utils.ts
|
|
var decoder = new TextDecoder();
|
|
var toUTF8String = (input, start = 0, end = input.length) => decoder.decode(input.slice(start, end));
|
|
var getView = (input, offset) => new DataView(input.buffer, input.byteOffset + offset);
|
|
var readUInt32BE = (input, offset = 0) => getView(input, offset).getUint32(0, false);
|
|
|
|
// lib/types/psd.ts
|
|
var PSD = {
|
|
validate: (input) => toUTF8String(input, 0, 4) === "8BPS",
|
|
calculate: (input) => ({
|
|
height: readUInt32BE(input, 14),
|
|
width: readUInt32BE(input, 18)
|
|
})
|
|
};
|
|
|
|
exports.PSD = PSD;
|