I get the error when trying to push to github:
remote: Gist does not support directories.
remote: These are the directories that are causing problems:
remote: dirname1, dirname2
Run Code Online (Sandbox Code Playgroud)
Looking at other questions, it seems that github doesn't accept empty folders but none of these folders are empty. I can successfully push other files that are inside the root folder of the repository, and can also successfully deploy the app to heroku using git.
How do I add a directory to …
我对 Typescript 中的“交叉类型”这个名称有点困惑。
在集合论中,交集意味着只有两种类型共有的属性在两者的交集中才可用。
事实上,如果我在基元之间创建交集,这就是 Typescript 的行为方式。
type A = string | number
type B = number | boolean
type C = A & B
type D = string
type E = number
type F = D & B
Run Code Online (Sandbox Code Playgroud)
在这种情况下,TS 推断C为number和。Fnever
然而,当涉及到对象时,创建交集会创建一个新的类型/接口,它结合了所使用类型的属性 -
从文档中
TypeScript 提供了另一种称为交集类型的构造,主要用于组合现有的对象类型
当您以这种方式看待时,对象的行为就非常有意义了。而且使用&也有意义。
所以,我的问题是:
也许它与联合类型的解释有某种关系?