0.2.0 - Mid migration

This commit is contained in:
Daniel Mason 2022-04-25 14:47:15 +12:00
parent 139e6a915e
commit 7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions

19
web/node_modules/@emotion/weak-memoize/CHANGELOG.md generated vendored Normal file
View file

@ -0,0 +1,19 @@
# @emotion/weak-memoize
## 0.2.5
### Patch Changes
- [`4c62ae9`](https://github.com/emotion-js/emotion/commit/4c62ae9447959d438928e1a26f76f1487983c968) [#1698](https://github.com/emotion-js/emotion/pull/1698) Thanks [@Andarist](https://github.com/Andarist)! - Add LICENSE file
## 0.2.4
### Patch Changes
- [c81c0033](https://github.com/emotion-js/emotion/commit/c81c0033c490210077da0e9c3f9fa1a22fcd9c96) [#1503](https://github.com/emotion-js/emotion/pull/1503) Thanks [@Andarist](https://github.com/Andarist)! - Add TS types to util packages - hash, memoize & weak-memoize
## 0.2.3
### Patch Changes
- [c0eb604d](https://github.com/emotion-js/emotion/commit/c0eb604d) [#1419](https://github.com/emotion-js/emotion/pull/1419) Thanks [@mitchellhamilton](https://github.com/mitchellhamilton)! - Update build tool

21
web/node_modules/@emotion/weak-memoize/LICENSE generated vendored Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) Emotion team and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

35
web/node_modules/@emotion/weak-memoize/README.md generated vendored Normal file
View file

@ -0,0 +1,35 @@
# @emotion/weak-memoize
> A memoization function that uses a WeakMap
## Install
```bash
yarn add @emotion/weak-memoize
```
## Usage
Because @emotion/weak-memoize uses a WeakMap the argument must be a non primitive type, e.g. objects, functions, arrays and etc. The function passed to `weakMemoize` must also only accept a single argument.
```jsx
import weakMemoize from '@emotion/weak-memoize'
let doThing = weakMemoize(({ someProperty }) => {
return { newName: someProperty }
})
let obj = { someProperty: true }
let firstResult = doThing(obj)
let secondResult = doThing(obj)
firstResult === secondResult // true
let newObj = { someProperty: true }
let thirdResult = doThing(newObj)
thirdResult === firstResult // false
```

View file

@ -0,0 +1,20 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var weakMemoize = function weakMemoize(func) {
// $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
var cache = new WeakMap();
return function (arg) {
if (cache.has(arg)) {
// $FlowFixMe
return cache.get(arg);
}
var ret = func(arg);
cache.set(arg, ret);
return ret;
};
};
exports.default = weakMemoize;

View file

@ -0,0 +1,16 @@
var weakMemoize = function weakMemoize(func) {
// $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
var cache = new WeakMap();
return function (arg) {
if (cache.has(arg)) {
// $FlowFixMe
return cache.get(arg);
}
var ret = func(arg);
cache.set(arg, ret);
return ret;
};
};
export default weakMemoize;

View file

@ -0,0 +1,20 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var weakMemoize = function weakMemoize(func) {
// $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
var cache = new WeakMap();
return function (arg) {
if (cache.has(arg)) {
// $FlowFixMe
return cache.get(arg);
}
var ret = func(arg);
cache.set(arg, ret);
return ret;
};
};
exports.default = weakMemoize;

View file

@ -0,0 +1,7 @@
'use strict';
if (process.env.NODE_ENV === "production") {
module.exports = require("./weak-memoize.cjs.prod.js");
} else {
module.exports = require("./weak-memoize.cjs.dev.js");
}

View file

@ -0,0 +1,3 @@
// @flow
export * from "../src/index.js";
export { default } from "../src/index.js";

View file

@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: !0
});
var weakMemoize = function(func) {
var cache = new WeakMap();
return function(arg) {
if (cache.has(arg)) return cache.get(arg);
var ret = func(arg);
return cache.set(arg, ret), ret;
};
};
exports.default = weakMemoize;

View file

@ -0,0 +1,16 @@
var weakMemoize = function weakMemoize(func) {
// $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
var cache = new WeakMap();
return function (arg) {
if (cache.has(arg)) {
// $FlowFixMe
return cache.get(arg);
}
var ret = func(arg);
cache.set(arg, ret);
return ret;
};
};
export default weakMemoize;

28
web/node_modules/@emotion/weak-memoize/package.json generated vendored Normal file
View file

@ -0,0 +1,28 @@
{
"name": "@emotion/weak-memoize",
"version": "0.2.5",
"description": "A memoization function that uses a WeakMap",
"main": "dist/weak-memoize.cjs.js",
"module": "dist/weak-memoize.esm.js",
"types": "types/index.d.ts",
"license": "MIT",
"repository": "https://github.com/emotion-js/emotion/tree/master/packages/weak-memoize",
"scripts": {
"test:typescript": "dtslint types"
},
"publishConfig": {
"access": "public"
},
"devDependencies": {
"dtslint": "^0.3.0"
},
"files": [
"src",
"dist",
"types"
],
"browser": {
"./dist/weak-memoize.cjs.js": "./dist/weak-memoize.browser.cjs.js",
"./dist/weak-memoize.esm.js": "./dist/weak-memoize.browser.esm.js"
}
}

16
web/node_modules/@emotion/weak-memoize/src/index.js generated vendored Normal file
View file

@ -0,0 +1,16 @@
// @flow
let weakMemoize = function<Arg, Return>(func: Arg => Return): Arg => Return {
// $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
let cache: WeakMap<Arg, Return> = new WeakMap()
return arg => {
if (cache.has(arg)) {
// $FlowFixMe
return cache.get(arg)
}
let ret = func(arg)
cache.set(arg, ret)
return ret
}
}
export default weakMemoize

View file

@ -0,0 +1,5 @@
type UnaryFn<Arg, Return> = (arg: Arg) => Return
export default function weakMemoize<Arg extends object, Return>(
func: UnaryFn<Arg, Return>
): UnaryFn<Arg, Return>

36
web/node_modules/@emotion/weak-memoize/types/tests.ts generated vendored Normal file
View file

@ -0,0 +1,36 @@
import weakMemoize from '@emotion/weak-memoize'
type Foo = { bar: 'xyz' }
declare class Qwe {
answer: number
}
// $ExpectType Array<Foo>
weakMemoize((arg: Foo) => [arg])({ bar: 'xyz' })
// $ExpectType string[]
weakMemoize((arg: string) => [arg])('foo')
// $ExpectError
weakMemoize((arg: Foo) => [arg])(42)
// $ExpectError
weakMemoize((arg: string) => [arg])
// $ExpectError
weakMemoize((arg: number) => [arg])
// $ExpectError
weakMemoize((arg: boolean) => [arg])
// $ExpectError
weakMemoize((arg: symbol) => [arg])
// $ExpectError
weakMemoize((arg: void) => [arg])
// $ExpectError
weakMemoize((arg: null) => [arg])
// $ExpectError
weakMemoize((arg: undefined) => [arg])
weakMemoize((arg: () => void) => [arg])
weakMemoize((arg: Map<any, any>) => [arg])
weakMemoize((arg: Set<any>) => [arg])
weakMemoize((arg: Qwe) => [arg])

View file

@ -0,0 +1,26 @@
{
"compilerOptions": {
"baseUrl": "../",
"forceConsistentCasingInFileNames": true,
"lib": [
"es6",
"dom"
],
"module": "commonjs",
"noEmit": true,
"noImplicitAny": true,
"noImplicitThis": true,
"strict": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"target": "es5",
"typeRoots": [
"../"
],
"types": []
},
"include": [
"./*.ts",
"./*.tsx"
]
}

View file

@ -0,0 +1,25 @@
{
"extends": "dtslint/dtslint.json",
"rules": {
"array-type": [
true,
"generic"
],
"import-spacing": false,
"semicolon": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-module",
"check-rest-spread",
"check-type",
"check-typecast",
"check-type-operator",
"check-preblock"
],
"no-unnecessary-generics": false
}
}