@chrismo/superkit 1.2.0 → 1.3.0
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/docs/recipes/string.md +2 -2
- package/docs/recipes/string.spq +10 -11
- package/package.json +1 -1
package/docs/recipes/string.md
CHANGED
|
@@ -235,9 +235,9 @@ super -I string.spq -s -c 'values sk_urldecode("%2Ftavern%20test")' -
|
|
|
235
235
|
op sk_decode_seg s: (
|
|
236
236
|
len(s) == 0
|
|
237
237
|
? s
|
|
238
|
-
: (is_error(hex(s[
|
|
238
|
+
: (is_error(hex(s[0:2]))
|
|
239
239
|
? s
|
|
240
|
-
: hex(s[
|
|
240
|
+
: f'{hex(s[0:2])::string}{s[2:]}')
|
|
241
241
|
)
|
|
242
242
|
|
|
243
243
|
op sk_urldecode url: (
|
package/docs/recipes/string.spq
CHANGED
|
@@ -114,21 +114,20 @@ fn skdoc_mid(): (
|
|
|
114
114
|
|
|
115
115
|
fn sk_mid(s, start, n): (sk_slice(s, sk_clamp(start, 0, len(s)), sk_clamp(start, 0, len(s)) + sk_clamp(n, 0, len(s))))
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
-- Otherwise returns the segment as-is
|
|
117
|
+
fn skdoc_urldecode(): (
|
|
118
|
+
cast(
|
|
119
|
+
{name:"sk_urldecode",
|
|
120
|
+
type:"op",
|
|
121
|
+
desc:"URL-decodes a percent-encoded string. Splits on %%, decodes each hex-encoded segment, and joins back together.",
|
|
122
|
+
args:[{name:"url",desc:"The URL-encoded string to decode."}],
|
|
123
|
+
examples:[{i:"'%%2Fhello%%20world' | sk_urldecode this",o:"'/hello world'"}]}, <skdoc>)
|
|
124
|
+
)
|
|
126
125
|
op sk_decode_seg s: (
|
|
127
126
|
len(s) == 0
|
|
128
127
|
? s
|
|
129
|
-
: (is_error(hex(s[
|
|
128
|
+
: (is_error(hex(s[0:2]))
|
|
130
129
|
? s
|
|
131
|
-
: hex(s[
|
|
130
|
+
: f'{hex(s[0:2])::string}{s[2:]}')
|
|
132
131
|
)
|
|
133
132
|
|
|
134
133
|
-- Main URL decoder operator
|