Skip to content

Commit fd36ec3

Browse files
authored
fix: removed-node-sass-deprecated-package (#5424)
1 parent 2862e41 commit fd36ec3

File tree

4 files changed

+370
-49
lines changed

4 files changed

+370
-49
lines changed

frontend/common/utils/utils.tsx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ const Utils = Object.assign({}, require('./base/_utils'), {
7878
total += variation
7979
? variation.percentage_allocation
8080
: typeof v.default_percentage_allocation === 'number'
81-
? v.default_percentage_allocation
82-
: (v as any).percentage_allocation
81+
? v.default_percentage_allocation
82+
: (v as any).percentage_allocation
8383
return null
8484
})
8585
return 100 - total
@@ -194,10 +194,10 @@ const Utils = Object.assign({}, require('./base/_utils'), {
194194
) {
195195
const findAppended = `${value}`.includes(':')
196196
? (conditions || []).find((v) => {
197-
const split = value.split(':')
198-
const targetKey = `:${split[split.length - 1]}`
199-
return v.value === operator + targetKey
200-
})
197+
const split = value.split(':')
198+
const targetKey = `:${split[split.length - 1]}`
199+
return v.value === operator + targetKey
200+
})
201201
: false
202202
if (findAppended) return findAppended
203203

@@ -667,6 +667,12 @@ const Utils = Object.assign({}, require('./base/_utils'), {
667667
const hasStaleFlagsPermission = Utils.getPlansPermission('STALE_FLAGS')
668668
return tag?.type === 'STALE' && !hasStaleFlagsPermission
669669
},
670+
toKebabCase: (string: string) =>
671+
string
672+
.replace(/([a-z])([A-Z])/g, '$1-$2')
673+
.replace(/[\s_]+/g, '-')
674+
.toLowerCase(),
675+
670676
validateMetadataType(type: string, value: any) {
671677
switch (type) {
672678
case 'int': {
@@ -683,11 +689,6 @@ const Utils = Object.assign({}, require('./base/_utils'), {
683689
}
684690
},
685691

686-
toKebabCase: (string: string) => string
687-
.replace(/([a-z])([A-Z])/g, "$1-$2")
688-
.replace(/[\s_]+/g, '-')
689-
.toLowerCase(),
690-
691692
validateRule(rule: SegmentCondition) {
692693
if (!rule) return false
693694
if (rule.delete) {

0 commit comments

Comments
 (0)