@fluidframework/core-utils 2.0.0-dev.3.1.0.125672 → 2.0.0-dev.4.1.0.148229
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/compare.d.ts +2 -0
- package/dist/compare.d.ts.map +1 -1
- package/dist/compare.js +2 -0
- package/dist/compare.js.map +1 -1
- package/lib/compare.d.ts +2 -0
- package/lib/compare.d.ts.map +1 -1
- package/lib/compare.js +2 -0
- package/lib/compare.js.map +1 -1
- package/package.json +49 -45
- package/src/compare.ts +2 -0
package/README.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# @fluidframework/core-utils
|
|
2
2
|
|
|
3
|
-
Fluid agnostic utility functions
|
|
3
|
+
Intended for internally sharing/promoting best-practice implementations of Fluid agnostic utility functions across packages in the client repo.
|
|
4
|
+
|
|
5
|
+
Use outside of the Fluid Framework client repo is not supported or recommended.
|
|
6
|
+
|
|
7
|
+
All exports must be designated @internal. This package must not depend on other packages.
|
|
4
8
|
|
|
5
9
|
## Trademark
|
|
6
10
|
|
package/dist/compare.d.ts
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* Compare two arrays. Returns true if their elements are equivalent and in the same order.
|
|
7
7
|
*
|
|
8
|
+
* @internal
|
|
9
|
+
*
|
|
8
10
|
* @param left - The first array to compare
|
|
9
11
|
* @param right - The second array to compare
|
|
10
12
|
* @param comparator - The function used to check if two `T`s are equivalent.
|
package/dist/compare.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compare.d.ts","sourceRoot":"","sources":["../src/compare.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"compare.d.ts","sourceRoot":"","sources":["../src/compare.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,+FAGsB,MAAM,KAAK,OAAO,KAI/D,OAUF,CAAC"}
|
package/dist/compare.js
CHANGED
|
@@ -8,6 +8,8 @@ exports.compareArrays = void 0;
|
|
|
8
8
|
/**
|
|
9
9
|
* Compare two arrays. Returns true if their elements are equivalent and in the same order.
|
|
10
10
|
*
|
|
11
|
+
* @internal
|
|
12
|
+
*
|
|
11
13
|
* @param left - The first array to compare
|
|
12
14
|
* @param right - The second array to compare
|
|
13
15
|
* @param comparator - The function used to check if two `T`s are equivalent.
|
package/dist/compare.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compare.js","sourceRoot":"","sources":["../src/compare.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH
|
|
1
|
+
{"version":3,"file":"compare.js","sourceRoot":"","sources":["../src/compare.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;;;;;;GASG;AACI,MAAM,aAAa,GAAG,CAC5B,IAAkB,EAClB,KAAmB,EACnB,aAAoE,CACnE,QAAW,EACX,SAAY,EACX,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,EACzB,EAAE;IACZ,6CAA6C;IAC7C,sCAAsC;IACtC,wDAAwD;IACxD,sEAAsE;IACtE,OAAO,CACN,IAAI,KAAK,KAAK,IAAI,+DAA+D;QACjF,CAAC,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,IAAI,8DAA8D;YAC9F,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAC5E,CAAC;AACH,CAAC,CAAC;AAjBW,QAAA,aAAa,iBAiBxB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Compare two arrays. Returns true if their elements are equivalent and in the same order.\n *\n * @internal\n *\n * @param left - The first array to compare\n * @param right - The second array to compare\n * @param comparator - The function used to check if two `T`s are equivalent.\n * Defaults to `Object.is()` equality (a shallow compare where NaN = NaN and -0 ≠ 0)\n */\nexport const compareArrays = <T>(\n\tleft: readonly T[],\n\tright: readonly T[],\n\tcomparator: (leftItem: T, rightItem: T, index: number) => boolean = (\n\t\tleftItem: T,\n\t\trightItem: T,\n\t) => Object.is(leftItem, rightItem),\n): boolean => {\n\t// PERF: 'for-loop' and 'Array.every()' tied.\n\t// '===' and 'Object.is()' tied.\n\t// Trivial acceptance adds no measurable overhead.\n\t// 30% penalty vs. baseline for exported function [node 14 x64].\n\treturn (\n\t\tleft === right || // Trivial acceptance: 'left' and 'right' are the same instance\n\t\t(left.length === right.length && // Trivial rejection: 'left' and 'right' are different lengths\n\t\t\tleft.every((leftItem, index) => comparator(leftItem, right[index], index)))\n\t);\n};\n"]}
|
package/lib/compare.d.ts
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* Compare two arrays. Returns true if their elements are equivalent and in the same order.
|
|
7
7
|
*
|
|
8
|
+
* @internal
|
|
9
|
+
*
|
|
8
10
|
* @param left - The first array to compare
|
|
9
11
|
* @param right - The second array to compare
|
|
10
12
|
* @param comparator - The function used to check if two `T`s are equivalent.
|
package/lib/compare.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compare.d.ts","sourceRoot":"","sources":["../src/compare.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"compare.d.ts","sourceRoot":"","sources":["../src/compare.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,+FAGsB,MAAM,KAAK,OAAO,KAI/D,OAUF,CAAC"}
|
package/lib/compare.js
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* Compare two arrays. Returns true if their elements are equivalent and in the same order.
|
|
7
7
|
*
|
|
8
|
+
* @internal
|
|
9
|
+
*
|
|
8
10
|
* @param left - The first array to compare
|
|
9
11
|
* @param right - The second array to compare
|
|
10
12
|
* @param comparator - The function used to check if two `T`s are equivalent.
|
package/lib/compare.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compare.js","sourceRoot":"","sources":["../src/compare.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"compare.js","sourceRoot":"","sources":["../src/compare.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAC5B,IAAkB,EAClB,KAAmB,EACnB,aAAoE,CACnE,QAAW,EACX,SAAY,EACX,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,EACzB,EAAE;IACZ,6CAA6C;IAC7C,sCAAsC;IACtC,wDAAwD;IACxD,sEAAsE;IACtE,OAAO,CACN,IAAI,KAAK,KAAK,IAAI,+DAA+D;QACjF,CAAC,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,IAAI,8DAA8D;YAC9F,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAC5E,CAAC;AACH,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Compare two arrays. Returns true if their elements are equivalent and in the same order.\n *\n * @internal\n *\n * @param left - The first array to compare\n * @param right - The second array to compare\n * @param comparator - The function used to check if two `T`s are equivalent.\n * Defaults to `Object.is()` equality (a shallow compare where NaN = NaN and -0 ≠ 0)\n */\nexport const compareArrays = <T>(\n\tleft: readonly T[],\n\tright: readonly T[],\n\tcomparator: (leftItem: T, rightItem: T, index: number) => boolean = (\n\t\tleftItem: T,\n\t\trightItem: T,\n\t) => Object.is(leftItem, rightItem),\n): boolean => {\n\t// PERF: 'for-loop' and 'Array.every()' tied.\n\t// '===' and 'Object.is()' tied.\n\t// Trivial acceptance adds no measurable overhead.\n\t// 30% penalty vs. baseline for exported function [node 14 x64].\n\treturn (\n\t\tleft === right || // Trivial acceptance: 'left' and 'right' are the same instance\n\t\t(left.length === right.length && // Trivial rejection: 'left' and 'right' are different lengths\n\t\t\tleft.every((leftItem, index) => comparator(leftItem, right[index], index)))\n\t);\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/core-utils",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.0.0-dev.4.1.0.148229",
|
|
4
|
+
"description": "Not intended for use outside the Fluid client repo.",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -14,35 +14,6 @@
|
|
|
14
14
|
"main": "dist/index.js",
|
|
15
15
|
"module": "lib/index.js",
|
|
16
16
|
"types": "dist/index.d.ts",
|
|
17
|
-
"scripts": {
|
|
18
|
-
"bench": "mocha --timeout 999999 --perfMode --parentProcess --fgrep @Benchmark --reporter \"../../../node_modules/@fluid-tools/benchmark/dist/MochaReporter.js\"",
|
|
19
|
-
"bench:profile": "mocha --v8-prof --timeout 999999 --perfMode --fgrep @Benchmark --reporter \"../../../node_modules/@fluid-tools/benchmark/dist/MochaReporter.js\" && node --prof-process isolate-0x*-v8.log > profile.txt && rm isolate-0x*-v8.log && cat profile.txt",
|
|
20
|
-
"build": "concurrently npm:build:compile npm:lint && npm run build:docs",
|
|
21
|
-
"build:commonjs": "npm run tsc && npm run typetests:gen && npm run build:test",
|
|
22
|
-
"build:compile": "concurrently npm:build:commonjs npm:build:esnext",
|
|
23
|
-
"build:docs": "api-extractor run --local --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../_api-extractor-temp/",
|
|
24
|
-
"build:esnext": "tsc --project ./tsconfig.esnext.json",
|
|
25
|
-
"build:full": "npm run build",
|
|
26
|
-
"build:full:compile": "npm run build:compile",
|
|
27
|
-
"build:test": "tsc --project ./src/test/tsconfig.json",
|
|
28
|
-
"ci:build:docs": "api-extractor run --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/* ../../../_api-extractor-temp/",
|
|
29
|
-
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
|
|
30
|
-
"eslint": "eslint --format stylish src",
|
|
31
|
-
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
32
|
-
"format": "npm run prettier:fix",
|
|
33
|
-
"lint": "npm run prettier && npm run eslint",
|
|
34
|
-
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
|
|
35
|
-
"prettier": "prettier --check . --ignore-path ../../../.prettierignore",
|
|
36
|
-
"prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
|
|
37
|
-
"test": "npm run test:mocha",
|
|
38
|
-
"test:benchmark:report": "mocha --node-option unhandled-rejections=strict,expose-gc --exit --perfMode --fgrep @Benchmark --reporter @fluid-tools/benchmark/dist/MochaReporter.js --timeout 60000",
|
|
39
|
-
"test:coverage": "nyc npm test -- --reporter xunit --reporter-option output=nyc/junit-report.xml",
|
|
40
|
-
"test:mocha": "mocha",
|
|
41
|
-
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
|
|
42
|
-
"tsc": "tsc",
|
|
43
|
-
"typetests:gen": "flub generate typetests --generate --dir .",
|
|
44
|
-
"typetests:prepare": "flub generate typetests --prepare --dir . --pin"
|
|
45
|
-
},
|
|
46
17
|
"nyc": {
|
|
47
18
|
"all": true,
|
|
48
19
|
"cache-dir": "nyc/.cache",
|
|
@@ -64,29 +35,62 @@
|
|
|
64
35
|
"temp-directory": "nyc/.nyc_output"
|
|
65
36
|
},
|
|
66
37
|
"devDependencies": {
|
|
67
|
-
"@fluid-tools/benchmark": "
|
|
68
|
-
"@fluid-tools/build-cli": "^0.
|
|
38
|
+
"@fluid-tools/benchmark": "0.47.0-140906",
|
|
39
|
+
"@fluid-tools/build-cli": "^0.13.1",
|
|
69
40
|
"@fluidframework/build-common": "^1.1.0",
|
|
70
|
-
"@fluidframework/build-tools": "^0.
|
|
41
|
+
"@fluidframework/build-tools": "^0.13.1",
|
|
71
42
|
"@fluidframework/eslint-config-fluid": "^2.0.0",
|
|
72
|
-
"@fluidframework/mocha-test-setup": "
|
|
73
|
-
"@microsoft/api-extractor": "^7.
|
|
74
|
-
"@rushstack/eslint-config": "^2.5.1",
|
|
43
|
+
"@fluidframework/mocha-test-setup": "2.0.0-dev.4.1.0.148229",
|
|
44
|
+
"@microsoft/api-extractor": "^7.34.4",
|
|
75
45
|
"@types/mocha": "^9.1.1",
|
|
76
|
-
"@types/node": "^14.18.
|
|
77
|
-
"concurrently": "^6.
|
|
46
|
+
"@types/node": "^14.18.38",
|
|
47
|
+
"concurrently": "^7.6.0",
|
|
78
48
|
"copyfiles": "^2.4.1",
|
|
79
|
-
"cross-env": "^7.0.
|
|
49
|
+
"cross-env": "^7.0.3",
|
|
80
50
|
"eslint": "~8.6.0",
|
|
81
51
|
"eslint-config-prettier": "~8.5.0",
|
|
82
|
-
"mocha": "^10.
|
|
83
|
-
"
|
|
52
|
+
"mocha": "^10.2.0",
|
|
53
|
+
"mocha-json-output-reporter": "^2.0.1",
|
|
54
|
+
"mocha-multi-reporters": "^1.5.1",
|
|
55
|
+
"moment": "^2.21.0",
|
|
56
|
+
"nyc": "^15.1.0",
|
|
84
57
|
"prettier": "~2.6.2",
|
|
85
|
-
"rimraf": "^
|
|
58
|
+
"rimraf": "^4.4.0",
|
|
86
59
|
"source-map-support": "^0.5.16",
|
|
87
60
|
"typescript": "~4.5.5"
|
|
88
61
|
},
|
|
89
62
|
"typeValidation": {
|
|
90
|
-
"disabled": true
|
|
63
|
+
"disabled": true,
|
|
64
|
+
"broken": {}
|
|
65
|
+
},
|
|
66
|
+
"scripts": {
|
|
67
|
+
"bench": "mocha --timeout 999999 --perfMode --parentProcess --fgrep @Benchmark --reporter \"../../../node_modules/@fluid-tools/benchmark/dist/MochaReporter.js\"",
|
|
68
|
+
"bench:profile": "mocha --v8-prof --timeout 999999 --perfMode --fgrep @Benchmark --reporter \"../../../node_modules/@fluid-tools/benchmark/dist/MochaReporter.js\" && node --prof-process isolate-0x*-v8.log > profile.txt && rm isolate-0x*-v8.log && cat profile.txt",
|
|
69
|
+
"build": "concurrently npm:build:compile npm:lint && npm run build:docs",
|
|
70
|
+
"build:commonjs": "npm run tsc && npm run typetests:gen && npm run build:test",
|
|
71
|
+
"build:compile": "concurrently npm:build:commonjs npm:build:esnext",
|
|
72
|
+
"build:docs": "api-extractor run --local --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../_api-extractor-temp/",
|
|
73
|
+
"build:esnext": "tsc --project ./tsconfig.esnext.json",
|
|
74
|
+
"build:full": "npm run build",
|
|
75
|
+
"build:full:compile": "npm run build:compile",
|
|
76
|
+
"build:test": "tsc --project ./src/test/tsconfig.json",
|
|
77
|
+
"ci:build:docs": "api-extractor run --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/* ../../../_api-extractor-temp/",
|
|
78
|
+
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
|
|
79
|
+
"eslint": "eslint --format stylish src",
|
|
80
|
+
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
81
|
+
"format": "npm run prettier:fix",
|
|
82
|
+
"lint": "npm run prettier && npm run eslint",
|
|
83
|
+
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
|
|
84
|
+
"prettier": "prettier --check . --ignore-path ../../../.prettierignore",
|
|
85
|
+
"prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
|
|
86
|
+
"test": "npm run test:mocha",
|
|
87
|
+
"test:benchmark:report": "mocha --node-option unhandled-rejections=strict,expose-gc --exit --perfMode --fgrep @Benchmark --reporter @fluid-tools/benchmark/dist/MochaReporter.js --timeout 60000",
|
|
88
|
+
"test:coverage": "nyc npm test -- --reporter xunit --reporter-option output=nyc/junit-report.xml",
|
|
89
|
+
"test:mocha": "mocha",
|
|
90
|
+
"test:mocha:multireport": "cross-env FLUID_TEST_MULTIREPORT=1 npm run test:mocha",
|
|
91
|
+
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
|
|
92
|
+
"tsc": "tsc",
|
|
93
|
+
"typetests:gen": "fluid-type-test-generator",
|
|
94
|
+
"typetests:prepare": "flub generate typetests --prepare --dir . --pin"
|
|
91
95
|
}
|
|
92
|
-
}
|
|
96
|
+
}
|
package/src/compare.ts
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* Compare two arrays. Returns true if their elements are equivalent and in the same order.
|
|
8
8
|
*
|
|
9
|
+
* @internal
|
|
10
|
+
*
|
|
9
11
|
* @param left - The first array to compare
|
|
10
12
|
* @param right - The second array to compare
|
|
11
13
|
* @param comparator - The function used to check if two `T`s are equivalent.
|