Skip to content

Commit

Permalink
refactor: 미사용 파일 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
hahnlee committed Apr 13, 2024
1 parent 959beef commit 9b745f1
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 220 deletions.
2 changes: 1 addition & 1 deletion packages/parser/src/constants/ctrl-id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function makeCtrlID(
const secondCode = second.charCodeAt(0)
const thirdCode = third.charCodeAt(0)
const fourthCode = fourth.charCodeAt(0)
return ((firstCode) << 24) | ((secondCode) << 16) | ((thirdCode) << 8) | (fourthCode)
return (firstCode << 24) | (secondCode << 16) | (thirdCode << 8) | fourthCode
}

export enum CommonCtrlID {
Expand Down
5 changes: 1 addition & 4 deletions packages/parser/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,16 @@
* limitations under the License.
*/

// FIXME: (@hanlee) export 고치기
// FIXME: (@hahnlee) export 고치기
export * from './models/controls/index.js'
export * from './models/controls/shapes/index.js'
export * from './models/section.js'
export * from './models/paragraph.js'
export * from './models/line-segment.js'
export * from './models/shape-pointer.js'
export * from './models/char.js'
export * from './models/controls/table.js'
export * from './models/paragraph-list.js'
export * from './constants/ctrl-id.js'
export * from './models/document.js'
export * from './models/controls/page-definition.js'
export * from './types/color.js'

export * from './parse.js'
15 changes: 12 additions & 3 deletions packages/parser/src/models/__tests__/version.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,22 @@ describe('HWPVersion', () => {
assert.strictEqual(highMajorVersion.isCompatible(targetVersion), false)

const sameMajorAndHigerMinorVersion = new HWPVersion(5, 4, 1, 7)
assert.strictEqual(sameMajorAndHigerMinorVersion.isCompatible(targetVersion), false)
assert.strictEqual(
sameMajorAndHigerMinorVersion.isCompatible(targetVersion),
false,
)

const sameMajorAndSameMinorVersion = new HWPVersion(5, 3, 1, 7)
assert.strictEqual(sameMajorAndSameMinorVersion.isCompatible(targetVersion), true)
assert.strictEqual(
sameMajorAndSameMinorVersion.isCompatible(targetVersion),
true,
)

const sameMajorAndLowerMinorVersion = new HWPVersion(5, 1, 2, 4)
assert.strictEqual(sameMajorAndLowerMinorVersion.isCompatible(targetVersion), true)
assert.strictEqual(
sameMajorAndLowerMinorVersion.isCompatible(targetVersion),
true,
)

const lowerMajorVersion = new HWPVersion(3, 0, 0, 0)
assert.strictEqual(lowerMajorVersion.isCompatible(targetVersion), false)
Expand Down
19 changes: 0 additions & 19 deletions packages/parser/src/models/controls/base.ts

This file was deleted.

51 changes: 0 additions & 51 deletions packages/parser/src/models/controls/column.ts

This file was deleted.

28 changes: 0 additions & 28 deletions packages/parser/src/models/paragraph-list.ts

This file was deleted.

26 changes: 0 additions & 26 deletions packages/parser/src/models/shape-pointer.ts

This file was deleted.

17 changes: 0 additions & 17 deletions packages/parser/src/types/color.ts

This file was deleted.

10 changes: 0 additions & 10 deletions packages/parser/src/utils/bit-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* limitations under the License.
*/

import { RGB } from '../types/color.js'

export function getBitValue(mask: number, start: number, end: number = start): number {
const target: number = mask >> start

Expand All @@ -28,14 +26,6 @@ export function getBitValue(mask: number, start: number, end: number = start): n
return target & temp
}

export function getRGB(colorRef: number): RGB {
return [
getBitValue(colorRef, 0, 7),
getBitValue(colorRef, 8, 15),
getBitValue(colorRef, 16, 23),
]
}

export function getFlag(bits: number, position: number): boolean {
const mask: number = 1 << position
return (bits & mask) === mask
Expand Down
19 changes: 0 additions & 19 deletions packages/parser/src/utils/list-utils.ts

This file was deleted.

42 changes: 0 additions & 42 deletions packages/parser/src/utils/record-reader.ts

This file was deleted.

0 comments on commit 9b745f1

Please sign in to comment.