Skip to content

Commit 29e5a41

Browse files
authored
Properly migrate keywords to map.keywords (#220)
Fixes #219.
1 parent 809f9f5 commit 29e5a41

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 1.5.4
2+
3+
### Module Migrator
4+
5+
* Fix a bug where the built-in function `keywords` was incorrectly migrated.
6+
17
## 1.5.3
28

39
### Division Migrator

lib/src/migrators/module/built_in_functions.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ const builtInFunctionModules = {
3636
"map-keys": "map",
3737
"map-values": "map",
3838
"map-has-key": "map",
39-
"keywords": "map",
4039
"selector-nest": "selector",
4140
"selector-append": "selector",
4241
"selector-replace": "selector",
@@ -73,6 +72,7 @@ const builtInFunctionModules = {
7372
"type-of": "meta",
7473
"call": "meta",
7574
"content-exists": "meta",
75+
"keywords": "meta",
7676
"unquote": "string",
7777
"quote": "string",
7878
"str-length": "string",

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: sass_migrator
2-
version: 1.5.3
2+
version: 1.5.4
33
description: A tool for running migrations on Sass files
44
homepage: https://github.com/sass/migrator
55

test/migrators/module/built_in_functions/namespacing.hrx

+9
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,18 @@ $a: mix(red, blue);
33
$b: str-length("hello");
44
$c: scale-color(blue, $lightness: -10%);
55

6+
@function fn($args...) {
7+
@return keywords($args);
8+
}
9+
610
<==> output/entrypoint.scss
711
@use "sass:color";
12+
@use "sass:meta";
813
@use "sass:string";
914
$a: color.mix(red, blue);
1015
$b: string.length("hello");
1116
$c: color.scale(blue, $lightness: -10%);
17+
18+
@function fn($args...) {
19+
@return meta.keywords($args);
20+
}

0 commit comments

Comments
 (0)