@smockle/contrast 7.0.142 → 7.0.145

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { Contrast } from "../lib/index";
2
- import { THRESHOLD } from "./util";
1
+ import { Contrast } from "../lib/index.js";
2
+ import { THRESHOLD } from "./util.js";
3
3
  import { inspect } from "util";
4
4
  describe("Contrast", () => {
5
5
  test("constructor", () => {
@@ -1,5 +1,5 @@
1
- import { EightBit } from "../lib/index";
2
- import { THRESHOLD } from "./util";
1
+ import { EightBit } from "../lib/index.js";
2
+ import { THRESHOLD } from "./util.js";
3
3
  import { inspect } from "util";
4
4
  describe("EightBit", () => {
5
5
  test("constructor", () => {
@@ -1,5 +1,5 @@
1
- import { EightBit, EightBitColor } from "../lib/index";
2
- import { THRESHOLD } from "./util";
1
+ import { EightBit, EightBitColor } from "../lib/index.js";
2
+ import { THRESHOLD } from "./util.js";
3
3
  import { inspect } from "util";
4
4
  describe("EightBitColor", () => {
5
5
  test("constructor, with Number", () => {
@@ -12,7 +12,7 @@ describe("EightBitColor", () => {
12
12
  expect(new EightBitColor(0, 128, 255).valueOf()).toEqual({
13
13
  R: 0,
14
14
  G: 128,
15
- B: 255
15
+ B: 255,
16
16
  });
17
17
  });
18
18
  test("inspect", () => {
@@ -1,4 +1,4 @@
1
- import { Hex } from "../lib/index";
1
+ import { Hex } from "../lib/index.js";
2
2
  import { inspect } from "util";
3
3
  describe("Hex", () => {
4
4
  test("constructor, with #", () => {
@@ -1,4 +1,4 @@
1
- import { HexColor } from "../lib/index";
1
+ import { HexColor } from "../lib/index.js";
2
2
  import { inspect } from "util";
3
3
  describe("HexColor", () => {
4
4
  test("constructor", () => {
@@ -35,14 +35,14 @@ describe("HexColor", () => {
35
35
  expect(new HexColor("#0080FF").toEightBitColor().valueOf()).toEqual({
36
36
  R: 0,
37
37
  G: 128,
38
- B: 255
38
+ B: 255,
39
39
  });
40
40
  });
41
41
  test("toEightBitColor", () => {
42
42
  expect(new HexColor(null).toEightBitColor().valueOf()).toEqual({
43
43
  R: 0,
44
44
  G: 0,
45
- B: 0
45
+ B: 0,
46
46
  });
47
47
  });
48
48
  });
@@ -1,2 +1,2 @@
1
- #!/usr/bin/env node --experimental-specifier-resolution=node --no-warnings
1
+ #!/usr/bin/env node
2
2
  export {};
package/dist/bin/index.js CHANGED
@@ -1,5 +1,5 @@
1
- #!/usr/bin/env node --experimental-specifier-resolution=node --no-warnings
2
- import { Contrast } from "../lib/index";
1
+ #!/usr/bin/env node
2
+ import { Contrast } from "../lib/index.js";
3
3
  import { existsSync, readFileSync } from "fs";
4
4
  import { inspect } from "util";
5
5
  import url from "url";
@@ -1,4 +1,4 @@
1
- import { HexColor } from "./hexcolor";
1
+ import { HexColor } from "./hexcolor.js";
2
2
  declare const inspect: unique symbol;
3
3
  export declare class Contrast {
4
4
  /** The foreground color, e.g. "#FFFFFF". */
@@ -1,4 +1,4 @@
1
- import { HexColor } from "./hexcolor";
1
+ import { HexColor } from "./hexcolor.js";
2
2
  const inspect = Symbol.for("nodejs.util.inspect.custom");
3
3
  export class Contrast {
4
4
  /** The foreground color, e.g. "#FFFFFF". */
@@ -1,4 +1,4 @@
1
- import { Hex } from "./hex";
1
+ import { Hex } from "./hex.js";
2
2
  declare const inspect: unique symbol;
3
3
  export declare class EightBit implements EightBit {
4
4
  /** A number between 0 and 255. */
@@ -1,4 +1,4 @@
1
- import { Hex } from "./hex";
1
+ import { Hex } from "./hex.js";
2
2
  const inspect = Symbol.for("nodejs.util.inspect.custom");
3
3
  export class EightBit {
4
4
  /** A number between 0 and 255. */
@@ -1,5 +1,5 @@
1
- import { EightBit } from "./eightbit";
2
- import { HexColor } from "./hexcolor";
1
+ import { EightBit } from "./eightbit.js";
2
+ import { HexColor } from "./hexcolor.js";
3
3
  declare const inspect: unique symbol;
4
4
  export declare class EightBitColor {
5
5
  /** The current red value, e.g. EightBit(255). */
@@ -1,5 +1,5 @@
1
- import { EightBit } from "./eightbit";
2
- import { HexColor } from "./hexcolor";
1
+ import { EightBit } from "./eightbit.js";
2
+ import { HexColor } from "./hexcolor.js";
3
3
  const inspect = Symbol.for("nodejs.util.inspect.custom");
4
4
  export class EightBitColor {
5
5
  /** The current red value, e.g. EightBit(255). */
package/dist/lib/hex.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { EightBit } from "./eightbit";
1
+ import { EightBit } from "./eightbit.js";
2
2
  declare const inspect: unique symbol;
3
3
  export declare class Hex {
4
4
  /** The string representation of a hexadecimal value between 0 ("00") and 255 ("FF"). */
package/dist/lib/hex.js CHANGED
@@ -1,4 +1,4 @@
1
- import { EightBit } from "./eightbit";
1
+ import { EightBit } from "./eightbit.js";
2
2
  const inspect = Symbol.for("nodejs.util.inspect.custom");
3
3
  /**
4
4
  * Pads the provided string with another string (repeated, if needed) so that the resulting string reaches the given length. The padding is applied from the start (left) of the provided string.
@@ -17,9 +17,7 @@ export class Hex {
17
17
  value;
18
18
  constructor(value) {
19
19
  this.value = value
20
- ? padStart(String(value)
21
- .replace("#", "")
22
- .toUpperCase(), 2, "0")
20
+ ? padStart(String(value).replace("#", "").toUpperCase(), 2, "0")
23
21
  : null;
24
22
  }
25
23
  /** Returns the current value, e.g. "FF". */
@@ -1,5 +1,5 @@
1
- import { Hex } from "./hex";
2
- import { EightBitColor } from "./eightbitcolor";
1
+ import { Hex } from "./hex.js";
2
+ import { EightBitColor } from "./eightbitcolor.js";
3
3
  declare const inspect: unique symbol;
4
4
  export declare class HexColor {
5
5
  /** The string representation of a hexadecimal value between 0 ("00") and 255 ("FF"). */
@@ -1,5 +1,5 @@
1
- import { Hex } from "./hex";
2
- import { EightBitColor } from "./eightbitcolor";
1
+ import { Hex } from "./hex.js";
2
+ import { EightBitColor } from "./eightbitcolor.js";
3
3
  const inspect = Symbol.for("nodejs.util.inspect.custom");
4
4
  export class HexColor {
5
5
  /** The string representation of a hexadecimal value between 0 ("00") and 255 ("FF"). */
@@ -1,6 +1,6 @@
1
- import { Contrast } from "./contrast";
2
- import { EightBit } from "./eightbit";
3
- import { EightBitColor } from "./eightbitcolor";
4
- import { Hex } from "./hex";
5
- import { HexColor } from "./hexcolor";
1
+ import { Contrast } from "./contrast.js";
2
+ import { EightBit } from "./eightbit.js";
3
+ import { EightBitColor } from "./eightbitcolor.js";
4
+ import { Hex } from "./hex.js";
5
+ import { HexColor } from "./hexcolor.js";
6
6
  export { Contrast, EightBit, EightBitColor, Hex, HexColor };
package/dist/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { Contrast } from "./contrast";
2
- import { EightBit } from "./eightbit";
3
- import { EightBitColor } from "./eightbitcolor";
4
- import { Hex } from "./hex";
5
- import { HexColor } from "./hexcolor";
1
+ import { Contrast } from "./contrast.js";
2
+ import { EightBit } from "./eightbit.js";
3
+ import { EightBitColor } from "./eightbitcolor.js";
4
+ import { Hex } from "./hex.js";
5
+ import { HexColor } from "./hexcolor.js";
6
6
  export { Contrast, EightBit, EightBitColor, Hex, HexColor };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smockle/contrast",
3
- "version": "7.0.142",
3
+ "version": "7.0.145",
4
4
  "description": "Analyse luminosity contrast ratio",
5
5
  "files": [
6
6
  "dist"
@@ -13,8 +13,8 @@
13
13
  },
14
14
  "scripts": {
15
15
  "build": "tsc",
16
- "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
17
- "start": "node --experimental-specifier-resolution=node dist/bin/index.js"
16
+ "test": "node node_modules/jest/bin/jest.js",
17
+ "start": "node dist/bin/index.js"
18
18
  },
19
19
  "repository": {
20
20
  "type": "git",
@@ -28,13 +28,13 @@
28
28
  "homepage": "https://github.com/smockle/contrast#readme",
29
29
  "devDependencies": {
30
30
  "@types/jest": "^27.0.0",
31
- "@types/node": "^18.0.0",
31
+ "@types/node": "^20.1.0",
32
32
  "jest": "^27.0.1",
33
33
  "ts-jest": "^27.0.0",
34
34
  "typescript": "^4.1.3"
35
35
  },
36
36
  "engines": {
37
- "node": ">= 14.0.0"
37
+ "node": ">= 18.0.0"
38
38
  },
39
39
  "jest": {
40
40
  "preset": "ts-jest/presets/default-esm",
@@ -51,6 +51,9 @@
51
51
  "ts-jest": {
52
52
  "useESM": true
53
53
  }
54
+ },
55
+ "moduleNameMapper": {
56
+ "^(\\.\\.?\\/.+)\\.jsx?$": "$1"
54
57
  }
55
58
  }
56
59
  }