@atcute/lexicons 1.0.2 → 1.0.3

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/dist/utils.js CHANGED
@@ -1,6 +1,7 @@
1
+ import { DEV } from 'esm-env';
1
2
  export const assert = (condition, message) => {
2
3
  if (!condition) {
3
- if (import.meta.env.DEV) {
4
+ if (DEV) {
4
5
  throw new Error(`Assertion failed` + (message ? `: ${message}` : ``));
5
6
  }
6
7
  throw new Error(`Assertion failed`);
package/dist/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../lib/utils.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,MAAM,GAA8D,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE;IACvG,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,kBAAkB,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACvE,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACrC,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAQ,EAAE,OAAgB,EAAS,EAAE;IAChE,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACxB,CAAC,CAAC"}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAI9B,MAAM,CAAC,MAAM,MAAM,GAA8D,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE;IACvG,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,IAAI,GAAG,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CAAC,kBAAkB,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACvE,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACrC,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAQ,EAAE,OAAgB,EAAS,EAAE;IAChE,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACxB,CAAC,CAAC"}
package/lib/utils.ts CHANGED
@@ -1,8 +1,10 @@
1
+ import { DEV } from 'esm-env';
2
+
1
3
  export type Result<T, E> = { ok: true; value: T } | { ok: false; error: E };
2
4
 
3
5
  export const assert: { (condition: any, message?: string): asserts condition } = (condition, message) => {
4
6
  if (!condition) {
5
- if (import.meta.env.DEV) {
7
+ if (DEV) {
6
8
  throw new Error(`Assertion failed` + (message ? `: ${message}` : ``));
7
9
  }
8
10
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@atcute/lexicons",
4
- "version": "1.0.2",
4
+ "version": "1.0.3",
5
5
  "description": "AT Protocol core lexicon types and schema validations",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -23,10 +23,12 @@
23
23
  },
24
24
  "sideEffects": false,
25
25
  "devDependencies": {
26
- "@types/bun": "^1.2.13",
27
26
  "@vitest/coverage-v8": "^3.1.3",
28
27
  "vitest": "^3.1.3"
29
28
  },
29
+ "dependencies": {
30
+ "esm-env": "^1.2.2"
31
+ },
30
32
  "scripts": {
31
33
  "build": "tsc --project tsconfig.build.json",
32
34
  "test": "vitest",