├── .github ├── FUNDING.yml └── ISSUE_TEMPLATE │ └── feature-template.md ├── docs ├── favicon.ico ├── developer-og.jpg ├── developer-og-twitter.jpg ├── metadata.json ├── img │ ├── deprecated-icon.7bf1740a.svg │ ├── added-icon.832a5d2c.svg │ └── modified-icon.efb2697d.svg ├── js │ ├── highlight-js-shell-js.0ad5b20f.js │ ├── highlight-js-json-js.2a1856ba.js │ ├── highlight-js-diff-js.4db9a783.js │ └── highlight-js-http-js.f78e83c2.js ├── favicon.svg ├── index.html └── documentation │ └── wand │ ├── ask │ ├── index.html │ ├── key │ │ └── index.html │ ├── next │ │ └── index.html │ ├── once │ │ └── index.html │ ├── cancel() │ │ └── index.html │ ├── handler │ │ └── index.html │ ├── head(_:) │ │ └── index.html │ └── option │ │ └── index.html │ ├── index.html │ ├── asking │ ├── index.html │ ├── every │ │ └── index.html │ └── one │ │ └── index.html │ ├── core │ ├── all │ │ └── index.html │ ├── index.html │ ├── key │ │ └── index.html │ ├── asking │ │ └── index.html │ ├── close() │ │ └── index.html │ ├── context │ │ └── index.html │ ├── error │ │ └── index.html │ ├── init(_:) │ │ └── index.html │ ├── iswanded │ │ └── index.html │ ├── to(_:) │ │ └── index.html │ ├── wand │ │ └── index.html │ └── weak │ │ └── index.html │ ├── log(_:) │ └── index.html │ ├── memory │ └── index.html │ ├── swift │ ├── index.html │ └── string │ │ └── index.html │ ├── wanded │ └── index.html │ ├── _(_:)-13r4h │ └── index.html │ ├── _(_:)-18ln3 │ └── index.html │ ├── _(_:)-1bavu │ └── index.html │ ├── _(_:)-1mfbc │ └── index.html │ ├── _(_:)-1tvgk │ └── index.html │ ├── _(_:)-1u2bc │ └── index.html │ ├── _(_:)-1v5ni │ └── index.html │ ├── _(_:)-202y7 │ └── index.html │ ├── _(_:)-2go0i │ └── index.html │ ├── _(_:)-2hxn9 │ └── index.html │ ├── _(_:)-3s8xb │ └── index.html │ ├── _(_:)-3sck7 │ └── index.html │ ├── _(_:)-40hxn │ └── index.html │ ├── _(_:)-4dw2e │ └── index.html │ ├── _(_:)-4i3dl │ └── index.html │ ├── _(_:)-4q8rw │ └── index.html │ ├── _(_:)-4zli6 │ └── index.html │ ├── _(_:)-51y1n │ └── index.html │ ├── _(_:)-569lk │ └── index.html │ ├── _(_:)-5ldz │ └── index.html │ ├── _(_:)-64bw1 │ └── index.html │ ├── _(_:)-67rzz │ └── index.html │ ├── _(_:)-6zb77 │ └── index.html │ ├── _(_:)-813vv │ └── index.html │ ├── _(_:)-8zdky │ └── index.html │ ├── _(_:)-97g91 │ └── index.html │ ├── _(_:)-xo1o │ └── index.html │ ├── _(_:_:)-18wl5 │ └── index.html │ ├── _(_:_:)-1cpd8 │ └── index.html │ ├── _(_:_:)-1dib3 │ └── index.html │ ├── _(_:_:)-328ac │ └── index.html │ ├── _(_:_:)-32g29 │ └── index.html │ ├── _(_:_:)-3t0uk │ └── index.html │ ├── _(_:_:)-4lknp │ └── index.html │ ├── _(_:_:)-4tlmq │ └── index.html │ ├── _(_:_:)-5o35u │ └── index.html │ ├── _(_:_:)-5ox9r │ └── index.html │ ├── _(_:_:)-72ind │ └── index.html │ ├── _(_:_:)-7kg27 │ └── index.html │ ├── _(_:_:)-7xwgb │ └── index.html │ ├── askingnil │ └── index.html │ ├── obtainable │ └── index.html │ └── ubiquitous │ └── index.html ├── Sources └── Wand │ ├── Ask │ ├── Error │ │ └── .DS_Store │ └── Addons │ │ ├── Counting.swift │ │ ├── All.swift │ │ ├── Any.swift │ │ ├── Addons.swift │ │ ├── Option.swift │ │ └── Error?.swift │ ├── Core │ ├── Key.swift │ ├── State.swift │ └── Weak.swift │ ├── |.swift │ ├── |tools │ ├── Describing │ │ ├── Describing.swift │ │ ├── Describing_Character.swift │ │ └── Describing_Data.swift │ ├── Convertible │ │ ├── CoreGraphics_Convertible.swift │ │ └── Numbers_Convertible.swift │ ├── Expressible │ │ ├── ExpressibleByArray.swift │ │ └── ExpressibleByDictionary.swift │ ├── Memory.swift │ └── Log.swift │ ├── Wand.md │ └── Wanded │ └── Wanded.swift ├── App ├── Assets.xcassets │ ├── Contents.json │ ├── AppIcon.appiconset │ │ ├── magic-wand-transformed-108.png │ │ ├── magic-wand-transformed-128.png │ │ ├── magic-wand-transformed-16.png │ │ ├── magic-wand-transformed-20.png │ │ ├── magic-wand-transformed-256.png │ │ ├── magic-wand-transformed-29.png │ │ ├── magic-wand-transformed-32.png │ │ ├── magic-wand-transformed-40.png │ │ ├── magic-wand-transformed-512.png │ │ ├── magic-wand-transformed-64.png │ │ ├── magic-wand-transformed-76.png │ │ ├── magic-wand-transformed-1024 1.png │ │ ├── magic-wand-transformed-1024.png │ │ ├── magic-wand-transformed-108@2x.png │ │ ├── magic-wand-transformed-117@2x.png │ │ ├── magic-wand-transformed-20@2x.png │ │ ├── magic-wand-transformed-20@3x.png │ │ ├── magic-wand-transformed-24@2x.png │ │ ├── magic-wand-transformed-256 1.png │ │ ├── magic-wand-transformed-29@2x.png │ │ ├── magic-wand-transformed-29@3x.png │ │ ├── magic-wand-transformed-32 1.png │ │ ├── magic-wand-transformed-33@2x.png │ │ ├── magic-wand-transformed-40@2x.png │ │ ├── magic-wand-transformed-40@3x.png │ │ ├── magic-wand-transformed-44@2x.png │ │ ├── magic-wand-transformed-46@2x.png │ │ ├── magic-wand-transformed-50@2x.png │ │ ├── magic-wand-transformed-512 1.png │ │ ├── magic-wand-transformed-51@2x.png │ │ ├── magic-wand-transformed-60@2x.png │ │ ├── magic-wand-transformed-60@3x.png │ │ ├── magic-wand-transformed-76@2x.png │ │ ├── magic-wand-transformed-86@2x.png │ │ ├── magic-wand-transformed-98@2x.png │ │ ├── magic-wand-transformed-1024@1x.png │ │ ├── magic-wand-transformed-256 copy.png │ │ ├── magic-wand-transformed-27-5@2x.png │ │ ├── magic-wand-transformed-29@2x 1.png │ │ ├── magic-wand-transformed-29@3x 1.png │ │ ├── magic-wand-transformed-40@2x 1.png │ │ └── magic-wand-transformed-83.5@2x.png │ ├── App Icon & Top Shelf Image.brandassets │ │ ├── Top Shelf Image.imageset │ │ │ ├── TopShelfImage.png │ │ │ ├── TopShelfImage@2x.png │ │ │ └── Contents.json │ │ ├── Top Shelf Image Wide.imageset │ │ │ ├── TopShelfImageWide.png │ │ │ ├── TopShelfImageWide@2x.png │ │ │ └── Contents.json │ │ ├── AppIcon.imagestack │ │ │ ├── 1.imagestacklayer │ │ │ │ ├── Content.imageset │ │ │ │ │ ├── 1.png │ │ │ │ │ ├── 1@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ └── Contents.json │ │ │ ├── 2.imagestacklayer │ │ │ │ ├── Content.imageset │ │ │ │ │ ├── 2.png │ │ │ │ │ ├── 2@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── App Icon - App Store.imagestack │ │ │ ├── 1.imagestacklayer │ │ │ │ ├── Content.imageset │ │ │ │ │ ├── 1.png │ │ │ │ │ ├── 1@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ └── Contents.json │ │ │ ├── 2.imagestacklayer │ │ │ │ ├── Content.imageset │ │ │ │ │ ├── 2.png │ │ │ │ │ ├── 2@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ └── Contents.json │ └── AccentColor.colorset │ │ └── Contents.json ├── WatchTestPlan.xctestplan ├── TestPlan.xctestplan ├── Play.swift ├── Info.plist └── WatchInfo.plist ├── .swiftpm └── xcode │ └── package.xcworkspace │ └── contents.xcworkspacedata ├── Wand.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ ├── WorkspaceSettings.xcsettings │ │ └── swiftpm │ │ └── Package.resolved └── xcshareddata │ └── swiftpm │ └── Package.resolved ├── NOTICE.txt ├── Tests ├── Package.xctestplan └── WandTests │ ├── Unit │ └── Unit.swift │ ├── unit │ ├── Vector.swift │ └── T_Tests.swift │ └── cases │ ├── Errors_Tests.swift │ ├── Describing_Tests.swift │ └── Init Tests │ └── Core_Init_Array_Tests.swift ├── README.MD ├── Info.plist ├── Wand.md ├── packages.json ├── Package.resolved ├── .gitignore └── Package.swift /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | patreon: alkozin 2 | -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/docs/favicon.ico -------------------------------------------------------------------------------- /docs/developer-og.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/docs/developer-og.jpg -------------------------------------------------------------------------------- /docs/developer-og-twitter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/docs/developer-og-twitter.jpg -------------------------------------------------------------------------------- /Sources/Wand/Ask/Error/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/Sources/Wand/Ask/Error/.DS_Store -------------------------------------------------------------------------------- /docs/metadata.json: -------------------------------------------------------------------------------- 1 | {"bundleDisplayName":"Wand","bundleID":"Wand","schemaVersion":{"major":0,"patch":0,"minor":1}} -------------------------------------------------------------------------------- /App/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-108.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-108.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-128.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-16.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-20.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-256.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-29.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-32.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-40.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-512.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-64.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-76.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-1024 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-1024 1.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-1024.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-108@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-108@2x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-117@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-117@2x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-20@2x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-20@3x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-24@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-24@2x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-256 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-256 1.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-29@2x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-29@3x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-32 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-32 1.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-33@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-33@2x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-40@2x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-40@3x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-44@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-44@2x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-46@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-46@2x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-50@2x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-512 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-512 1.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-51@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-51@2x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-60@2x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-60@3x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-76@2x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-86@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-86@2x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-98@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-98@2x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-1024@1x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-256 copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-256 copy.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-27-5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-27-5@2x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-29@2x 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-29@2x 1.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-29@3x 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-29@3x 1.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-40@2x 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-40@2x 1.png -------------------------------------------------------------------------------- /App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/AppIcon.appiconset/magic-wand-transformed-83.5@2x.png -------------------------------------------------------------------------------- /.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Wand.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-template.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature template 3 | about: Default feature template 4 | title: '' 5 | labels: '' 6 | assignees: alkozin 7 | 8 | --- 9 | 10 | Implement `Type` Asking/AskingNil conformance 11 | -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/TopShelfImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/TopShelfImage.png -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/TopShelfImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/TopShelfImage@2x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/TopShelfImageWide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/TopShelfImageWide.png -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/TopShelfImageWide@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/TopShelfImageWide@2x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/AppIcon.imagestack/1.imagestacklayer/Content.imageset/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/AppIcon.imagestack/1.imagestacklayer/Content.imageset/1.png -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/AppIcon.imagestack/2.imagestacklayer/Content.imageset/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/AppIcon.imagestack/2.imagestacklayer/Content.imageset/2.png -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/AppIcon.imagestack/1.imagestacklayer/Content.imageset/1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/AppIcon.imagestack/1.imagestacklayer/Content.imageset/1@2x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/AppIcon.imagestack/2.imagestacklayer/Content.imageset/2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/AppIcon.imagestack/2.imagestacklayer/Content.imageset/2@2x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/1.imagestacklayer/Content.imageset/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/1.imagestacklayer/Content.imageset/1.png -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/2.imagestacklayer/Content.imageset/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/2.imagestacklayer/Content.imageset/2.png -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/1.imagestacklayer/Content.imageset/1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/1.imagestacklayer/Content.imageset/1@2x.png -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/2.imagestacklayer/Content.imageset/2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/The-Wand/Wand/HEAD/App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/2.imagestacklayer/Content.imageset/2@2x.png -------------------------------------------------------------------------------- /Wand.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /App/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "platform" : "universal", 6 | "reference" : "systemIndigoColor" 7 | }, 8 | "idiom" : "universal" 9 | } 10 | ], 11 | "info" : { 12 | "author" : "xcode", 13 | "version" : 1 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Wand.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/AppIcon.imagestack/1.imagestacklayer/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "properties" : { 3 | "frame-center" : { 4 | "y" : 120, 5 | "x" : 200 6 | }, 7 | "frame-size" : { 8 | "width" : 240, 9 | "height" : 240 10 | } 11 | }, 12 | "info" : { 13 | "version" : 1, 14 | "author" : "xcode" 15 | } 16 | } -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/AppIcon.imagestack/2.imagestacklayer/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "properties" : { 3 | "frame-size" : { 4 | "height" : 240, 5 | "width" : 400 6 | }, 7 | "frame-center" : { 8 | "x" : 200, 9 | "y" : 120 10 | } 11 | }, 12 | "info" : { 13 | "version" : 1, 14 | "author" : "xcode" 15 | } 16 | } -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/1.imagestacklayer/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | }, 6 | "properties" : { 7 | "frame-center" : { 8 | "x" : 420, 9 | "y" : 420 10 | }, 11 | "frame-size" : { 12 | "height" : 240, 13 | "width" : 240 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/2.imagestacklayer/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | }, 6 | "properties" : { 7 | "frame-center" : { 8 | "x" : 640, 9 | "y" : 384 10 | }, 11 | "frame-size" : { 12 | "height" : 768, 13 | "width" : 1280 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | }, 6 | "images" : [ 7 | { 8 | "filename" : "TopShelfImage.png", 9 | "idiom" : "tv", 10 | "scale" : "1x" 11 | }, 12 | { 13 | "filename" : "TopShelfImage@2x.png", 14 | "scale" : "2x", 15 | "idiom" : "tv" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/AppIcon.imagestack/1.imagestacklayer/Content.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | }, 6 | "images" : [ 7 | { 8 | "idiom" : "tv", 9 | "filename" : "1.png", 10 | "scale" : "1x" 11 | }, 12 | { 13 | "idiom" : "tv", 14 | "filename" : "1@2x.png", 15 | "scale" : "2x" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/AppIcon.imagestack/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "properties" : { 3 | "canvasSize" : { 4 | "width" : 400, 5 | "height" : 240 6 | } 7 | }, 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "layers" : [ 13 | { 14 | "filename" : "1.imagestacklayer" 15 | }, 16 | { 17 | "filename" : "2.imagestacklayer" 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/AppIcon.imagestack/2.imagestacklayer/Content.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "2.png", 5 | "idiom" : "tv", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "2@2x.png", 10 | "idiom" : "tv", 11 | "scale" : "2x" 12 | } 13 | ], 14 | "info" : { 15 | "author" : "xcode", 16 | "version" : 1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "scale" : "1x", 5 | "filename" : "TopShelfImageWide.png", 6 | "idiom" : "tv" 7 | }, 8 | { 9 | "scale" : "2x", 10 | "idiom" : "tv", 11 | "filename" : "TopShelfImageWide@2x.png" 12 | } 13 | ], 14 | "info" : { 15 | "version" : 1, 16 | "author" : "xcode" 17 | } 18 | } -------------------------------------------------------------------------------- /NOTICE.txt: -------------------------------------------------------------------------------- 1 | The Wand 2 | Copyright 2020 Alexander Kozin 3 | 4 | This product includes software developed by 5 | Alexander Kozin (al.kozin@gmail.com, al@el-machine.com). 6 | 7 | The Wand icon in 8 | Assets 9 | was downloaded from Flaticon. (https://flaticon.com/free-icons/wand) 10 | 11 | The Wand icon in 12 | Assets 13 | was increased in size by AI. 14 | 15 | Error handling section in 16 | README.md 17 | was inspired by ChatGPT. (https://chatgpt.com) 18 | -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/1.imagestacklayer/Content.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "1.png", 5 | "idiom" : "tv", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "1@2x.png", 10 | "idiom" : "tv", 11 | "scale" : "2x" 12 | } 13 | ], 14 | "info" : { 15 | "author" : "xcode", 16 | "version" : 1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/2.imagestacklayer/Content.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "2.png", 5 | "idiom" : "tv", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "2@2x.png", 10 | "idiom" : "tv", 11 | "scale" : "2x" 12 | } 13 | ], 14 | "info" : { 15 | "author" : "xcode", 16 | "version" : 1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | }, 6 | "layers" : [ 7 | { 8 | "filename" : "1.imagestacklayer" 9 | }, 10 | { 11 | "filename" : "2.imagestacklayer" 12 | } 13 | ], 14 | "properties" : { 15 | "canvasSize" : { 16 | "height" : 768, 17 | "width" : 1280 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Wand.xcodeproj/xcshareddata/swiftpm/Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "originHash" : "34ec54141f8c6c6ba2abdb4b656271f378bf8ab588a259801929a3ab72792056", 3 | "pins" : [ 4 | { 5 | "identity" : "any", 6 | "kind" : "remoteSourceControl", 7 | "location" : "https://github.com/el-machine/Any.git", 8 | "state" : { 9 | "revision" : "7cae63b1a897006d9d1cadef06ea266415f1b3e5", 10 | "version" : "1.0.2" 11 | } 12 | } 13 | ], 14 | "version" : 3 15 | } 16 | -------------------------------------------------------------------------------- /Tests/Package.xctestplan: -------------------------------------------------------------------------------- 1 | { 2 | "configurations" : [ 3 | { 4 | "id" : "7E1EF4E5-10CC-4EB2-BA49-647A0C6D8443", 5 | "name" : "Test Scheme Action", 6 | "options" : { 7 | 8 | } 9 | } 10 | ], 11 | "defaultOptions" : { 12 | }, 13 | "testTargets" : [ 14 | { 15 | "target" : { 16 | "containerPath" : "container:", 17 | "identifier" : "WandTests", 18 | "name" : "WandTests" 19 | } 20 | } 21 | ], 22 | "version" : 1 23 | } 24 | -------------------------------------------------------------------------------- /Wand.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "originHash" : "34ec54141f8c6c6ba2abdb4b656271f378bf8ab588a259801929a3ab72792056", 3 | "pins" : [ 4 | { 5 | "identity" : "any", 6 | "kind" : "remoteSourceControl", 7 | "location" : "https://github.com/el-machine/Any.git", 8 | "state" : { 9 | "revision" : "ba94ebd40a70c5d6d058ae25f3b7cacb810dfec4", 10 | "version" : "1.0.1" 11 | } 12 | } 13 | ], 14 | "version" : 3 15 | } 16 | -------------------------------------------------------------------------------- /README.MD: -------------------------------------------------------------------------------- 1 | The project will be suspended due to the need to find money for DTV Visa 2 | 3 | [🏛️ |Foundation](https://github.com/The-Wand/Foundation) 4 | ~~[🔖 |Location](https://github.com/The-Wand/Location)~~ 5 | ~~[🏃 |Motion](https://github.com/The-Wand/Motion)~~ 6 | ~~[📡 |NFC](https://github.com/The-Wand/NFC)~~ 7 | [🖥️ |URL](https://github.com/The-Wand/URL) 8 | ~~[🌤️ |Weather](https://github.com/The-Wand/Weather)~~ 9 | 10 | ~~[👓 |Vision Demo](https://github.com/The-Wand/Vision-Demo)~~ 11 | ~~[📤 |Integrations](https://github.com/The-Wand/Solutions)~~ 12 | -------------------------------------------------------------------------------- /docs/img/deprecated-icon.7bf1740a.svg: -------------------------------------------------------------------------------- 1 | 10 | 11 | -------------------------------------------------------------------------------- /App/WatchTestPlan.xctestplan: -------------------------------------------------------------------------------- 1 | { 2 | "configurations" : [ 3 | { 4 | "id" : "738A3088-B67E-401C-BFC1-D5E393C715FF", 5 | "name" : "Configuration 1", 6 | "options" : { 7 | 8 | } 9 | } 10 | ], 11 | "defaultOptions" : { 12 | "locationScenario" : { 13 | "identifier" : "Tokyo, Japan", 14 | "referenceType" : "built-in" 15 | } 16 | }, 17 | "testTargets" : [ 18 | { 19 | "target" : { 20 | "containerPath" : "container:Wand.xcodeproj", 21 | "identifier" : "613966472BE0F87A004C18A3", 22 | "name" : "WatchPlayTests" 23 | } 24 | } 25 | ], 26 | "version" : 1 27 | } 28 | -------------------------------------------------------------------------------- /App/TestPlan.xctestplan: -------------------------------------------------------------------------------- 1 | { 2 | "configurations" : [ 3 | { 4 | "id" : "63B646C1-A26B-4FC6-88F7-327B2E6F5B5D", 5 | "name" : "Configuration 1", 6 | "options" : { 7 | 8 | } 9 | } 10 | ], 11 | "defaultOptions" : { 12 | "locationScenario" : { 13 | "identifier" : "Tokyo, Japan", 14 | "referenceType" : "built-in" 15 | }, 16 | "testTimeoutsEnabled" : true 17 | }, 18 | "testTargets" : [ 19 | { 20 | "target" : { 21 | "containerPath" : "container:Wand.xcodeproj", 22 | "identifier" : "pipe::PipeTests", 23 | "name" : "WandTests" 24 | } 25 | } 26 | ], 27 | "version" : 1 28 | } 29 | -------------------------------------------------------------------------------- /docs/img/added-icon.832a5d2c.svg: -------------------------------------------------------------------------------- 1 | 10 | 11 | -------------------------------------------------------------------------------- /docs/js/highlight-js-shell-js.0ad5b20f.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (self["webpackChunkswift_docc_render"]=self["webpackChunkswift_docc_render"]||[]).push([[176],{7874:function(s){function e(s){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}s.exports=e}}]); -------------------------------------------------------------------------------- /Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | ru 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 2.0.9 19 | CFBundleVersion 20 | 1730 21 | 22 | 23 | -------------------------------------------------------------------------------- /Wand.md: -------------------------------------------------------------------------------- 1 | 2 | # ``Wand`` 3 | 4 | The app displays a list of available gifts. Select a gift, then enter shipping information. Finally, write a gift message along with the recipient's email addressesWand started from the idea about receiving anything in most efficient way.. 5 | 6 | ## Overview 7 | 8 | Through this app, you'll learn all about focus management in SwiftUI using modifiers and wrappers like **FocusState** to help users navigate forms more effectively. 9 | 10 | You'll learn how to: 11 | - Use the **FocusState** property wrapper with both the **focused(_:)** and **focused(_:equals:)** modifiers. 12 | - Manage focus in lists and with the MVVM design pattern. 13 | - Use the **FocusedValue** and **FocusedBinding** property wrappers to track and change the wrapped values of focused views from other scenes. 14 | -------------------------------------------------------------------------------- /packages.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "The Wand", 3 | "overview": "The Wand Swift plugins", 4 | "author": { 5 | "name": "Alex Kozin" 6 | }, 7 | "keywords": [ 8 | "wand", 9 | "tdd", 10 | "factory-method", 11 | "oracle-machine", 12 | "modules", 13 | "plugins", 14 | "swift" 15 | ], 16 | "packages": [ 17 | { 18 | "url": "https://github.com/The-Wand/Foundation.git" 19 | }, 20 | { 21 | "url": "https://github.com/The-Wand/Location.git" 22 | }, 23 | { 24 | "url": "https://github.com/The-Wand/Motion.git" 25 | }, 26 | { 27 | "url": "https://github.com/The-Wand/NFC.git" 28 | }, 29 | { 30 | "url": "https://github.com/The-Wand/Weather.git" 31 | }, 32 | { 33 | "url": "https://github.com/The-Wand/URL.git" 34 | } 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /Sources/Wand/Core/Key.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | extension Core { 20 | 21 | public 22 | typealias Key = String 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Sources/Wand/|.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | /// 20 | /// e|| ♟️ 21 | prefix operator | 22 | postfix operator | 23 | infix operator | : AdditionPrecedence 24 | -------------------------------------------------------------------------------- /docs/js/highlight-js-json-js.2a1856ba.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (self["webpackChunkswift_docc_render"]=self["webpackChunkswift_docc_render"]||[]).push([[82],{14:function(e){function n(e){const n={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},c={match:/[{}[\],:]/,className:"punctuation",relevance:0},a={beginKeywords:["true","false","null"].join(" ")};return{name:"JSON",contains:[n,c,e.QUOTE_STRING_MODE,a,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}e.exports=n}}]); -------------------------------------------------------------------------------- /App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "assets" : [ 3 | { 4 | "filename" : "App Icon - App Store.imagestack", 5 | "idiom" : "tv", 6 | "role" : "primary-app-icon", 7 | "size" : "1280x768" 8 | }, 9 | { 10 | "filename" : "AppIcon.imagestack", 11 | "idiom" : "tv", 12 | "role" : "primary-app-icon", 13 | "size" : "400x240" 14 | }, 15 | { 16 | "filename" : "Top Shelf Image Wide.imageset", 17 | "idiom" : "tv", 18 | "role" : "top-shelf-image-wide", 19 | "size" : "2320x720" 20 | }, 21 | { 22 | "filename" : "Top Shelf Image.imageset", 23 | "idiom" : "tv", 24 | "role" : "top-shelf-image", 25 | "size" : "1920x720" 26 | } 27 | ], 28 | "info" : { 29 | "author" : "xcode", 30 | "version" : 1 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Sources/Wand/|tools/Describing/Describing.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | ///<#Any#> to String 20 | @inline(__always) 21 | postfix 22 | public 23 | func |(object: T) -> String { 24 | String(describing: object) 25 | } 26 | -------------------------------------------------------------------------------- /Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "pins" : [ 3 | { 4 | "identity" : "any", 5 | "kind" : "remoteSourceControl", 6 | "location" : "https://github.com/The-Wand/Any.git", 7 | "state" : { 8 | "revision" : "ba94ebd40a70c5d6d058ae25f3b7cacb810dfec4", 9 | "version" : "1.0.1" 10 | } 11 | }, 12 | { 13 | "identity" : "swift-docc-plugin", 14 | "kind" : "remoteSourceControl", 15 | "location" : "https://github.com/swiftlang/swift-docc-plugin", 16 | "state" : { 17 | "revision" : "3e4f133a77e644a5812911a0513aeb7288b07d06", 18 | "version" : "1.4.5" 19 | } 20 | }, 21 | { 22 | "identity" : "swift-docc-symbolkit", 23 | "kind" : "remoteSourceControl", 24 | "location" : "https://github.com/swiftlang/swift-docc-symbolkit", 25 | "state" : { 26 | "revision" : "b45d1f2ed151d057b54504d653e0da5552844e34", 27 | "version" : "1.0.0" 28 | } 29 | } 30 | ], 31 | "version" : 2 32 | } 33 | -------------------------------------------------------------------------------- /Sources/Wand/Core/State.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | import Foundation 20 | 21 | public 22 | extension Core { 23 | 24 | enum State { 25 | case ready, active 26 | } 27 | 28 | var state: State { 29 | asking.isEmpty ? .ready : .active 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /docs/js/highlight-js-diff-js.4db9a783.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (self["webpackChunkswift_docc_render"]=self["webpackChunkswift_docc_render"]||[]).push([[213],{7731:function(e){function n(e){const n=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:n.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:n.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}e.exports=n}}]); -------------------------------------------------------------------------------- /Sources/Wand/|tools/Describing/Describing_Character.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | @inline(__always) 20 | postfix 21 | public 22 | func |(char: Character) -> UInt32 { 23 | char.unicodeScalars.first!.value 24 | } 25 | 26 | @inline(__always) 27 | postfix 28 | public 29 | func |(value: Int) -> Character { 30 | Character(UnicodeScalar(value)!) 31 | } 32 | -------------------------------------------------------------------------------- /Sources/Wand/Core/Weak.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | extension Core { 20 | 21 | public 22 | struct Weak { 23 | 24 | public 25 | weak 26 | var item: Core? 27 | 28 | @inline(__always) 29 | public 30 | init(item: Core) { 31 | self.item = item 32 | } 33 | 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Sources/Wand/|tools/Convertible/CoreGraphics_Convertible.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | #if canImport(CoreGraphics) 20 | import CoreGraphics 21 | 22 | @inline(__always) 23 | public 24 | postfix 25 | func |(value: CGFloat) -> Float { 26 | Float(value) 27 | } 28 | 29 | @inline(__always) 30 | postfix 31 | public 32 | func |(value: any BinaryInteger) -> CGFloat { 33 | CGFloat(value) 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /docs/img/modified-icon.efb2697d.svg: -------------------------------------------------------------------------------- 1 | 10 | 11 | -------------------------------------------------------------------------------- /Tests/WandTests/Unit/Unit.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | import Wand 20 | import XCTest 21 | 22 | /// Test unit 23 | //struct Unit { 24 | // 25 | //} 26 | 27 | extension TimeInterval { 28 | 29 | static var `default` = 4.2 30 | 31 | } 32 | 33 | ///Performance 34 | extension [XCTMetric] { 35 | 36 | static 37 | var `default`: Self = {[ 38 | XCTCPUMetric(), 39 | XCTClockMetric(), 40 | XCTMemoryMetric(), 41 | XCTStorageMetric(), 42 | ]}() 43 | 44 | } 45 | -------------------------------------------------------------------------------- /Sources/Wand/Wand.md: -------------------------------------------------------------------------------- 1 | 2 | # ``Wand`` 3 | 4 | Swift implementation of declarative approach. 5 | Use pipeline syntax to receive <#Any#> object. 6 | Bus for <#Any#> Factory + Cache. 7 | 8 | ```swift 9 | | .one { (t: <#T#>) in 10 | 11 | } | .every { (u: <#U#>) in 12 | 13 | } | .while { (v: <#V#>) in 14 | 15 | } | { (error: Error) in 16 | 17 | } | .all { _ in 18 | 19 | } 20 | ``` 21 | 22 | @version 3 23 | ## Overview 24 | 25 | Call the operator with handler to receive only one object: 26 | ```swift 27 | |{ (t: <#T#>) in 28 | 29 | } 30 | ``` 31 | 32 | Custom `labels` for deep control: 33 | - **One** to receive an object and stop 34 | ```swift 35 | | .one { (t: <#T#>) in 36 | 37 | } 38 | ``` 39 | 40 | - **Every** for continius updates 41 | ```swift 42 | | .every { (t: <#T#>) in 43 | 44 | } 45 | ``` 46 | 47 | - **While** handler returns **true** 48 | ```swift 49 | | .while { (t: <#T#>) in 50 | 51 | } 52 | ``` 53 | 54 | ```swift 55 | ``` 56 | 57 | Error handling: 58 | ```swift 59 | | { (error: Error) in 60 | 61 | } 62 | ``` 63 | 64 | Notifications: 65 | - **All** 66 | ```swift 67 | | .all { (wand: Wand.Core) in 68 | 69 | } 70 | ``` 71 | 72 | - **Any** to 73 | ```swift 74 | | .any { (t: <#T#>) in 75 | 76 | } 77 | ``` 78 | -------------------------------------------------------------------------------- /docs/js/highlight-js-http-js.f78e83c2.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * This source file is part of the Swift.org open source project 3 | * 4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors 5 | * Licensed under Apache License v2.0 with Runtime Library Exception 6 | * 7 | * See https://swift.org/LICENSE.txt for license information 8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors 9 | */ 10 | (self["webpackChunkswift_docc_render"]=self["webpackChunkswift_docc_render"]||[]).push([[878],{8937:function(e){function n(e){const n=e.regex,a="HTTP/(2|1\\.[01])",s=/[A-Za-z][A-Za-z0-9-]*/,t={className:"attribute",begin:n.concat("^",s,"(?=\\:\\s)"),starts:{contains:[{className:"punctuation",begin:/: /,relevance:0,starts:{end:"$",relevance:0}}]}},i=[t,{begin:"\\n\\n",starts:{subLanguage:[],endsWithParent:!0}}];return{name:"HTTP",aliases:["https"],illegal:/\S/,contains:[{begin:"^(?="+a+" \\d{3})",end:/$/,contains:[{className:"meta",begin:a},{className:"number",begin:"\\b\\d{3}\\b"}],starts:{end:/\b\B/,illegal:/\S/,contains:i}},{begin:"(?=^[A-Z]+ (.*?) "+a+"$)",end:/$/,contains:[{className:"string",begin:" ",end:" ",excludeBegin:!0,excludeEnd:!0},{className:"meta",begin:a},{className:"keyword",begin:"[A-Z]+"}],starts:{end:/\b\B/,illegal:/\S/,contains:i}},e.inherit(t,{relevance:0})]}}e.exports=n}}]); -------------------------------------------------------------------------------- /Sources/Wand/Ask/Addons/Counting.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | extension Ask { 20 | 21 | /// Ask while counting 22 | /// 23 | /// |.while { (object, i) in 24 | /// 25 | /// } 26 | /// 27 | @inline(__always) 28 | public 29 | static 30 | func `while`(key: String? = nil, 31 | handler: @escaping (T, Int)->(Bool) ) -> Ask { 32 | 33 | var i = 0 34 | return Ask(for: key) { 35 | 36 | defer { 37 | i += 1 38 | } 39 | return handler($0, i) 40 | 41 | } 42 | 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /Sources/Wand/|tools/Expressible/ExpressibleByArray.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | //TODO: Fix and enable 20 | /// Init with Array 21 | //extension Core: ExpressibleByArrayLiteral { 22 | // 23 | // @inline(__always) 24 | // convenience 25 | // public 26 | // init(arrayLiteral array: Any...) { 27 | // 28 | // self.init() 29 | // put(sequence: array) 30 | // 31 | // } 32 | // 33 | // @inline(__always) 34 | // convenience 35 | // public 36 | // init(array: [Any]) { 37 | // 38 | // self.init() 39 | // put(sequence: array) 40 | // 41 | // } 42 | // 43 | //} 44 | -------------------------------------------------------------------------------- /Tests/WandTests/unit/Vector.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | import Any_ 20 | import Wand 21 | 22 | struct Vector: Equatable, Any_ { 23 | 24 | let x, y, z, t: UInt64 25 | 26 | public 27 | static 28 | var any: Self { 29 | .init(x: .any, y: .any, z: .any, t: .any(in: 0...5)) 30 | } 31 | 32 | } 33 | 34 | extension Vector: AskingNil, Wanded { 35 | 36 | public 37 | static 38 | func ask(with context: C, ask: Wand.Ask) -> Core { 39 | 40 | let wand = Core.to(context) 41 | _ = wand.append(ask: ask) 42 | return wand 43 | 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /Sources/Wand/|tools/Describing/Describing_Data.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | ///Data 20 | #if canImport(Foundation) 21 | import Foundation.NSData 22 | 23 | @inline(__always) 24 | postfix 25 | public 26 | func |(data: Data) -> String { 27 | (data | nil)! 28 | } 29 | 30 | @inline(__always) 31 | postfix 32 | public 33 | func |(data: Data) -> String? { 34 | data | nil 35 | } 36 | 37 | @inline(__always) 38 | public 39 | func |(data: Data, encoding: String.Encoding) -> String { 40 | (data | encoding)! 41 | } 42 | 43 | @inline(__always) 44 | public 45 | func |(data: Data, encoding: String.Encoding?) -> String? { 46 | String(data: data, encoding: encoding ?? .utf8) 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | # Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | /.build 55 | -------------------------------------------------------------------------------- /Sources/Wand/Ask/Addons/All.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | extension Ask { 20 | 21 | /// Ask for the completion 22 | /// 23 | /// wand | .all { 24 | /// 25 | /// } 26 | /// 27 | @inline(__always) 28 | public 29 | static 30 | func all(handler: @escaping (Core)->() ) -> Ask { 31 | .Option(once: true, for: .all) { 32 | handler($0) 33 | } 34 | } 35 | 36 | } 37 | 38 | /// Add completion to wand 39 | @discardableResult 40 | @inline(__always) 41 | public 42 | func |(wand: Core, ask: Ask) -> Core { 43 | wand.append(handler: ask) 44 | } 45 | 46 | extension Core.Key { 47 | 48 | public 49 | static 50 | let all = "All" 51 | 52 | } 53 | -------------------------------------------------------------------------------- /Sources/Wand/Ask/Addons/Any.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | extension Ask { 20 | 21 | /// Notify about <#Any#> object 22 | /// 23 | /// wand | .any { any in 24 | /// 25 | /// } 26 | /// 27 | @inline(__always) 28 | public 29 | static 30 | func any(handler: @escaping (Any)->() ) -> Ask { 31 | .Option(once: false) { 32 | handler($0) 33 | } 34 | } 35 | 36 | } 37 | 38 | /// Add any object handler 39 | @inline(__always) 40 | @discardableResult 41 | public 42 | func |(wand: Core, ask: Ask) -> Core { 43 | wand.append(handler: ask) 44 | } 45 | 46 | extension Core.Key { 47 | 48 | public 49 | static 50 | let any = "Any" 51 | 52 | } 53 | -------------------------------------------------------------------------------- /Sources/Wand/|tools/Memory.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | #if canImport(Foundation) 20 | import Foundation 21 | 22 | public 23 | struct Memory { 24 | 25 | @inlinable 26 | static 27 | public 28 | func address(for model: T) -> Int { 29 | Int(bitPattern: Unmanaged.passUnretained(model).toOpaque()) 30 | } 31 | 32 | @inlinable 33 | static 34 | public 35 | func address(for model: T) -> Int { 36 | 37 | var address: String? 38 | var mutable = model 39 | withUnsafePointer(to: &mutable) { pointer in 40 | address = String(format: "%p", pointer) 41 | } 42 | 43 | return Int(address!)! 44 | 45 | } 46 | 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /App/Play.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | import SwiftUI 20 | import Wand 21 | 22 | @available(iOS 14, macOS 12, tvOS 14, watchOS 7, *) 23 | @main 24 | struct PlayApp: App { 25 | 26 | var body: some Scene { 27 | WindowGroup { 28 | ContentView() 29 | } 30 | } 31 | 32 | } 33 | 34 | @available(iOS 14, macOS 12, tvOS 14, watchOS 7, *) 35 | struct ContentView: View { 36 | 37 | var body: some View { 38 | VStack { 39 | Image(systemName: "wand.and.stars") 40 | Text("Hello, Wand|") 41 | }.onAppear() { 42 | let wand: Wand.Core = "1" 43 | } 44 | } 45 | 46 | } 47 | 48 | @available(iOS 14, macOS 12, tvOS 14, watchOS 7, *) 49 | #Preview { 50 | ContentView() 51 | } 52 | -------------------------------------------------------------------------------- /Tests/WandTests/unit/T_Tests.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | //import Foundation 20 | // 21 | //import Wand 22 | //import XCTest 23 | // 24 | //class Expect_Any_Tests: XCTestCase { 25 | // 26 | // 27 | // func test_<#T#>_once() { 28 | // let e = expectation() 29 | // e.assertForOverFulfill = true 30 | // 31 | // |.one { (<#t#>: <#T#>) in 32 | // e.fulfill() 33 | // } 34 | // 35 | // waitForExpectations() 36 | // } 37 | // 38 | // func test_<#T#>_while() { 39 | // let e = expectation() 40 | // e.assertForOverFulfill = false 41 | // 42 | // |.while { (<#t#>: <#T#>) in 43 | // e.fulfill() 44 | // } 45 | // 46 | // waitForExpectations() 47 | // } 48 | // 49 | //} 50 | -------------------------------------------------------------------------------- /Sources/Wand/Ask/Addons/Addons.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | extension Core { 20 | 21 | @inlinable 22 | public 23 | func append(handler ask: Ask) -> Core { 24 | 25 | let key = ask.key 26 | 27 | let tail = wand.asking[key]?.last as? Ask 28 | ask.next = tail?.next ?? ask 29 | tail?.next = ask 30 | 31 | wand.asking[key] = (ask, nil) 32 | 33 | return wand 34 | 35 | } 36 | 37 | @inlinable 38 | public 39 | func handle(_ object: T, head: Ask?, tail: Ask) { 40 | 41 | var ask = head 42 | tail.next = nil 43 | 44 | while ask?.handler(object) != nil { 45 | ask = ask?.next 46 | } 47 | 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /docs/favicon.svg: -------------------------------------------------------------------------------- 1 | 10 | 11 | -------------------------------------------------------------------------------- /Sources/Wand/|tools/Expressible/ExpressibleByDictionary.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | /// Init with Dictionary 20 | extension Core: ExpressibleByDictionaryLiteral { 21 | 22 | @inline(__always) 23 | convenience 24 | public 25 | init(dictionaryLiteral elements: (String, Any)...) { 26 | 27 | self.init() 28 | 29 | elements.forEach { (key, object) in 30 | Core[object] = self 31 | context[key] = object 32 | } 33 | 34 | } 35 | 36 | @inline(__always) 37 | convenience 38 | public 39 | init(dictionary: [String: Any]) { 40 | 41 | self.init() 42 | 43 | dictionary.forEach { (key, object) in 44 | Core[object] = self 45 | context[key] = object 46 | } 47 | 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /Sources/Wand/|tools/Convertible/Numbers_Convertible.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | @inline(__always) 20 | postfix 21 | public 22 | func |(value: Bool) -> T { 23 | value ? 1 : 0 24 | } 25 | 26 | @inline(__always) 27 | postfix 28 | public 29 | func |(value: any BinaryFloatingPoint) -> Int { 30 | Int(value) 31 | } 32 | 33 | @inline(__always) 34 | postfix 35 | public 36 | func |(value: any BinaryInteger) -> Double { 37 | Double(value) 38 | } 39 | 40 | @inline(__always) 41 | postfix 42 | public 43 | func |(value: Double) -> Float { 44 | Float(value) 45 | } 46 | 47 | @inline(__always) 48 | postfix 49 | public 50 | func |(value: (any BinaryInteger)?) -> String? { 51 | guard let value else { 52 | return "" 53 | } 54 | 55 | return String(describing: value) 56 | } 57 | -------------------------------------------------------------------------------- /App/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleExecutable 6 | $(EXECUTABLE_NAME) 7 | CFBundleIdentifier 8 | $(PRODUCT_BUNDLE_IDENTIFIER) 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundleName 12 | $(PRODUCT_NAME) 13 | CFBundlePackageType 14 | APPL 15 | CFBundleShortVersionString 16 | 2.0.9 17 | CFBundleVersion 18 | 1730 19 | LSApplicationCategoryType 20 | public.app-category.developer-tools 21 | UILaunchStoryboardName 22 | 23 | UISupportedInterfaceOrientations~ipad 24 | 25 | UIInterfaceOrientationPortrait 26 | UIInterfaceOrientationPortraitUpsideDown 27 | UIInterfaceOrientationLandscapeLeft 28 | UIInterfaceOrientationLandscapeRight 29 | 30 | UISupportedInterfaceOrientations~iphone 31 | 32 | UIInterfaceOrientationPortrait 33 | UIInterfaceOrientationPortraitUpsideDown 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Tests/WandTests/cases/Errors_Tests.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | //import Wand 20 | //import XCTest 21 | // 22 | //class Errors_Tests: XCTestCase { 23 | // 24 | // func test_Error_Handling() throws { 25 | // 26 | // let e = expectation() 27 | // e.assertForOverFulfill = false 28 | // 29 | // weak 30 | // var wand: Core! 31 | // wand = Vector.one | String.one | .all { _ in 32 | // e.fulfill() 33 | // } 34 | // 35 | // DispatchQueue.main.asyncAfter(deadline: .now() + 1) { [weak wand] in 36 | // wand?.add(Vector.any) 37 | // } 38 | // 39 | // DispatchQueue.main.asyncAfter(deadline: .now() + 1) { [weak wand] in 40 | // wand?.add(String.any) 41 | // } 42 | // 43 | // waitForExpectations() 44 | // 45 | // } 46 | // 47 | //} 48 | -------------------------------------------------------------------------------- /Sources/Wand/Ask/Addons/Option.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | extension Ask { 20 | 21 | /// .Option Ask don't retain Wand.Core 22 | public 23 | class Option: Ask { 24 | 25 | @inline(__always) 26 | override 27 | public 28 | func set(wand: Core?) {} 29 | 30 | @inline(__always) 31 | override 32 | public 33 | func optional() -> Self { 34 | self 35 | } 36 | 37 | } 38 | 39 | @inline(__always) 40 | public 41 | func dependency(for key: String? = nil, on handler: ( (U)->() )? = nil ) -> Ask.Option { 42 | .init(once: self.once, for: key, handler: handler) 43 | } 44 | 45 | @inline(__always) 46 | public 47 | func depends(for key: String? = nil, while handler: @escaping (U)->(Bool) ) -> Ask.Option { 48 | .init(for: key, handler: handler) 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /Sources/Wand/Ask/Addons/Error?.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | /// Handle Error and Success 20 | /// 21 | /// wand | { (error: Error?) in 22 | /// 23 | /// } 24 | /// 25 | @discardableResult 26 | @inline(__always) 27 | public 28 | func |(wand: Core, handler: @escaping (Error?)->() ) -> Core { 29 | wand | Ask.every(handler: handler) 30 | } 31 | 32 | /// Handle Error and Success 33 | /// 34 | /// wand | .one { (error: Error?) in 35 | /// 36 | /// } 37 | /// 38 | @discardableResult 39 | @inline(__always) 40 | public 41 | func |(wand: Core, ask: Ask) -> Core { 42 | 43 | //Handle Succeed completion 44 | let all = Ask.all { _ in 45 | _ = ask.handler(nil) 46 | } 47 | 48 | //Handle Error completion 49 | let error = Ask.Option(once: ask.once) { 50 | all.cancel() 51 | return ask.handler($0) 52 | } 53 | 54 | //Handle Error completion 55 | return wand | all | error 56 | 57 | } 58 | -------------------------------------------------------------------------------- /App/WatchInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | ru 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 2.0 19 | CFBundleVersion 20 | 1730 21 | LSApplicationCategoryType 22 | public.app-category.developer-tools 23 | UISupportedInterfaceOrientations~ipad 24 | 25 | UIInterfaceOrientationPortrait 26 | UIInterfaceOrientationPortraitUpsideDown 27 | UIInterfaceOrientationLandscapeLeft 28 | UIInterfaceOrientationLandscapeRight 29 | 30 | UISupportedInterfaceOrientations~iphone 31 | 32 | UIInterfaceOrientationPortrait 33 | UIInterfaceOrientationPortraitUpsideDown 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | WKApplication 38 | 39 | WKCompanionAppBundleIdentifier 40 | el-machine.Play 41 | 42 | 43 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version: 5.6 2 | /// 3 | /// Copyright 2020 Alexander Kozin 4 | /// 5 | /// Licensed under the Apache License, Version 2.0 (the "License"); 6 | /// you may not use this file except in compliance with the License. 7 | /// You may obtain a copy of the License at 8 | /// 9 | /// http://www.apache.org/licenses/LICENSE-2.0 10 | /// 11 | /// Unless required by applicable law or agreed to in writing, software 12 | /// distributed under the License is distributed on an "AS IS" BASIS, 13 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | /// See the License for the specific language governing permissions and 15 | /// limitations under the License. 16 | /// 17 | /// Created by Alex Kozin 18 | /// El Machine 🤖 19 | 20 | import PackageDescription 21 | 22 | let package = Package( 23 | name: "Wand", 24 | 25 | platforms: [ 26 | .iOS(.v14), 27 | .macOS(.v12), 28 | .tvOS(.v14), 29 | .watchOS(.v7), 30 | ], 31 | 32 | products: [ 33 | .library(name: "Wand", targets: ["Wand"]) 34 | ], 35 | 36 | dependencies: [ 37 | .package(url: "https://github.com/The-Wand/Any.git", .upToNextMajor(from: "1.0.2") ), 38 | .package(url: "https://github.com/swiftlang/swift-docc-plugin", .upToNextMajor(from: "1.1.0") ), 39 | ], 40 | targets: [ 41 | .target(name: "Wand"), 42 | .testTarget(name: "WandTests", dependencies: 43 | [ 44 | "Wand", 45 | .product(name: "Any_", package: "Any") 46 | ] 47 | ) 48 | ] 49 | ) 50 | -------------------------------------------------------------------------------- /Tests/WandTests/cases/Describing_Tests.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | import Foundation 20 | 21 | import Wand 22 | import XCTest 23 | 24 | class Describing_Tests: XCTestCase { 25 | 26 | func test_wand() throws { 27 | 28 | let char: Character = 0x7C| 29 | XCTAssertEqual("|", char) 30 | 31 | } 32 | 33 | func test_Any() throws { 34 | 35 | let char: Character = 0x5F| 36 | XCTAssertEqual("_", char) 37 | 38 | } 39 | 40 | func test_Data_to_String() throws { 41 | 42 | let sample = Data([72, 101, 108, 108, 111, 44, 32, 119, 97, 110, 100, 33]) 43 | let string: String = sample| 44 | 45 | XCTAssertEqual("Hello, wand!", string) 46 | 47 | } 48 | 49 | func test_String_to_Data() throws { 50 | 51 | let sample = Data([72, 101, 108, 108, 111, 44, 32, 119, 97, 110, 100, 33]) 52 | let data: Data? = "Hello, wand!"| 53 | 54 | XCTAssertEqual(data!, sample) 55 | 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /Tests/WandTests/cases/Init Tests/Core_Init_Array_Tests.swift: -------------------------------------------------------------------------------- 1 | ///// 2 | ///// Copyright 2020 Alexander Kozin 3 | ///// 4 | ///// Licensed under the Apache License, Version 2.0 (the "License"); 5 | ///// you may not use this file except in compliance with the License. 6 | ///// You may obtain a copy of the License at 7 | ///// 8 | ///// http://www.apache.org/licenses/LICENSE-2.0 9 | ///// 10 | ///// Unless required by applicable law or agreed to in writing, software 11 | ///// distributed under the License is distributed on an "AS IS" BASIS, 12 | ///// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ///// See the License for the specific language governing permissions and 14 | ///// limitations under the License. 15 | ///// 16 | ///// Created by Alex Kozin 17 | ///// El Machine 🤖 18 | // 19 | //import CoreLocation.CLLocation 20 | // 21 | //import Wand 22 | //import XCTest 23 | // 24 | //class Core_Init_Array_Tests: XCTestCase { 25 | // 26 | // weak 27 | // var wand: Core? 28 | // 29 | // //TODO: Fix and enable 30 | // func test_init_Array() throws { 31 | // 32 | // let bool = true 33 | // let int = 4 34 | // let location = CLLocation.any 35 | // let date = Date.any 36 | // 37 | // let array: [Any] = [bool, int, location, date] 38 | // 39 | // let wand = Core(array: array) 40 | // 41 | // print(wand) 42 | // } 43 | // 44 | // func test_init_ArrayLiteral() throws { 45 | // 46 | // let bool = true 47 | // let int = 4 48 | // let location = CLLocation.any 49 | // let date = Date.any 50 | // 51 | // let wand: Core = [bool, int, location, date] 52 | // print(wand) 53 | // } 54 | // 55 | //} 56 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /Sources/Wand/|tools/Log.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | 20 | public 21 | enum Log: Int { 22 | 23 | case none 24 | case verbose 25 | case warning 26 | case info 27 | 28 | public 29 | static 30 | var level = Log.default 31 | 32 | public 33 | static 34 | let `default` = Log.none 35 | 36 | @inlinable 37 | public 38 | func callAsFunction(_ message: String) { 39 | #if DEBUG 40 | let level = Log.level 41 | if level > .none && .verbose...level ~= self { 42 | Swift.print(message) 43 | } 44 | #endif 45 | } 46 | 47 | } 48 | 49 | #if DEBUG 50 | extension Log: Comparable { 51 | 52 | @inlinable 53 | public 54 | static 55 | func < (lhs: Log, rhs: Log) -> Bool { 56 | lhs.rawValue < rhs.rawValue 57 | } 58 | 59 | } 60 | #endif 61 | 62 | @available(*, deprecated, renamed: "Log.verbose(message:)") 63 | @inline(__always) 64 | public 65 | func log(_ message: String) { 66 | 67 | #if DEBUG 68 | Log.verbose(message) 69 | #endif 70 | 71 | } 72 | -------------------------------------------------------------------------------- /Sources/Wand/Wanded/Wanded.swift: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright 2020 Alexander Kozin 3 | /// 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); 5 | /// you may not use this file except in compliance with the License. 6 | /// You may obtain a copy of the License at 7 | /// 8 | /// http://www.apache.org/licenses/LICENSE-2.0 9 | /// 10 | /// Unless required by applicable law or agreed to in writing, software 11 | /// distributed under the License is distributed on an "AS IS" BASIS, 12 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | /// See the License for the specific language governing permissions and 14 | /// limitations under the License. 15 | /// 16 | /// Created by Alex Kozin 17 | /// El Machine 🤖 18 | 19 | /// Object that supports Wand 20 | public 21 | protocol Wanded { 22 | 23 | var wand: Core {get} 24 | var isWanded: Core? {get} 25 | 26 | } 27 | 28 | extension Wanded { 29 | 30 | @inline(__always) 31 | public 32 | var wand: Core { 33 | isWanded ?? Core(self) 34 | } 35 | 36 | @inline(__always) 37 | public 38 | var isWanded: Core? { 39 | Core[self] 40 | } 41 | 42 | } 43 | 44 | /// Any? 45 | /// All Optional object supports Wand 46 | extension Optional { 47 | 48 | @inline(__always) 49 | public 50 | var wand: Core { 51 | isWanded ?? .to(self) 52 | } 53 | 54 | @inline(__always) 55 | public 56 | var isWanded: Core? { 57 | Core[self] 58 | } 59 | 60 | } 61 | 62 | /// Close Wand 63 | @discardableResult 64 | @inline(__always) 65 | postfix 66 | public 67 | func |(wanded: Wanded?) -> Core? { 68 | 69 | let wand = wanded?.isWanded 70 | wand?.close() 71 | return wand 72 | 73 | } 74 | -------------------------------------------------------------------------------- /docs/documentation/wand/ask/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/ask/key/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/ask/next/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/ask/once/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/asking/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/core/all/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/core/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/core/key/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/log(_:)/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/memory/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/swift/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/wanded/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-13r4h/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-18ln3/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-1bavu/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-1mfbc/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-1tvgk/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-1u2bc/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-1v5ni/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-202y7/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-2go0i/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-2hxn9/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-3s8xb/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-3sck7/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-40hxn/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-4dw2e/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-4i3dl/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-4q8rw/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-4zli6/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-51y1n/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-569lk/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-5ldz/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-64bw1/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-67rzz/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-6zb77/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-813vv/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-8zdky/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-97g91/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:)-xo1o/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:_:)-18wl5/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:_:)-1cpd8/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:_:)-1dib3/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:_:)-328ac/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:_:)-32g29/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:_:)-3t0uk/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:_:)-4lknp/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:_:)-4tlmq/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:_:)-5o35u/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:_:)-5ox9r/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:_:)-72ind/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:_:)-7kg27/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/_(_:_:)-7xwgb/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/ask/cancel()/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/ask/handler/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/ask/head(_:)/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/ask/option/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/asking/every/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/asking/one/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/askingnil/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/core/asking/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/core/close()/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/core/context/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/core/error/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/core/init(_:)/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/core/iswanded/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/core/to(_:)/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/core/wand/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/core/weak/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/obtainable/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/swift/string/index.html: -------------------------------------------------------------------------------- 1 | Documentation
-------------------------------------------------------------------------------- /docs/documentation/wand/ubiquitous/index.html: -------------------------------------------------------------------------------- 1 | Documentation
--------------------------------------------------------------------------------