@scalar/helpers 0.0.2 → 0.0.4

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,17 @@
1
1
  # @scalar/helpers
2
2
 
3
+ ## 0.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 221e35f: feat: added webhooks
8
+
9
+ ## 0.0.3
10
+
11
+ ### Patch Changes
12
+
13
+ - 8bc9f20: fix(helpers): ensure .js extension is emitted for imports
14
+
3
15
  ## 0.0.2
4
16
 
5
17
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- import type { HttpMethod } from './http-methods';
1
+ import type { HttpMethod } from './http-methods.js';
2
2
  /** HTTP Methods which can have a body */
3
3
  declare const BODY_METHODS: ["post", "put", "patch", "delete"];
4
4
  type BodyMethod = (typeof BODY_METHODS)[number];
@@ -1,4 +1,4 @@
1
- import { type HttpMethod } from './http-methods';
1
+ import { type HttpMethod } from './http-methods.js';
2
2
  /** Type guard which takes in a string and returns true if it is in fact an HTTPMethod */
3
3
  export declare const isHttpMethod: (method?: string | undefined) => method is HttpMethod;
4
4
  //# sourceMappingURL=is-http-method.d.ts.map
@@ -1,4 +1,4 @@
1
- import { httpMethods } from "./http-methods";
1
+ import { httpMethods } from "./http-methods.js";
2
2
  const isHttpMethod = (method) => method && typeof method === "string" ? httpMethods.has(method.toLowerCase()) : false;
3
3
  export {
4
4
  isHttpMethod
@@ -1,4 +1,4 @@
1
- import type { HttpMethod } from './http-methods';
1
+ import type { HttpMethod } from './http-methods.js';
2
2
  /**
3
3
  * Get a normalized request method (e.g. get, post, etc.)
4
4
  * Lowercases the method and returns the default if it is not a valid method so you will always have a valid method
@@ -1,4 +1,4 @@
1
- import { isHttpMethod } from "./is-http-method";
1
+ import { isHttpMethod } from "./is-http-method.js";
2
2
  const DEFAULT_REQUEST_METHOD = "get";
3
3
  const normalizeHttpMethod = (method) => {
4
4
  if (typeof method !== "string") {
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * Find all strings wrapped in {} or {{}} in value.
3
3
  */
4
- export declare const findVariables: (value: string) => (string | undefined)[];
4
+ export declare const findVariables: (value: string) => string[];
5
5
  //# sourceMappingURL=find-variables.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"find-variables.d.ts","sourceRoot":"","sources":["../../src/regex/find-variables.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,aAAa,UAAW,MAAM,2BACiE,CAAA"}
1
+ {"version":3,"file":"find-variables.d.ts","sourceRoot":"","sources":["../../src/regex/find-variables.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,aAAa,UAAW,MAAM,aACiE,CAAA"}
@@ -1,4 +1,4 @@
1
- import { REGEX } from "./regex-helpers";
1
+ import { REGEX } from "./regex-helpers.js";
2
2
  const findVariables = (value) => [...value.matchAll(REGEX.PATH), ...value.matchAll(REGEX.VARIABLES)].map((match) => match[1]?.trim()) || [];
3
3
  export {
4
4
  findVariables
@@ -1,4 +1,4 @@
1
- import { REGEX } from "../regex/regex-helpers";
1
+ import { REGEX } from "../regex/regex-helpers.js";
2
2
  function ensureProtocol(url) {
3
3
  if (REGEX.PROTOCOL.test(url)) {
4
4
  return url;
@@ -1,4 +1,4 @@
1
- import { REGEX } from "../regex/regex-helpers";
1
+ import { REGEX } from "../regex/regex-helpers.js";
2
2
  const isRelativePath = (url) => {
3
3
  if (REGEX.PROTOCOL.test(url)) {
4
4
  return false;
@@ -1,6 +1,6 @@
1
- import { REGEX } from "../regex/regex-helpers";
2
- import { isRelativePath } from "./is-relative-path";
3
- import { ensureProtocol } from "./ensure-protocol";
1
+ import { REGEX } from "../regex/regex-helpers.js";
2
+ import { isRelativePath } from "./is-relative-path.js";
3
+ import { ensureProtocol } from "./ensure-protocol.js";
4
4
  const mergeSearchParams = (...params) => {
5
5
  const merged = {};
6
6
  params.forEach((p) => {
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "helpers",
15
15
  "js"
16
16
  ],
17
- "version": "0.0.2",
17
+ "version": "0.0.4",
18
18
  "engines": {
19
19
  "node": ">=20"
20
20
  },
@@ -77,11 +77,10 @@
77
77
  "CHANGELOG.md"
78
78
  ],
79
79
  "module": "dist/index.js",
80
- "dependencies": {},
81
80
  "devDependencies": {
82
81
  "vite": "5.4.19",
83
82
  "vitest": "^1.6.0",
84
- "@scalar/build-tooling": "0.2.2"
83
+ "@scalar/build-tooling": "0.2.3"
85
84
  },
86
85
  "scripts": {
87
86
  "build": "scalar-build-esbuild",