Skip to content

Commit

Permalink
Merge pull request ra1028#52 from ra1028/v1.0.0
Browse files Browse the repository at this point in the history
v1.0.0
  • Loading branch information
ra1028 committed Feb 8, 2019
2 parents f38f581 + c7ee6fd commit fcb2953
Show file tree
Hide file tree
Showing 22 changed files with 57 additions and 40 deletions.
2 changes: 2 additions & 0 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ skip_undocumented: true
xcodebuild_arguments:
- -sdk
- iphonesimulator
- -scheme
- DifferenceKit
2 changes: 1 addition & 1 deletion DifferenceKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'DifferenceKit'
spec.version = '0.8.0'
spec.version = '1.0.0'
spec.author = { 'ra1028' => '[email protected]' }
spec.homepage = 'https://github.com/ra1028/DifferenceKit'
spec.documentation_url = 'https://ra1028.github.io/DifferenceKit'
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source "https://rubygems.org"

gem 'cocoapods', '1.6.0.beta.1'
gem 'cocoapods', '1.6.0'
gem 'jazzy', '0.9.3'
32 changes: 16 additions & 16 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,51 @@ GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.0)
activesupport (4.2.10)
activesupport (4.2.11)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
atomos (0.1.3)
claide (1.0.2)
cocoapods (1.6.0.beta.1)
cocoapods (1.6.0)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.6.0.beta.1)
cocoapods-core (= 1.6.0)
cocoapods-deintegrate (>= 1.0.2, < 2.0)
cocoapods-downloader (>= 1.2.1, < 2.0)
cocoapods-downloader (>= 1.2.2, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-stats (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.3.1, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (~> 2.0.1)
fourflusher (>= 2.2.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.6.6)
nap (~> 1.0)
ruby-macho (~> 1.2)
xcodeproj (>= 1.6.0, < 2.0)
cocoapods-core (1.6.0.beta.1)
ruby-macho (~> 1.3, >= 1.3.1)
xcodeproj (>= 1.8.0, < 2.0)
cocoapods-core (1.6.0)
activesupport (>= 4.0.2, < 6)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
cocoapods-deintegrate (1.0.2)
cocoapods-downloader (1.2.1)
cocoapods-downloader (1.2.2)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.0)
cocoapods-stats (1.0.0)
cocoapods-stats (1.1.0)
cocoapods-trunk (1.3.1)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.1.0)
colored2 (3.1.2)
concurrent-ruby (1.0.5)
concurrent-ruby (1.1.4)
escape (0.0.4)
ffi (1.9.25)
fourflusher (2.0.1)
fourflusher (2.2.0)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
i18n (0.9.5)
Expand All @@ -73,7 +73,7 @@ GEM
ffi (>= 0.5.0, < 2)
redcarpet (3.4.0)
rouge (3.2.1)
ruby-macho (1.2.0)
ruby-macho (1.3.1)
sass (3.5.7)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
Expand All @@ -85,7 +85,7 @@ GEM
thread_safe (~> 0.1)
xcinvoke (0.3.0)
liferaft (~> 0.0.6)
xcodeproj (1.6.0)
xcodeproj (1.8.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
Expand All @@ -96,8 +96,8 @@ PLATFORMS
ruby

DEPENDENCIES
cocoapods (= 1.6.0.beta.1)
cocoapods (= 1.6.0)
jazzy (= 0.9.3)

BUNDLED WITH
1.16.5
1.17.1
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The algorithm is optimized based on the Paul Heckel's algorithm.
<a href="https://github.com/ra1028/DifferenceKit/releases/latest"><img alt="Release" src="https://img.shields.io/github/release/ra1028/DifferenceKit.svg"/></a>
<a href="https://cocoapods.org/pods/DifferenceKit"><img alt="CocoaPods" src="https://img.shields.io/cocoapods/v/DifferenceKit.svg"/></a>
<a href="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/Carthage/Carthage"><img alt="Carthage" src="https://img.shields.io/badge/Carthage-compatible-yellow.svg"/></a>
<a href="https://swift.org/package-manager"><img alt="Swift Package Manager" src="https://img.shields.io/badge/SwiftPM-compatible-yellowgreen.svg"/></a>
</br>
<a href="https://travis-ci.org/ra1028/DifferenceKit"><img alt="Build Status" src="https://travis-ci.org/ra1028/DifferenceKit.svg?branch=master"/></a>
<a href="https://developer.apple.com/"><img alt="Platform" src="https://img.shields.io/badge/platform-iOS%20%7C%20OSX%20%7C%20tvOS%20%7C%20watchOS-green.svg"/></a>
Expand Down Expand Up @@ -55,7 +56,6 @@ Implementation is [here](https://github.com/ra1028/DifferenceKit/blob/master/Sou
---

## Documentation
⚠️ Since DifferenceKit is currently released in alpha version, updates may contain breaking changes.
See docs in [GitHub Pages](https://ra1028.github.io/DifferenceKit/).
Documentation is generated by [jazzy](https://github.com/realm/jazzy).

Expand Down Expand Up @@ -333,7 +333,7 @@ let package = Package(
.executable(name: "yourexecutable", targets: ["yourexecutable"]),
],
dependencies: [
.package(url: "https://github.com/ra1028/DifferenceKit.git", from: "any version")
.package(url: "https://github.com/ra1028/DifferenceKit.git", from: "version")
],
targets: [
.target(name: "yourexecutable", dependencies: ["DifferenceKit"])
Expand Down
9 changes: 7 additions & 2 deletions Sources/AnyDifferentiable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ public struct AnyDifferentiable: Differentiable {
/// - base: A differentiable value to wrap.
@inlinable
public init<D: Differentiable>(_ base: D) {
box = DifferentiableBox(base)
if let anyDifferentiable = base as? AnyDifferentiable {
self = anyDifferentiable
}
else {
box = DifferentiableBox(base)
}
}

/// Indicate whether the content of `base` is equals to the content of the given source value.
Expand Down Expand Up @@ -86,7 +91,7 @@ internal struct DifferentiableBox<Base: Differentiable>: AnyDifferentiableBox {

@inlinable
internal var differenceIdentifier: AnyHashable {
return AnyHashable(baseComponent.differenceIdentifier)
return baseComponent.differenceIdentifier
}

@inlinable
Expand Down
10 changes: 10 additions & 0 deletions Tests/AnyDifferentiableTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,14 @@ final class AnyDifferentiableTestCase: XCTestCase {
XCTAssertEqual(d5.differenceIdentifier, d6.differenceIdentifier)
XCTAssertFalse(d5.isContentEqual(to: d6))
}

func testRedundantWrapping() {
let differentiable = 0
let anyDifferentiable1 = AnyDifferentiable(differentiable)
let anyDifferentiable2 = AnyDifferentiable(anyDifferentiable1)

XCTAssertEqual(anyDifferentiable1.base as? Int, differentiable)
XCTAssertEqual(anyDifferentiable2.base as? Int, differentiable)
XCTAssertEqual(anyDifferentiable1.base as? Int, anyDifferentiable2.base as? Int)
}
}
2 changes: 1 addition & 1 deletion docs/Extensions.html
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-01-21)</p>
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-02-08)</p>
<p>Generated by <a class="link" href="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/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/Extensions/Optional.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ <h4>Return Value</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-01-21)</p>
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-02-08)</p>
<p>Generated by <a class="link" href="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/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/Extensions/UICollectionView.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ <h4>Parameters</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-01-21)</p>
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-02-08)</p>
<p>Generated by <a class="link" href="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/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/Extensions/UITableView.html
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ <h4>Parameters</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-01-21)</p>
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-02-08)</p>
<p>Generated by <a class="link" href="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/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/Protocols.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-01-21)</p>
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-02-08)</p>
<p>Generated by <a class="link" href="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/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/Protocols/ContentEquatable.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ <h4>Return Value</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-01-21)</p>
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-02-08)</p>
<p>Generated by <a class="link" href="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/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/Protocols/Differentiable.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-01-21)</p>
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-02-08)</p>
<p>Generated by <a class="link" href="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/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/Protocols/DifferentiableSection.html
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ <h4>Parameters</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-01-21)</p>
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-02-08)</p>
<p>Generated by <a class="link" href="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/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/Structs.html
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-01-21)</p>
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-02-08)</p>
<p>Generated by <a class="link" href="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/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/Structs/AnyDifferentiable.html
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-01-21)</p>
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-02-08)</p>
<p>Generated by <a class="link" href="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/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/Structs/ArraySection.html
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-01-21)</p>
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-02-08)</p>
<p>Generated by <a class="link" href="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/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/Structs/Changeset.html
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-01-21)</p>
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-02-08)</p>
<p>Generated by <a class="link" href="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/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/Structs/ElementPath.html
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-01-21)</p>
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-02-08)</p>
<p>Generated by <a class="link" href="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/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/Structs/StagedChangeset.html
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ <h4>Declaration</h4>
</section>
</section>
<section id="footer">
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-01-21)</p>
<p>&copy; 2019 <a class="link" href="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/ra1028" target="_blank" rel="external">Ryo Aoyama</a>. All rights reserved. (Last updated: 2019-02-08)</p>
<p>Generated by <a class="link" href="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/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
Expand Down
Loading

0 comments on commit fcb2953

Please sign in to comment.