Repository: expo/expo
File: packages/expo-modules-core/ios/Core/Records/Formatter.swift (Swift)

Code before:
  class ActionBuilder<InputType> {
    typealias NextBuilder<T> = PropertySelector.ActionBuilder<T>

    private let propertySelector: PropertySelector<RecordType>

    init (selector: PropertySelector<RecordType>) {
      propertySelector = selector
    }

    @discardableResult func map<ResultType>(
      _ mapper: @escaping (RecordType, InputType) -> ResultType
    ) -> NextBuilder<ResultType> {
      return chainAction { record, value in mapper(record, value as! InputType ) }
    }

    @discardableResult func map<ResultType>(
      _ mapper: @escaping ( InputType) -> ResultType
    ) -> NextBuilder<ResultType> {
      return chainAction { _, value in mapper(value as! InputType ) }
    }

    @discardableResult func skip() -> NextBuilder<InputType> {
      return chainSkipAction(shouldSkip: { _, _ in true })
    }

    @discardableResult func skip(
      _ valueSelector: @escaping (RecordType, InputType) -> Bool
    ) -> NextBuilder<InputType> {
      return chainSkipAction(shouldSkip: valueSelector)
    }

    @discardableResult func skip(
      _ valueSelector: @escaping (InputType) -> Bool
    ) -> NextBuilder<InputType> {
      return chainSkipAction { _, value in valueSelector(value) }
    }

    private func chainAction<NextInputType>(
      nextAction: @escaping (RecordType, Any?) -> Any?
    ) -> NextBuilder<NextInputType> {
      let previouseAction = propertySelector.action
      propertySelector.action = { record, value in
        let previousValue = previouseAction(record, value)
        if previousValue is Skip {
          return Skip.instance
        }

        return nextAction(record, previousValue)
      }

      return PropertySelector.ActionBuilder(selector: propertySelector)

Review comment (suggestion):
```suggestion
    @discardableResult
    func skip(
```

Code after:

public class PropertySelector<RecordType: Record> {
  public class ActionBuilder<InputType> {
    public typealias NextBuilder<T> = PropertySelector.ActionBuilder<T>

    private let propertySelector: PropertySelector<RecordType>

    internal init(selector: PropertySelector<RecordType>) {
      propertySelector = selector
    }

    @discardableResult
    public func map<ResultType>(
      _ mapper: @escaping (RecordType, InputType) -> ResultType
    ) -> NextBuilder<ResultType> {
      return chainAction { record, value in mapper(record, value as! InputType ) }
    }

    @discardableResult
    public func map<ResultType>(
      _ mapper: @escaping ( InputType) -> ResultType
    ) -> NextBuilder<ResultType> {
      return chainAction { _, value in mapper(value as! InputType ) }
    }

    @discardableResult
    public func skip() -> NextBuilder<InputType> {
      return chainSkipAction(shouldSkip: { _, _ in true })
    }

    @discardableResult
    public func skip(
      _ valueSelector: @escaping (RecordType, InputType) -> Bool
    ) -> NextBuilder<InputType> {
      return chainSkipAction(shouldSkip: valueSelector)
    }

    @discardableResult
    public func skip(
      _ valueSelector: @escaping (InputType) -> Bool
    ) -> NextBuilder<InputType> {
      return chainSkipAction { _, value in valueSelector(value) }
    }

    private func chainAction<NextInputType>(
      nextAction: @escaping (RecordType, Any?) -> Any?
    ) -> NextBuilder<NextInputType> {
      let previousAction = propertySelector.action
      propertySelector.action = { record, value in
        let previousValue = previousAction(record, value)
        if previousValue is Skip {