init
This commit is contained in:
21
mc_test/node_modules/@emotion/weak-memoize/LICENSE
generated
vendored
Executable file
21
mc_test/node_modules/@emotion/weak-memoize/LICENSE
generated
vendored
Executable 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
mc_test/node_modules/@emotion/weak-memoize/README.md
generated
vendored
Executable file
35
mc_test/node_modules/@emotion/weak-memoize/README.md
generated
vendored
Executable 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
|
||||
```
|
||||
2
mc_test/node_modules/@emotion/weak-memoize/dist/declarations/src/index.d.ts
generated
vendored
Executable file
2
mc_test/node_modules/@emotion/weak-memoize/dist/declarations/src/index.d.ts
generated
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
export * from '../types'
|
||||
export { default } from '../types'
|
||||
7
mc_test/node_modules/@emotion/weak-memoize/dist/declarations/types/index.d.ts
generated
vendored
Executable file
7
mc_test/node_modules/@emotion/weak-memoize/dist/declarations/types/index.d.ts
generated
vendored
Executable file
@ -0,0 +1,7 @@
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
type UnaryFn<Arg, Return> = (arg: Arg) => Return
|
||||
|
||||
export default function weakMemoize<Arg extends object, Return>(
|
||||
func: UnaryFn<Arg, Return>
|
||||
): UnaryFn<Arg, Return>
|
||||
3
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.d.mts
generated
vendored
Executable file
3
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.d.mts
generated
vendored
Executable file
@ -0,0 +1,3 @@
|
||||
export * from "./declarations/src/index.js";
|
||||
export { _default as default } from "./emotion-weak-memoize.cjs.default.js";
|
||||
//# sourceMappingURL=emotion-weak-memoize.cjs.d.mts.map
|
||||
1
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.d.mts.map
generated
vendored
Executable file
1
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.d.mts.map
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"emotion-weak-memoize.cjs.d.mts","sourceRoot":"","sources":["./declarations/src/index.d.ts"],"names":[],"mappings":"AAAA"}
|
||||
3
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.d.ts
generated
vendored
Executable file
3
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.d.ts
generated
vendored
Executable file
@ -0,0 +1,3 @@
|
||||
export * from "./declarations/src/index";
|
||||
export { default } from "./declarations/src/index";
|
||||
//# sourceMappingURL=emotion-weak-memoize.cjs.d.ts.map
|
||||
1
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.d.ts.map
generated
vendored
Executable file
1
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.d.ts.map
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"emotion-weak-memoize.cjs.d.ts","sourceRoot":"","sources":["./declarations/src/index.d.ts"],"names":[],"mappings":"AAAA"}
|
||||
1
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.default.d.ts
generated
vendored
Executable file
1
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.default.d.ts
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
export { default as _default } from "./declarations/src/index.js"
|
||||
1
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.default.js
generated
vendored
Executable file
1
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.default.js
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
exports._default = require("./emotion-weak-memoize.cjs.js").default;
|
||||
20
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.dev.js
generated
vendored
Executable file
20
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.dev.js
generated
vendored
Executable 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;
|
||||
7
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.js
generated
vendored
Executable file
7
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.js
generated
vendored
Executable file
@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
if (process.env.NODE_ENV === "production") {
|
||||
module.exports = require("./emotion-weak-memoize.cjs.prod.js");
|
||||
} else {
|
||||
module.exports = require("./emotion-weak-memoize.cjs.dev.js");
|
||||
}
|
||||
3
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.js.flow
generated
vendored
Executable file
3
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.js.flow
generated
vendored
Executable file
@ -0,0 +1,3 @@
|
||||
// @flow
|
||||
export * from "../src/index.js";
|
||||
export { default } from "../src/index.js";
|
||||
4
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.mjs
generated
vendored
Executable file
4
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.mjs
generated
vendored
Executable file
@ -0,0 +1,4 @@
|
||||
export {
|
||||
|
||||
} from "./emotion-weak-memoize.cjs.js";
|
||||
export { _default as default } from "./emotion-weak-memoize.cjs.default.js";
|
||||
20
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.prod.js
generated
vendored
Executable file
20
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.cjs.prod.js
generated
vendored
Executable 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;
|
||||
16
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js
generated
vendored
Executable file
16
mc_test/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js
generated
vendored
Executable 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 { weakMemoize as default };
|
||||
33
mc_test/node_modules/@emotion/weak-memoize/package.json
generated
vendored
Executable file
33
mc_test/node_modules/@emotion/weak-memoize/package.json
generated
vendored
Executable file
@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "@emotion/weak-memoize",
|
||||
"version": "0.3.1",
|
||||
"description": "A memoization function that uses a WeakMap",
|
||||
"main": "dist/emotion-weak-memoize.cjs.js",
|
||||
"module": "dist/emotion-weak-memoize.esm.js",
|
||||
"types": "types/index.d.ts",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/emotion-js/emotion/tree/main/packages/weak-memoize",
|
||||
"scripts": {
|
||||
"test:typescript": "dtslint types"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@definitelytyped/dtslint": "0.0.112",
|
||||
"typescript": "^4.5.5"
|
||||
},
|
||||
"files": [
|
||||
"src",
|
||||
"dist",
|
||||
"types/*.d.ts"
|
||||
],
|
||||
"exports": {
|
||||
".": {
|
||||
"module": "./dist/emotion-weak-memoize.esm.js",
|
||||
"import": "./dist/emotion-weak-memoize.cjs.mjs",
|
||||
"default": "./dist/emotion-weak-memoize.cjs.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
}
|
||||
}
|
||||
2
mc_test/node_modules/@emotion/weak-memoize/src/index.d.ts
generated
vendored
Executable file
2
mc_test/node_modules/@emotion/weak-memoize/src/index.d.ts
generated
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
export * from '../types'
|
||||
export { default } from '../types'
|
||||
16
mc_test/node_modules/@emotion/weak-memoize/src/index.js
generated
vendored
Executable file
16
mc_test/node_modules/@emotion/weak-memoize/src/index.js
generated
vendored
Executable 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
|
||||
7
mc_test/node_modules/@emotion/weak-memoize/types/index.d.ts
generated
vendored
Executable file
7
mc_test/node_modules/@emotion/weak-memoize/types/index.d.ts
generated
vendored
Executable file
@ -0,0 +1,7 @@
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
type UnaryFn<Arg, Return> = (arg: Arg) => Return
|
||||
|
||||
export default function weakMemoize<Arg extends object, Return>(
|
||||
func: UnaryFn<Arg, Return>
|
||||
): UnaryFn<Arg, Return>
|
||||
Reference in New Issue
Block a user