Skip to content

Commit f51b27f

Browse files
authored
fix: typo (#2222)
1 parent b7c93ac commit f51b27f

File tree

17 files changed

+43
-42
lines changed

17 files changed

+43
-42
lines changed

examples/storybook/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="">
33
<head>
4-
<meta charset="UTF-8">
5-
<link rel="icon" href="/favicon.ico">
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
4+
<meta charset="UTF-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>Vite App</title>
88
</head>
99
<body>

packages/core-base/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"files": [
2727
"dist"
2828
],
29-
"type": "module",
3029
"module": "dist/core-base.js",
3130
"unpkg": "dist/core-base.global.js",
3231
"jsdelivr": "dist/core-base.global.js",
@@ -69,5 +68,6 @@
6968
"publishConfig": {
7069
"access": "public"
7170
},
72-
"sideEffects": false
71+
"sideEffects": false,
72+
"type": "module"
7373
}

packages/core-base/src/context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ export interface CoreInternalContext {
336336
*/
337337
export const VERSION: string = __VERSION__
338338

339-
export const NOT_REOSLVED = -1
339+
export const NOT_RESOLVED = -1
340340

341341
export const DEFAULT_LOCALE = 'en-US'
342342

packages/core-base/src/datetime.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
handleMissing,
1313
isTranslateFallbackWarn,
1414
MISSING_RESOLVE_VALUE,
15-
NOT_REOSLVED
15+
NOT_RESOLVED
1616
} from './context'
1717
import { CoreErrorCodes, createCoreError } from './errors'
1818
import { getLocale } from './fallbacker'
@@ -275,7 +275,7 @@ export function datetime<
275275

276276
// checking format and target locale
277277
if (!isPlainObject(format) || !isString(targetLocale)) {
278-
return unresolving ? NOT_REOSLVED : key
278+
return unresolving ? NOT_RESOLVED : key
279279
}
280280

281281
let id = `${targetLocale}__${key}`

packages/core-base/src/number.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
handleMissing,
1212
isTranslateFallbackWarn,
1313
MISSING_RESOLVE_VALUE,
14-
NOT_REOSLVED
14+
NOT_RESOLVED
1515
} from './context'
1616
import { CoreErrorCodes, createCoreError } from './errors'
1717
import { getLocale } from './fallbacker'
@@ -270,7 +270,7 @@ export function number<
270270

271271
// checking format and target locale
272272
if (!isPlainObject(format) || !isString(targetLocale)) {
273-
return unresolving ? NOT_REOSLVED : key
273+
return unresolving ? NOT_RESOLVED : key
274274
}
275275

276276
let id = `${targetLocale}__${key}`

packages/core-base/src/translate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
isAlmostSameLocale,
2525
isImplicitFallback,
2626
isTranslateFallbackWarn,
27-
NOT_REOSLVED
27+
NOT_RESOLVED
2828
} from './context'
2929
import { translateDevTools } from './devtools'
3030
import { CoreErrorCodes, createCoreError } from './errors'
@@ -713,7 +713,7 @@ export function translate<
713713
) ||
714714
!isString(targetLocale))
715715
) {
716-
return unresolving ? NOT_REOSLVED : (key as MessageFunctionReturn<Message>)
716+
return unresolving ? NOT_RESOLVED : (key as MessageFunctionReturn<Message>)
717717
}
718718

719719
// TODO: refactor

packages/core-base/test/datetime.test.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ vi.mock('../src/intl', async () => {
2020
}
2121
})
2222

23-
import { createCoreContext as context, NOT_REOSLVED } from '../src/context'
24-
import { datetime } from '../src/datetime'
25-
import { CoreErrorCodes, errorMessages } from '../src/errors'
23+
import { compile } from '../src/compilation'
2624
import {
27-
registerMessageCompiler,
28-
registerLocaleFallbacker
25+
createCoreContext as context,
26+
NOT_RESOLVED,
27+
registerLocaleFallbacker,
28+
registerMessageCompiler
2929
} from '../src/context'
30-
import { compile } from '../src/compilation'
30+
import { datetime } from '../src/datetime'
31+
import { CoreErrorCodes, errorMessages } from '../src/errors'
3132
import { fallbackWithLocaleChain } from '../src/fallbacker'
3233

3334
import type { DateTimeFormats } from '../src/types'
@@ -265,7 +266,7 @@ describe('context unresolving option', () => {
265266
datetimeFormats
266267
})
267268

268-
expect(datetime(ctx, dt, 'long')).toEqual(NOT_REOSLVED)
269+
expect(datetime(ctx, dt, 'long')).toEqual(NOT_RESOLVED)
269270
expect(mockWarn).not.toHaveBeenCalled()
270271
})
271272

@@ -284,7 +285,7 @@ describe('context unresolving option', () => {
284285
datetimeFormats
285286
})
286287

287-
expect(datetime(ctx, dt, 'custom')).toEqual(NOT_REOSLVED)
288+
expect(datetime(ctx, dt, 'custom')).toEqual(NOT_RESOLVED)
288289
expect(mockWarn).not.toHaveBeenCalled()
289290
})
290291
})

packages/core-base/test/number.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ vi.mock('../src/intl', async () => {
2323
import { compile } from '../src/compilation'
2424
import {
2525
createCoreContext as context,
26-
NOT_REOSLVED,
26+
NOT_RESOLVED,
2727
registerLocaleFallbacker,
2828
registerMessageCompiler
2929
} from '../src/context'
@@ -240,7 +240,7 @@ describe('context unresolving option', () => {
240240
numberFormats
241241
})
242242

243-
expect(number(ctx, 0.99, 'percent')).toEqual(NOT_REOSLVED)
243+
expect(number(ctx, 0.99, 'percent')).toEqual(NOT_RESOLVED)
244244
expect(mockWarn).not.toHaveBeenCalled()
245245
})
246246

@@ -259,7 +259,7 @@ describe('context unresolving option', () => {
259259
numberFormats
260260
})
261261

262-
expect(number(ctx, 123456789, 'custom')).toEqual(NOT_REOSLVED)
262+
expect(number(ctx, 123456789, 'custom')).toEqual(NOT_RESOLVED)
263263
expect(mockWarn).not.toHaveBeenCalled()
264264
})
265265
})

packages/core-base/test/translate.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ vi.mock('@intlify/shared', async () => {
1616
import { compile } from '../src/compilation'
1717
import {
1818
createCoreContext as context,
19-
NOT_REOSLVED,
19+
NOT_RESOLVED,
2020
registerLocaleFallbacker,
2121
registerMessageCompiler,
2222
registerMessageResolver
@@ -553,7 +553,7 @@ describe('context unresolving option', () => {
553553
ja: {}
554554
}
555555
})
556-
expect(translate(ctx, 'hello.world')).toEqual(NOT_REOSLVED)
556+
expect(translate(ctx, 'hello.world')).toEqual(NOT_RESOLVED)
557557
})
558558

559559
test('fallbackWarn is false', () => {
@@ -568,7 +568,7 @@ describe('context unresolving option', () => {
568568
ja: {}
569569
}
570570
})
571-
expect(translate(ctx, 'hello.world')).toEqual(NOT_REOSLVED)
571+
expect(translate(ctx, 'hello.world')).toEqual(NOT_RESOLVED)
572572
})
573573

574574
test('fallbackFormat is true', () => {

packages/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"files": [
2727
"dist"
2828
],
29-
"type": "module",
3029
"module": "dist/core.js",
3130
"unpkg": "dist/core.global.js",
3231
"jsdelivr": "dist/core.global.js",
@@ -71,5 +70,6 @@
7170
"publishConfig": {
7271
"access": "public"
7372
},
74-
"sideEffects": false
73+
"sideEffects": false,
74+
"type": "module"
7575
}

0 commit comments

Comments
 (0)