Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
hildjj committed Jan 3, 2025
1 parent f61c002 commit 19c6d45
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/ast.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,16 +347,17 @@ export class Range extends Base {
first = 0x10000;
}

// This code follows the logic in regenerate:
// https://github.com/mathiasbynens/regenerate/blob/11567339f40fd262435934d544885bc047cb4220/regenerate.js#L996
// I didn't use regenerate directly because:
// a) I only needed a small part of it
// b) Regenerate will only generate a string, which I then would have
// to parse to get the info I needed out.
// I believe this use is within the spirit of the MIT license.
const firstH = Math.floor((first - 0x10000) / 0x400) + 0xd800;
const firstL = ((first - 0x10000) % 0x400) + 0xdc00;
const lastH = Math.floor((last - 0x10000) / 0x400) + 0xd800;
const lastL = ((last - 0x10000) % 0x400) + 0xdc00;
// console.log({
// firstH: firstH.toString(16),
// firstL: firstL.toString(16),
// lastH: lastH.toString(16),
// lastL: lastL.toString(16)
// });
let complete = false;
if (
(firstH === lastH)
Expand Down

0 comments on commit 19c6d45

Please sign in to comment.