@pexip-engage-public/color-utils 1.0.1 → 1.0.2

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @pexip-engage-public/color-utils
2
2
 
3
+ ## 1.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 1b9950db3: chore/SKED-11506: Validate & fix important vulnerabilities reported via Snyk
8
+
3
9
  ## 1.0.1
4
10
 
5
11
  ### Patch Changes
@@ -2,4 +2,6 @@ export declare function isValidColorCode(hex: string): boolean;
2
2
  export declare function isValidSixDigitColorCode(hex: string): boolean;
3
3
  export declare function isValidThreeDigitColorCode(hex: string): boolean;
4
4
  export declare function ensureSixDigitHex(hex: string): string;
5
+ export declare function invariant(value: boolean, message?: string): asserts value;
6
+ export declare function invariant<T>(value: T | null | undefined, message?: string): asserts value is T;
5
7
  //# sourceMappingURL=hexValidators.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hexValidators.d.ts","sourceRoot":"","sources":["../src/hexValidators.ts"],"names":[],"mappings":"AAEA,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAErD;AAED,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE/D;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAkBrD"}
1
+ {"version":3,"file":"hexValidators.d.ts","sourceRoot":"","sources":["../src/hexValidators.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAErD;AAED,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE/D;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAkBrD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;AAC3E,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC"}
@@ -1,4 +1,3 @@
1
- import { invariant } from "@pexip-engage/utils/invariant";
2
1
  export function isValidColorCode(hex) {
3
2
  return isValidSixDigitColorCode(hex) || isValidThreeDigitColorCode(hex);
4
3
  }
@@ -22,3 +21,8 @@ export function ensureSixDigitHex(hex) {
22
21
  strippedHex[2] +
23
22
  strippedHex[2]);
24
23
  }
24
+ export function invariant(value, message) {
25
+ if (value === false || value == null) {
26
+ throw new Error(message != null ? `Assertion failed: ${message}` : "Assertion failed");
27
+ }
28
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pexip-engage-public/color-utils",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/skedify/frontend-mono/tree/develop/packages/color-utils#readme",
6
6
  "bugs": {
@@ -28,8 +28,7 @@
28
28
  "src"
29
29
  ],
30
30
  "dependencies": {
31
- "color-convert": "^2.0.1",
32
- "@pexip-engage/utils": "0.1.1"
31
+ "color-convert": "^2.0.1"
33
32
  },
34
33
  "devDependencies": {
35
34
  "@types/color-convert": "^2.0.3",
@@ -1,5 +1,3 @@
1
- import { invariant } from "@pexip-engage/utils/invariant";
2
-
3
1
  export function isValidColorCode(hex: string): boolean {
4
2
  return isValidSixDigitColorCode(hex) || isValidThreeDigitColorCode(hex);
5
3
  }
@@ -31,3 +29,11 @@ export function ensureSixDigitHex(hex: string): string {
31
29
  strippedHex[2]
32
30
  );
33
31
  }
32
+
33
+ export function invariant(value: boolean, message?: string): asserts value;
34
+ export function invariant<T>(value: T | null | undefined, message?: string): asserts value is T;
35
+ export function invariant(value: unknown, message?: string): void {
36
+ if (value === false || value == null) {
37
+ throw new Error(message != null ? `Assertion failed: ${message}` : "Assertion failed");
38
+ }
39
+ }