@scalar/helpers 0.0.9 → 0.0.10
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 +6 -0
- package/dist/general/has-modifier.d.ts +7 -0
- package/dist/general/has-modifier.d.ts.map +1 -0
- package/dist/general/has-modifier.js +9 -0
- package/dist/general/has-modifier.js.map +7 -0
- package/dist/regex/regex-helpers.d.ts +2 -0
- package/dist/regex/regex-helpers.d.ts.map +1 -1
- package/dist/regex/regex-helpers.js +2 -0
- package/dist/regex/regex-helpers.js.map +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"has-modifier.d.ts","sourceRoot":"","sources":["../../src/general/has-modifier.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,SAAS,aAAa,YAGjD,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/general/has-modifier.ts"],
|
|
4
|
+
"sourcesContent": ["import { isMacOS } from './is-mac-os'\n\n/**\n * Checks for the modifier key\n *\n * Which is meta on macOs and ctrl on linux/windows\n */\nexport const hasModifier = (keydown: KeyboardEvent) => {\n const modifier = isMacOS() ? 'metaKey' : 'ctrlKey'\n return keydown[modifier]\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,eAAe;AAOjB,MAAM,cAAc,CAAC,YAA2B;AACrD,QAAM,WAAW,QAAQ,IAAI,YAAY;AACzC,SAAO,QAAQ,QAAQ;AACzB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -5,6 +5,8 @@ export declare const REGEX: {
|
|
|
5
5
|
readonly MULTIPLE_SLASHES: RegExp;
|
|
6
6
|
readonly VARIABLES: RegExp;
|
|
7
7
|
readonly PATH: RegExp;
|
|
8
|
+
/** Finds the name of the schema from the ref path */
|
|
9
|
+
readonly REF_NAME: RegExp;
|
|
8
10
|
readonly TEMPLATE_VARIABLE: RegExp;
|
|
9
11
|
};
|
|
10
12
|
//# sourceMappingURL=regex-helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regex-helpers.d.ts","sourceRoot":"","sources":["../../src/regex/regex-helpers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK;IAChB,gCAAgC;;IAEhC,6EAA6E
|
|
1
|
+
{"version":3,"file":"regex-helpers.d.ts","sourceRoot":"","sources":["../../src/regex/regex-helpers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK;IAChB,gCAAgC;;IAEhC,6EAA6E;;;;IAI7E,qDAAqD;;;CAG7C,CAAA"}
|
|
@@ -5,6 +5,8 @@ const REGEX = {
|
|
|
5
5
|
MULTIPLE_SLASHES: /(?<!:)\/{2,}/g,
|
|
6
6
|
VARIABLES: /{{((?:[^{}]|{[^{}]*})*)}}/g,
|
|
7
7
|
PATH: /(?:{)([^{}]+)}(?!})/g,
|
|
8
|
+
/** Finds the name of the schema from the ref path */
|
|
9
|
+
REF_NAME: /\/([^\/]+)$/,
|
|
8
10
|
TEMPLATE_VARIABLE: /{{\s*([^}\s]+?)\s*}}|{\s*([^}\s]+?)\s*}|:\b[\w.]+\b/g
|
|
9
11
|
};
|
|
10
12
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/regex/regex-helpers.ts"],
|
|
4
|
-
"sourcesContent": ["export const REGEX = {\n /** Checks for a valid scheme */\n PROTOCOL: /^(?:https?|ftp|file|mailto|tel|data|wss?)*:\\/\\//,\n /** Finds multiple slashes after the scheme to replace with a single slash */\n MULTIPLE_SLASHES: /(?<!:)\\/{2,}/g,\n VARIABLES: /{{((?:[^{}]|{[^{}]*})*)}}/g,\n PATH: /(?:{)([^{}]+)}(?!})/g,\n TEMPLATE_VARIABLE: /{{\\s*([^}\\s]+?)\\s*}}|{\\s*([^}\\s]+?)\\s*}|:\\b[\\w.]+\\b/g,\n} as const\n"],
|
|
5
|
-
"mappings": "AAAO,MAAM,QAAQ;AAAA;AAAA,EAEnB,UAAU;AAAA;AAAA,EAEV,kBAAkB;AAAA,EAClB,WAAW;AAAA,EACX,MAAM;AAAA,
|
|
4
|
+
"sourcesContent": ["export const REGEX = {\n /** Checks for a valid scheme */\n PROTOCOL: /^(?:https?|ftp|file|mailto|tel|data|wss?)*:\\/\\//,\n /** Finds multiple slashes after the scheme to replace with a single slash */\n MULTIPLE_SLASHES: /(?<!:)\\/{2,}/g,\n VARIABLES: /{{((?:[^{}]|{[^{}]*})*)}}/g,\n PATH: /(?:{)([^{}]+)}(?!})/g,\n /** Finds the name of the schema from the ref path */\n REF_NAME: /\\/([^\\/]+)$/,\n TEMPLATE_VARIABLE: /{{\\s*([^}\\s]+?)\\s*}}|{\\s*([^}\\s]+?)\\s*}|:\\b[\\w.]+\\b/g,\n} as const\n"],
|
|
5
|
+
"mappings": "AAAO,MAAM,QAAQ;AAAA;AAAA,EAEnB,UAAU;AAAA;AAAA,EAEV,kBAAkB;AAAA,EAClB,WAAW;AAAA,EACX,MAAM;AAAA;AAAA,EAEN,UAAU;AAAA,EACV,mBAAmB;AACrB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"helpers",
|
|
15
15
|
"js"
|
|
16
16
|
],
|
|
17
|
-
"version": "0.0.
|
|
17
|
+
"version": "0.0.10",
|
|
18
18
|
"engines": {
|
|
19
19
|
"node": ">=20"
|
|
20
20
|
},
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"vite": "6.1.6",
|
|
82
82
|
"vitest": "^3.2.4",
|
|
83
|
-
"@scalar/build-tooling": "0.2.
|
|
83
|
+
"@scalar/build-tooling": "0.2.7"
|
|
84
84
|
},
|
|
85
85
|
"scripts": {
|
|
86
86
|
"build": "scalar-build-esbuild",
|