Skip to content

Commit 1e972ca

Browse files
authored
Make the package not depend directly on package:charcode. (dart-archive/convert#35)
* Make the package not depend directly on package:charcode. The charcode package is still used a dev-dependency, but that does not affect users of the convert package.
1 parent ea3a25f commit 1e972ca

File tree

6 files changed

+41
-5
lines changed

6 files changed

+41
-5
lines changed

pkgs/convert/lib/src/charcodes.dart

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
/// Character `%`.
6+
const int $percent = 0x25;
7+
8+
/// Character `-`.
9+
const int $dash = 0x2d;
10+
11+
/// Character `.`.
12+
const int $dot = 0x2e;
13+
14+
/// Character `0`.
15+
const int $0 = 0x30;
16+
17+
/// Character `9`.
18+
const int $9 = 0x39;
19+
20+
/// Character `A`.
21+
const int $A = 0x41;
22+
23+
/// Character `_`.
24+
const int $underscore = 0x5f;
25+
26+
/// Character `a`.
27+
const int $a = 0x61;
28+
29+
/// Character `f`.
30+
const int $f = 0x66;
31+
32+
/// Character `z`.
33+
const int $z = 0x7a;
34+
35+
/// Character `~`.
36+
const int $tilde = 0x7e;

pkgs/convert/lib/src/hex/encoder.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ library convert.hex.encoder;
77
import 'dart:convert';
88
import 'dart:typed_data';
99

10-
import 'package:charcode/ascii.dart';
10+
import '../charcodes.dart';
1111

1212
/// The canonical instance of [HexEncoder].
1313
const hexEncoder = HexEncoder._();

pkgs/convert/lib/src/percent/decoder.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ library convert.percent.decoder;
66

77
import 'dart:convert';
88

9-
import 'package:charcode/ascii.dart';
109
import 'package:typed_data/typed_data.dart';
1110

11+
import '../charcodes.dart';
1212
import '../utils.dart';
1313

1414
/// The canonical instance of [PercentDecoder].

pkgs/convert/lib/src/percent/encoder.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ library convert.percent.encoder;
66

77
import 'dart:convert';
88

9-
import 'package:charcode/ascii.dart';
9+
import '../charcodes.dart';
1010

1111
/// The canonical instance of [PercentEncoder].
1212
const percentEncoder = PercentEncoder._();

pkgs/convert/lib/src/utils.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
library convert.utils;
66

7-
import 'package:charcode/ascii.dart';
7+
import 'charcodes.dart';
88

99
/// Returns the digit (0 through 15) corresponding to the hexadecimal code unit
1010
/// at index [i] in [codeUnits].

pkgs/convert/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ environment:
77
sdk: '>=2.12.0-0 <3.0.0'
88

99
dependencies:
10-
charcode: ^1.2.0-nullsafety.3
1110
typed_data: ^1.3.0-nullsafety.5
1211

1312
dev_dependencies:
13+
charcode: ^1.2.0-nullsafety.3
1414
pedantic: ^1.10.0-nullsafety.3
1515
test: ^1.16.0-nullsafety.9

0 commit comments

Comments
 (0)