@drawbridge/drawbridge-utils 0.0.74 → 0.0.75

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/sanitize.cjs CHANGED
@@ -1,8 +1,6 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __export = (target, all) => {
8
6
  for (var name in all)
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
16
14
  }
17
15
  return to;
18
16
  };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
18
 
29
19
  // lib/sanitize.js
@@ -37,10 +27,17 @@ __export(sanitize_exports, {
37
27
  sanitizeUrl: () => sanitizeUrl
38
28
  });
39
29
  module.exports = __toCommonJS(sanitize_exports);
40
- var import_disposable_email_domains = __toESM(require("disposable-email-domains"), 1);
30
+
31
+ // node_modules/tsup/assets/cjs_shims.js
32
+ var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
33
+ var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
34
+
35
+ // lib/sanitize.js
36
+ var import_node_module = require("module");
37
+ var disposableDomains = (0, import_node_module.createRequire)(importMetaUrl)("disposable-email-domains");
41
38
  var SCOPE_KEYS = ["organization", "account", "user", "owner"];
42
39
  var DANGEROUS_OPERATORS = ["$where", "$function", "$accumulator"];
43
- var disposableBlacklist = new Set(import_disposable_email_domains.default.map((d) => d.toLowerCase()));
40
+ var disposableBlacklist = new Set(disposableDomains.map((d) => d.toLowerCase()));
44
41
  var stripDangerousOperators = (value) => {
45
42
  if (Array.isArray(value)) {
46
43
  return value.map(stripDangerousOperators);
@@ -1,4 +1,11 @@
1
- import disposableDomains from 'disposable-email-domains';
1
+ import { createRequire } from 'node:module';
2
+
3
+ // The package's entry is a bare index.json; a static ESM import of it needs a
4
+ // JSON import attribute that Node only understands from ~20.10, so the ESM
5
+ // dist build was un-importable under plain Node (bundlers papered over it).
6
+ // createRequire loads it with CJS semantics on every Node version — tsup's
7
+ // `shims` option makes import.meta.url safe in the CJS build.
8
+ const disposableDomains = createRequire( import.meta.url )( 'disposable-email-domains' );
2
9
 
3
10
  const SCOPE_KEYS = [ 'organization', 'account', 'user', 'owner' ];
4
11
  const DANGEROUS_OPERATORS = [ '$where', '$function', '$accumulator' ];
@@ -1,4 +1,11 @@
1
- import disposableDomains from 'disposable-email-domains';
1
+ import { createRequire } from 'node:module';
2
+
3
+ // The package's entry is a bare index.json; a static ESM import of it needs a
4
+ // JSON import attribute that Node only understands from ~20.10, so the ESM
5
+ // dist build was un-importable under plain Node (bundlers papered over it).
6
+ // createRequire loads it with CJS semantics on every Node version — tsup's
7
+ // `shims` option makes import.meta.url safe in the CJS build.
8
+ const disposableDomains = createRequire( import.meta.url )( 'disposable-email-domains' );
2
9
 
3
10
  const SCOPE_KEYS = [ 'organization', 'account', 'user', 'owner' ];
4
11
  const DANGEROUS_OPERATORS = [ '$where', '$function', '$accumulator' ];
package/dist/sanitize.js CHANGED
@@ -1,5 +1,6 @@
1
1
  // lib/sanitize.js
2
- import disposableDomains from "disposable-email-domains";
2
+ import { createRequire } from "module";
3
+ var disposableDomains = createRequire(import.meta.url)("disposable-email-domains");
3
4
  var SCOPE_KEYS = ["organization", "account", "user", "owner"];
4
5
  var DANGEROUS_OPERATORS = ["$where", "$function", "$accumulator"];
5
6
  var disposableBlacklist = new Set(disposableDomains.map((d) => d.toLowerCase()));
package/package.json CHANGED
@@ -155,8 +155,9 @@
155
155
  },
156
156
  "scripts": {
157
157
  "sync": ". \"$HOME/.nvm/nvm.sh\" && nvm use && npm prune && npm install && npx drawbridge-agents-sync",
158
- "build": "tsup && npm publish"
158
+ "build": "tsup && npm publish",
159
+ "test": "node --test test/"
159
160
  },
160
161
  "types": "dist/index.d.ts",
161
- "version": "0.0.74"
162
+ "version": "0.0.75"
162
163
  }