Skip to content

Commit

Permalink
feat: doc-info 마이그레이션
Browse files Browse the repository at this point in the history
  • Loading branch information
hahnlee committed Apr 12, 2024
1 parent 357b9da commit 959beef
Show file tree
Hide file tree
Showing 25 changed files with 1,588 additions and 518 deletions.
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "all"
}
2 changes: 1 addition & 1 deletion packages/parser/src/__tests__/parse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('parse', () => {
})

it('should parse collect sectionNumber', () => {
assert.strictEqual(hwpDocument.info.sectionSize, 1)
assert.strictEqual(hwpDocument.info.properties.sections, 1)
})

it('should be collect page size', () => {
Expand Down
320 changes: 0 additions & 320 deletions packages/parser/src/doc-info-parser.ts

This file was deleted.

3 changes: 2 additions & 1 deletion packages/parser/src/models/controls/element-properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ export class Outline {

const attribute = reader.readUInt32()
const kind = mapBorderKind(getBitValue(attribute, 0, 5))
const defaultCap = ctrlId === CommonCtrlID.Picture ? EndCap.Round : EndCap.Flat
const defaultCap =
ctrlId === CommonCtrlID.Picture ? EndCap.Round : EndCap.Flat
const endCap = mapEndCap(getBitValue(attribute, 6, 9)) || defaultCap
const headStyle = mapArrowStyle(getBitValue(attribute, 10, 15))
const tailStyle = mapArrowStyle(getBitValue(attribute, 16, 21))
Expand Down
4 changes: 3 additions & 1 deletion packages/parser/src/models/controls/shapes/picture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ export class PictureEffect {
static fromReader(reader: ByteReader) {
const attribute = reader.readUInt32()

const shadow = getFlag(attribute, 0) ? PictureShadow.fromReader(reader) : null
const shadow = getFlag(attribute, 0)
? PictureShadow.fromReader(reader)
: null

const glow = getFlag(attribute, 1) ? Glow.fromReader(reader) : null
const softEdge = getFlag(attribute, 2) ? SoftEdge.fromReader(reader) : null
Expand Down

0 comments on commit 959beef

Please sign in to comment.